]> git.argeo.org Git - gpl/argeo-slc.git/blobdiff - plugins/org.argeo.slc.client.rcp/src/main/java/org/argeo/slc/client/rcp/SlcSecureWorkbenchAdvisor.java
Clean up directories
[gpl/argeo-slc.git] / plugins / org.argeo.slc.client.rcp / src / main / java / org / argeo / slc / client / rcp / SlcSecureWorkbenchAdvisor.java
index 1d2372f50265441ac33bc88b3f1e3a5a461edee8..785197d16b188ce9bee05582587adae1eaf6bf59 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2007-2012 Mathieu Baudier
+ * Copyright (C) 2007-2012 Argeo GmbH
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  */
 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);
-       }
-
 }