1 package org
.argeo
.slc
.client
.rap
;
3 import org
.argeo
.cms
.ui
.workbench
.rap
.RapWindowAdvisor
;
4 import org
.argeo
.cms
.ui
.workbench
.rap
.RapWorkbenchAdvisor
;
5 import org
.argeo
.cms
.ui
.workbench
.rap
.RapWorkbenchLogin
;
6 import org
.eclipse
.swt
.SWT
;
7 import org
.eclipse
.swt
.graphics
.Point
;
8 import org
.eclipse
.swt
.graphics
.Rectangle
;
9 import org
.eclipse
.swt
.widgets
.Display
;
10 import org
.eclipse
.swt
.widgets
.Shell
;
11 import org
.eclipse
.ui
.IWorkbenchWindow
;
12 import org
.eclipse
.ui
.actions
.ActionFactory
;
13 import org
.eclipse
.ui
.actions
.ActionFactory
.IWorkbenchAction
;
14 import org
.eclipse
.ui
.application
.IWorkbenchWindowConfigurer
;
15 import org
.eclipse
.ui
.application
.WorkbenchWindowAdvisor
;
18 * This class controls all aspects of the application's execution and is
19 * contributed through the plugin.xml.
21 public class SlcSecureRap
extends RapWorkbenchLogin
{
24 protected RapWorkbenchAdvisor
createRapWorkbenchAdvisor(
25 final String username
) {
26 return new RapWorkbenchAdvisor(username
) {
28 public WorkbenchWindowAdvisor
createWorkbenchWindowAdvisor(
29 IWorkbenchWindowConfigurer configurer
) {
30 return new SlcRapWorkbenchWindowAdvisor(configurer
, username
);
36 /** Workaround for resize issue */
37 class SlcRapWorkbenchWindowAdvisor
extends RapWindowAdvisor
{
39 public SlcRapWorkbenchWindowAdvisor(
40 IWorkbenchWindowConfigurer configurer
, String username
) {
41 super(configurer
, username
);
44 public void preWindowOpen() {
45 IWorkbenchWindowConfigurer configurer
= getWindowConfigurer();
46 configurer
.setShowCoolBar(true);
47 configurer
.setShowMenuBar(false);
48 configurer
.setShowStatusLine(false);
49 configurer
.setShowPerspectiveBar(true);
50 configurer
.setTitle("Argeo Secure UI"); //$NON-NLS-1$
52 // http://dev.eclipse.org/newslists/news.eclipse.technology.rap/msg02697.html
53 configurer
.setShellStyle(SWT
.NO_TRIM
);
54 Rectangle bounds
= Display
.getCurrent().getBounds();
55 configurer
.setInitialSize(new Point(bounds
.width
, bounds
.height
));
59 public void postWindowCreate() {
60 Shell shell
= getWindowConfigurer().getWindow().getShell();
61 shell
.setMaximized(true);
65 public void postWindowOpen() {
66 String defaultPerspective
= getWindowConfigurer()
67 .getWorkbenchConfigurer().getWorkbench()
68 .getPerspectiveRegistry().getDefaultPerspective();
69 if (defaultPerspective
== null) {
70 IWorkbenchWindow window
= getWindowConfigurer().getWindow();
74 IWorkbenchAction openPerspectiveDialogAction
= ActionFactory
.OPEN_PERSPECTIVE_DIALOG
76 openPerspectiveDialogAction
.run();