package org.argeo.security.ui.rcp;
import org.eclipse.ui.IPerspectiveDescriptor;
+import org.eclipse.ui.application.IWorkbenchConfigurer;
import org.eclipse.ui.application.IWorkbenchWindowConfigurer;
import org.eclipse.ui.application.WorkbenchAdvisor;
import org.eclipse.ui.application.WorkbenchWindowAdvisor;
+/**
+ * Workbench configuration which is aware of the logged in user and can remember
+ * workbench state.
+ */
public class SecureWorkbenchAdvisor extends WorkbenchAdvisor {
public final static String INITIAL_PERSPECTIVE_PROPERTY = "org.argeo.security.ui.initialPerspective";
private String initialPerspective = System.getProperty(
this.username = username;
}
+ @Override
+ public void initialize(final IWorkbenchConfigurer configurer) {
+ super.initialize(configurer);
+ configurer.setSaveAndRestore(true);
+ }
+
public WorkbenchWindowAdvisor createWorkbenchWindowAdvisor(
IWorkbenchWindowConfigurer configurer) {
return new SecureWorkbenchWindowAdvisor(configurer, username);
return initialPerspective;
}
+ protected String getUsername() {
+ return username;
+ }
}