Controlling the size of the workbench window

Follow these steps to change the default size of the workbench window:

  1. From the Navigator or Package Explorer view, open the HostAccessWorkbenchWindowAdvisor class located in the hostaccess package of the com.ibm.hats.rcp.runtime.extension plug-in project.
  2. Find the preWindowOpen() method and change the parameter passed to the setInitializeSize method of the IWorkbenchWindowConfigurer object. For example, to set the initial window size to 800 pixels wide and 600 pixels tall, update or add the following code:
    public void preWindowOpen() {
        IWorkbenchWindowConfigurer configurer = getWindowConfigurer();
        configurer.setInitialSize(new Point(800, 600));
        ...        
    }
To automatically maximize the workbench window by default when it is opened, implement the postWindowCreate() method of the HostAccessWorkbenchWindowAdvisor class:
public void postWindowCreate() {
    PlatformUI.getWorkbench().getActiveWorkbenchWindow().
                    getShell().setMaximized(true);       
}
Note: You might need to update this class's import section if one or more referenced classes cannot be resolved. To automatically update the import section, right-click inside the editor of the source file and select Source > Organize Imports.