View Javadoc
1   package org.argeo.suite.e4.rap;
2   
3   import javax.annotation.PostConstruct;
4   
5   import org.eclipse.e4.ui.model.application.MApplication;
6   import org.eclipse.e4.ui.model.application.ui.basic.MWindow;
7   import org.eclipse.e4.ui.workbench.modeling.EModelService;
8   import org.eclipse.swt.SWT;
9   
10  public class RapMainShellAddon {
11  	private final static String STYLE_OVERRIDE = "styleOverride";
12  	private final static String SHELL_MAXIMIZED = "shellMaximized";
13  
14  	@PostConstruct
15  	void init(EModelService modelService, MApplication application) {
16  		MWindow window = (MWindow) modelService.find("org.argeo.suite.e4.trimmedwindow.main", application);
17  		String currentStyle = window.getPersistedState().get(STYLE_OVERRIDE);
18  		int style = 8;
19  		if (currentStyle != null) {
20  			style = Integer.parseInt(currentStyle);
21  		}
22  		style = style | SWT.NO_TRIM;
23  		window.getPersistedState().put(STYLE_OVERRIDE, Integer.toString(style));
24  		window.getTags().add(SHELL_MAXIMIZED);
25  	}
26  }