Search code examples
eclipse-rcprcpe4

Set the window of an eclipse e4 application to have based screen size


I followed the below link to open window size as whole screen size, it's working fine for windows os but linux os small size window is opening. How to open screen sized window in linux os just like windows os?

Window Size link


Solution

  • An alternative way to maximize the window is to do the following in the @ProcessAdditions method of your Life Cycle class (if you have one):

    @ProcessAdditions
    public void processAdditions(final MApplication app, final EModelService modelService)
    {
      MWindow window = (MWindow)modelService.find("id of top window", app);
    
      Monitor monitor = Display.getCurrent().getPrimaryMonitor();
    
      Rectangle monitorClientArea = monitor.getClientArea();
    
      window.setX(monitorClientArea.x);
      window.setY(monitorClientArea.y);
      window.setWidth(monitorClientArea.width);
      window.setHeight(monitorClientArea.height);
    }