+ change default UI window size
authorBruno Sinou <bsinou@argeo.org>
Fri, 5 Nov 2010 18:32:29 +0000 (18:32 +0000)
committerBruno Sinou <bsinou@argeo.org>
Fri, 5 Nov 2010 18:32:29 +0000 (18:32 +0000)
+ implements save UI state

git-svn-id: https://svn.argeo.org/slc/trunk@3851 4cfe0d0a-d680-48aa-b62c-e0a02a3f76cc

eclipse/plugins/org.argeo.slc.client.rcp/src/org/argeo/slc/client/rcp/ApplicationWorkbenchAdvisor.java
eclipse/plugins/org.argeo.slc.client.rcp/src/org/argeo/slc/client/rcp/ApplicationWorkbenchWindowAdvisor.java

index f8a47ae9f275d5bf373b533a757e158dc060d171..5d751961f1072774666658d90eb47755392b10f2 100644 (file)
@@ -1,9 +1,16 @@
 package org.argeo.slc.client.rcp;
 
+import org.eclipse.ui.application.IWorkbenchConfigurer;
 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.
+ * 
+ * @author bsinou
+ * 
+ */
 public class ApplicationWorkbenchAdvisor extends WorkbenchAdvisor {
 
        private static final String PERSPECTIVE_ID = "org.argeo.slc.client.ui.perspectives.slcExecution";
@@ -17,4 +24,13 @@ public class ApplicationWorkbenchAdvisor extends WorkbenchAdvisor {
                return PERSPECTIVE_ID;
        }
 
+       @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 c7ae9a86c5fd485193e37f73379af52799044ab4..f19e202727ba237624a9b2391f32d3fef0521c5f 100644 (file)
@@ -16,6 +16,12 @@ import org.eclipse.ui.application.IActionBarConfigurer;
 import org.eclipse.ui.application.IWorkbenchWindowConfigurer;
 import org.eclipse.ui.application.WorkbenchWindowAdvisor;
 
+/**
+ * Set here initial default size of the UI
+ * 
+ * @author bsinou
+ * 
+ */
 public class ApplicationWorkbenchWindowAdvisor extends WorkbenchWindowAdvisor {
 
        private TrayItem trayItem;
@@ -32,10 +38,14 @@ public class ApplicationWorkbenchWindowAdvisor extends WorkbenchWindowAdvisor {
 
        public void preWindowOpen() {
                IWorkbenchWindowConfigurer configurer = getWindowConfigurer();
-               configurer.setInitialSize(new Point(1600, 800));
+
+               configurer.getWorkbenchConfigurer().restoreState();
+               // set default window size
+               configurer.setInitialSize(new Point(1200, 900));
                configurer.setShowCoolBar(true);
                configurer.setShowStatusLine(true);
                configurer.setShowPerspectiveBar(true);
+
        }
 
        public void postWindowOpen() {