1 package org
.argeo
.security
.ui
.rap
;
3 import org
.eclipse
.swt
.SWT
;
4 import org
.eclipse
.swt
.graphics
.Point
;
5 import org
.eclipse
.swt
.graphics
.Rectangle
;
6 import org
.eclipse
.swt
.widgets
.Display
;
7 import org
.eclipse
.ui
.IWorkbenchWindow
;
8 import org
.eclipse
.ui
.actions
.ActionFactory
;
9 import org
.eclipse
.ui
.actions
.ActionFactory
.IWorkbenchAction
;
10 import org
.eclipse
.ui
.application
.ActionBarAdvisor
;
11 import org
.eclipse
.ui
.application
.IActionBarConfigurer
;
12 import org
.eclipse
.ui
.application
.IWorkbenchWindowConfigurer
;
13 import org
.eclipse
.ui
.application
.WorkbenchWindowAdvisor
;
15 /** Eclipse RAP specific window advisor */
16 public class RapWindowAdvisor
extends WorkbenchWindowAdvisor
{
18 private String username
;
20 public RapWindowAdvisor(IWorkbenchWindowConfigurer configurer
,
23 this.username
= username
;
27 public ActionBarAdvisor
createActionBarAdvisor(
28 IActionBarConfigurer configurer
) {
29 return new RapActionBarAdvisor(configurer
, username
);
32 public void preWindowOpen() {
33 IWorkbenchWindowConfigurer configurer
= getWindowConfigurer();
34 configurer
.setShowCoolBar(true);
35 configurer
.setShowMenuBar(false);
36 configurer
.setShowStatusLine(false);
37 configurer
.setShowPerspectiveBar(true);
38 configurer
.setTitle("Argeo Secure UI"); //$NON-NLS-1$
40 // http://dev.eclipse.org/newslists/news.eclipse.technology.rap/msg02697.html
41 configurer
.setShellStyle(SWT
.NONE
);
42 Rectangle bounds
= Display
.getCurrent().getBounds();
43 configurer
.setInitialSize(new Point(bounds
.width
, bounds
.height
));
47 public void postWindowOpen() {
48 String defaultPerspective
= getWindowConfigurer()
49 .getWorkbenchConfigurer().getWorkbench()
50 .getPerspectiveRegistry().getDefaultPerspective();
51 if (defaultPerspective
== null) {
52 IWorkbenchWindow window
= getWindowConfigurer().getWindow();
56 IWorkbenchAction openPerspectiveDialogAction
= ActionFactory
.OPEN_PERSPECTIVE_DIALOG
58 openPerspectiveDialogAction
.run();