]> git.argeo.org Git - lgpl/argeo-commons.git/blob - SecureWorkbenchAdvisor.java
bca01e714b2388b353fdc741a1c8cb9e1530ed38
[lgpl/argeo-commons.git] / SecureWorkbenchAdvisor.java
1 package org.argeo.security.ui.rcp;
2
3 import org.eclipse.ui.application.IWorkbenchWindowConfigurer;
4 import org.eclipse.ui.application.WorkbenchAdvisor;
5 import org.eclipse.ui.application.WorkbenchWindowAdvisor;
6
7 public class SecureWorkbenchAdvisor extends WorkbenchAdvisor {
8 static final String DEFAULT_PERSPECTIVE_ID = "org.argeo.security.ui.adminSecurityPerspective"; //$NON-NLS-1$
9 public final static String INITIAL_PERSPECTIVE_PROPERTY = "org.argeo.security.ui.initialPerspective";
10
11 private final String username;
12 private String initialPerspective = System.getProperty(
13 INITIAL_PERSPECTIVE_PROPERTY, DEFAULT_PERSPECTIVE_ID);
14
15 public SecureWorkbenchAdvisor(String username) {
16 super();
17 this.username = username;
18 }
19
20 public WorkbenchWindowAdvisor createWorkbenchWindowAdvisor(
21 IWorkbenchWindowConfigurer configurer) {
22 return new SecureWorkbenchWindowAdvisor(configurer, username);
23 }
24
25 public String getInitialWindowPerspectiveId() {
26 return initialPerspective;
27 }
28 }