]> git.argeo.org Git - gpl/argeo-slc.git/commitdiff
RCP remembers workbench state
authorMathieu Baudier <mbaudier@argeo.org>
Mon, 20 Aug 2012 13:32:47 +0000 (13:32 +0000)
committerMathieu Baudier <mbaudier@argeo.org>
Mon, 20 Aug 2012 13:32:47 +0000 (13:32 +0000)
git-svn-id: https://svn.argeo.org/slc/trunk@5516 4cfe0d0a-d680-48aa-b62c-e0a02a3f76cc

plugins/org.argeo.slc.client.rcp/src/main/java/org/argeo/slc/client/rcp/SlcSecureWorkbenchAdvisor.java
plugins/org.argeo.slc.client.rcp/src/main/java/org/argeo/slc/client/rcp/SlcSecureWorkbenchWindowAdvisor.java

index 1d2372f50265441ac33bc88b3f1e3a5a461edee8..1109b1264f44c165973095a70c112524c23cd6d4 100644 (file)
  */
 package org.argeo.slc.client.rcp;
 
-import org.eclipse.ui.application.IWorkbenchConfigurer;
+import org.argeo.security.ui.rcp.SecureWorkbenchAdvisor;
 import org.eclipse.ui.application.IWorkbenchWindowConfigurer;
-import org.eclipse.ui.application.WorkbenchAdvisor;
 import org.eclipse.ui.application.WorkbenchWindowAdvisor;
 
-/** Implements initial perspective and saveAndRestore status of the workbench. */
-public class SlcSecureWorkbenchAdvisor extends WorkbenchAdvisor {
-       public final static String INITIAL_PERSPECTIVE_PROPERTY = "org.argeo.security.ui.initialPerspective";
-       private String initialPerspective = System
-                       .getProperty(INITIAL_PERSPECTIVE_PROPERTY);
-       private String username;
-
+/**
+ * Custom {@link SecureWorkbenchAdvisor} in order to create a
+ * {@link SlcSecureWorkbenchWindowAdvisor}.
+ */
+public class SlcSecureWorkbenchAdvisor extends SecureWorkbenchAdvisor {
        public SlcSecureWorkbenchAdvisor(String username) {
-               super();
-               this.username = username;
+               super(username);
        }
 
        public WorkbenchWindowAdvisor createWorkbenchWindowAdvisor(
                        IWorkbenchWindowConfigurer configurer) {
-               return new SlcSecureWorkbenchWindowAdvisor(configurer, username);
-       }
-
-       public String getInitialWindowPerspectiveId() {
-               return initialPerspective;
+               return new SlcSecureWorkbenchWindowAdvisor(configurer, getUsername());
        }
-
-       @Override
-       public void initialize(IWorkbenchConfigurer configurer) {
-               super.initialize(configurer);
-               // To remember the user's layout and window size for the next time he
-               // starts the application
-               //configurer.setSaveAndRestore(true);
-       }
-
 }
index eb46844a30e7c283160a975aa7fc7912b7d9e926..26f0ff246416a1b253d801caa2d18922c27bdee2 100644 (file)
@@ -31,7 +31,10 @@ import org.eclipse.ui.IWorkbenchWindow;
 import org.eclipse.ui.application.IWorkbenchWindowConfigurer;
 import org.eclipse.ui.part.EditorInputTransfer;
 
-/** Set here initial default size of the UI */
+/**
+ * Custom {@link SecureWorkbenchWindowAdvisor} which can add a tray. TODO: to
+ * be factorized in Argeo Commons and made more generic.
+ */
 public class SlcSecureWorkbenchWindowAdvisor extends
                SecureWorkbenchWindowAdvisor {
        public final static String IN_TRAY_PROPERTY = "org.argeo.slc.ui.inTray";