Small improvements
[lgpl/argeo-commons.git] / security / eclipse / plugins / org.argeo.security.ui.application / src / main / java / org / argeo / security / ui / application / SecureWorkbenchAdvisor.java
index dd12e63af8673d16e9a2d05d50ffad8679bfc788..4179816646d172c83c2ff8b6d6613090a491a24f 100644 (file)
@@ -6,13 +6,18 @@ import org.eclipse.ui.application.WorkbenchWindowAdvisor;
 
 public class SecureWorkbenchAdvisor extends WorkbenchAdvisor {
 
-       static final String PERSPECTIVE_ID = "org.argeo.security.ui.securityPerspective"; //$NON-NLS-1$
+       static final String DEFAULT_PERSPECTIVE_ID = "org.argeo.security.ui.securityPerspective"; //$NON-NLS-1$
 
-    public WorkbenchWindowAdvisor createWorkbenchWindowAdvisor(IWorkbenchWindowConfigurer configurer) {
-        return new SecureWorkbenchWindowAdvisor(configurer);
-    }
+       public final static String INITIAL_PERSPECTIVE_PROPERTY = "org.argeo.security.ui.initialPerspective";
+       private String initialPerspective = System.getProperty(
+                       INITIAL_PERSPECTIVE_PROPERTY, DEFAULT_PERSPECTIVE_ID);
+
+       public WorkbenchWindowAdvisor createWorkbenchWindowAdvisor(
+                       IWorkbenchWindowConfigurer configurer) {
+               return new SecureWorkbenchWindowAdvisor(configurer);
+       }
 
        public String getInitialWindowPerspectiveId() {
-               return PERSPECTIVE_ID;
+               return initialPerspective;
        }
 }