]> git.argeo.org Git - gpl/argeo-slc.git/blob - eclipse/plugins/org.argeo.slc.client.rcp/src/main/java/org/argeo/slc/client/rcp/SlcSecureWorkbenchAdvisor.java
Improve RPM packaging
[gpl/argeo-slc.git] / eclipse / plugins / org.argeo.slc.client.rcp / src / main / java / org / argeo / slc / client / rcp / SlcSecureWorkbenchAdvisor.java
1 package org.argeo.slc.client.rcp;
2
3 import org.eclipse.ui.application.IWorkbenchConfigurer;
4 import org.eclipse.ui.application.IWorkbenchWindowConfigurer;
5 import org.eclipse.ui.application.WorkbenchAdvisor;
6 import org.eclipse.ui.application.WorkbenchWindowAdvisor;
7
8 /**
9 * implements initial perspective and saveAndRestore status of the workbench.
10 *
11 * @author bsinou
12 *
13 */
14 public class SlcSecureWorkbenchAdvisor extends WorkbenchAdvisor {
15 // private static final String PERSPECTIVE_ID =
16 // "org.argeo.slc.client.ui.perspectives.slcExecution";
17 static final String DEFAULT_PERSPECTIVE_ID = "org.argeo.security.ui.securityPerspective"; //$NON-NLS-1$
18
19 public final static String INITIAL_PERSPECTIVE_PROPERTY = "org.argeo.security.ui.initialPerspective";
20 private String initialPerspective = System.getProperty(
21 INITIAL_PERSPECTIVE_PROPERTY, DEFAULT_PERSPECTIVE_ID);
22 private String username;
23
24 public SlcSecureWorkbenchAdvisor(String username) {
25 super();
26 this.username = username;
27 }
28
29 public WorkbenchWindowAdvisor createWorkbenchWindowAdvisor(
30 IWorkbenchWindowConfigurer configurer) {
31 return new SlcSecureWorkbenchWindowAdvisor(configurer, username);
32 }
33
34 public String getInitialWindowPerspectiveId() {
35 // return PERSPECTIVE_ID;
36 return initialPerspective;
37 }
38
39 @Override
40 public void initialize(IWorkbenchConfigurer configurer) {
41 super.initialize(configurer);
42 // To remember the user's layout and window size for the next time he
43 // starts the application
44 // configurer.setSaveAndRestore(true);
45 }
46
47
48 }