Java - Eclipse-RCP

set size of the applicationwindow at the gun

To set the size of the mainwindow of an Eclipse-RCP-application at the gun the method createWindowContents(..) in the class ApplicationWorkbenchWindowAdvisor must be overwritten.
At the same place you can also set, if a toolbar (coolbar) and a statusline shall be displayed.


import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.application.ActionBarAdvisor;
import org.eclipse.ui.application.IActionBarConfigurer;
import org.eclipse.ui.application.IWorkbenchWindowConfigurer;
import org.eclipse.ui.application.WorkbenchWindowAdvisor;
 
public class ApplicationWorkbenchWindowAdvisor extends WorkbenchWindowAdvisor {
   .
   .
   .    
 
    @Override
    public void preWindowOpen() {
        IWorkbenchWindowConfigurer configurer = getWindowConfigurer();
        configurer.setInitialSize(new Point(1024, 750));
        configurer.setShowCoolBar(false);
        configurer.setShowStatusLine(false);
        configurer.setTitle("Demo-Programm");
    }
}


see also: maximize applicationwindow


Eigene Werkzeuge
Werkzeuge

gratis Counter by GOWEB
seit 9.10.2007