]> git.argeo.org Git - gpl/argeo-slc.git/commitdiff
integrate SLC RAP & RCP in secure.ui
authorBruno Sinou <bsinou@argeo.org>
Thu, 17 Feb 2011 11:46:08 +0000 (11:46 +0000)
committerBruno Sinou <bsinou@argeo.org>
Thu, 17 Feb 2011 11:46:08 +0000 (11:46 +0000)
git-svn-id: https://svn.argeo.org/slc/trunk@4153 4cfe0d0a-d680-48aa-b62c-e0a02a3f76cc

21 files changed:
demo/slc-client-rcp.product
demo/slc_demo_rap.properties
eclipse/plugins/org.argeo.slc.client.rap/META-INF/MANIFEST.MF
eclipse/plugins/org.argeo.slc.client.rap/plugin.xml
eclipse/plugins/org.argeo.slc.client.rap/pom.xml
eclipse/plugins/org.argeo.slc.client.rap/src/main/java/org/argeo/slc/client/rap/ApplicationWorkbenchAdvisor.java
eclipse/plugins/org.argeo.slc.client.rap/src/main/java/org/argeo/slc/client/rap/ApplicationWorkbenchWindowAdvisor.java [deleted file]
eclipse/plugins/org.argeo.slc.client.rap/src/main/java/org/argeo/slc/client/rap/SlcClientRapApplication.java [deleted file]
eclipse/plugins/org.argeo.slc.client.rap/src/main/java/org/argeo/slc/client/rap/SlcRapSecureWorkbenchWindowAdvisor.java [new file with mode: 0644]
eclipse/plugins/org.argeo.slc.client.rap/src/main/java/org/argeo/slc/client/rap/SlcSecureRap.java [new file with mode: 0644]
eclipse/plugins/org.argeo.slc.client.rcp/META-INF/MANIFEST.MF
eclipse/plugins/org.argeo.slc.client.rcp/plugin.xml
eclipse/plugins/org.argeo.slc.client.rcp/pom.xml
eclipse/plugins/org.argeo.slc.client.rcp/src/main/java/org/argeo/slc/client/rcp/ApplicationWorkbenchAdvisor.java [deleted file]
eclipse/plugins/org.argeo.slc.client.rcp/src/main/java/org/argeo/slc/client/rcp/ApplicationWorkbenchWindowAdvisor.java [deleted file]
eclipse/plugins/org.argeo.slc.client.rcp/src/main/java/org/argeo/slc/client/rcp/SlcClientRcpApplication.java [deleted file]
eclipse/plugins/org.argeo.slc.client.rcp/src/main/java/org/argeo/slc/client/rcp/SlcSecureClientApplication.java [new file with mode: 0644]
eclipse/plugins/org.argeo.slc.client.rcp/src/main/java/org/argeo/slc/client/rcp/SlcSecureWorkbenchAdvisor.java [new file with mode: 0644]
eclipse/plugins/org.argeo.slc.client.rcp/src/main/java/org/argeo/slc/client/rcp/SlcSecureWorkbenchWindowAdvisor.java [new file with mode: 0644]
eclipse/plugins/org.argeo.slc.client.ui/src/main/java/org/argeo/slc/client/ui/providers/ProcessParametersEditingSupport.java
eclipse/plugins/org.argeo.slc.client.ui/src/main/java/org/argeo/slc/client/ui/views/ExecutionModulesView.java

index 9621e7cf8da6d1fc5cd26daba301f29c34ccce42..b0c48b16fee21f1690c267b7497cb2a48c795d91 100644 (file)
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <?pde version="3.5"?>
 
-<product name="SLC" uid="org.argeo.slc.client.rcp.product" application="org.argeo.security.ui.application.secureUi" version="1.0.0.qualifier" useFeatures="false" includeLaunchers="false">
+<product name="SLC" uid="org.argeo.slc.client.rcp.product" id="org.argeo.slc.client.rcp.product" application="org.argeo.slc.client.rcp.application" version="1.0.0.qualifier" useFeatures="false" includeLaunchers="false">
 
    <configIni use="default">
    </configIni>
       <plugin id="org.argeo.slc.client.ui.dist"/>
       <plugin id="org.argeo.slc.core"/>
       <plugin id="org.argeo.slc.demo.agent" fragment="true"/>
-      <plugin id="org.argeo.slc.demo.ant"/>
+      <plugin id="org.argeo.slc.demo.ant" fragment=""/>
       <plugin id="org.argeo.slc.demo.basic"/>
       <plugin id="org.argeo.slc.demo.log4j" fragment="true"/>
       <plugin id="org.argeo.slc.detached"/>
index 32d19a347b420de084a1198d27ff2bc1ab72efea..c716f7f0b1c0e8452c7da130f37af5f3828c8875 100644 (file)
@@ -6,38 +6,38 @@ org.eclipse.equinox.http.jetty,\
 org.eclipse.equinox.http.registry,\
 org.eclipse.equinox.launcher,\
 org.mortbay.jetty.server,\
-org.springframework.osgi.extender,\
+org.argeo.security.equinox,\
 org.argeo.security.manager.ldap,\
 org.argeo.security.services,\
-org.argeo.security.equinox,\
-org.argeo.security.ui,\
-org.argeo.security.ui.application,\
+org.argeo.server.ads.server,\
 org.argeo.slc.agent,\
 org.argeo.slc.client.agent,\
+org.argeo.slc.client.commons,\
+org.argeo.slc.client.core,\
 org.argeo.slc.client.hibernate,\
 org.argeo.slc.client.oxm,\
+org.argeo.slc.client.rap,\
 org.argeo.slc.client.ui,\
 org.argeo.slc.demo.ant,\
 org.argeo.slc.demo.basic,\
+org.argeo.slc.demo.ant,\
 org.argeo.slc.server.castor,\
 org.argeo.slc.server.h2,\
 org.argeo.slc.server.hibernate,\
 org.argeo.slc.server.services,\
-org.argeo.server.ads.server,\
-
-
-org.argeo.security.ui.initialPerspective=org.argeo.slc.client.ui.perspectives.slcExecution
-
-# LDAP
-#argeo.ldap.rootdn=dc=slc,dc=argeo,dc=net
-#argeo.ads.init.ldif=osgibundle:init-slc.ldif
+org.springframework.osgi.extender,\
 
 eclipse.ignoreApp=true
 osgi.noShutdown=true
 
+org.argeo.security.ui.initialPerspective=org.argeo.slc.client.ui.perspectives.slcExecution
+
 log4j.configuration=file:../../log4j.properties
 
 org.eclipse.equinox.http.jetty.log.stderr.threshold=debug
 org.osgi.service.http.port=9090
 
-# java -Dlog4j.configuration=file:/home/mbaudier/dev/src/slc/demo/log4j.properties -Dosgi.framework=lib/org.eclipse.osgi_3.6.1.R36x_v20100806.jar -jar lib/org.eclipse.equinox.launcher_1.1.0.v20100507.jar -console -configuration configuration
\ No newline at end of file
+
+# LDAP
+#argeo.ldap.rootdn=dc=slc,dc=argeo,dc=net
+#argeo.ads.init.ldif=osgibundle:init-slc.ldif
\ No newline at end of file
index eedcc6ea342d7e939a32631712bf9ab5ba76a4d7..75d9f8415ffe7ad1de6cd4e68d7255bf46cfeffc 100644 (file)
@@ -10,4 +10,5 @@ Bundle-RequiredExecutionEnvironment: JavaSE-1.6
 Bundle-ActivationPolicy: lazy
 Import-Package: javax.servlet;version="2.4.0",
  javax.servlet.http;version="2.4.0",
+ org.argeo.security.ui.application,
  org.argeo.slc.client.ui.perspectives
index 64ae650172e35377f79b1a6aaba7d09b594bcb82..f7715af65f482403f29279c394ca5f8ad1bb57ad 100644 (file)
@@ -3,7 +3,7 @@
 <plugin>\r
 \r
  <extension\r
-         id="org.argeo.slc.client.rcp.product"\r
+         id="org.argeo.slc.client.rap.product"\r
          point="org.eclipse.core.runtime.products">\r
       <product\r
             name="Slc RAP Product"\r
@@ -23,9 +23,9 @@
    <extension\r
          point="org.eclipse.rap.ui.entrypoint">\r
       <entrypoint\r
-            class="org.argeo.slc.client.rap.SlcClientRapApplication"\r
+            class="org.argeo.slc.client.rap.SlcSecureRap"\r
             parameter="slc"\r
-            id="org.argeo.slc.client.rap.SlcClientRapApplication">\r
+            id="org.argeo.slc.client.rap.slcSecureRap">\r
       </entrypoint>\r
    </extension>\r
      \r
@@ -63,5 +63,4 @@
             name="Exit">\r
       </command> \r
    </extension> -->\r
-  \r
 </plugin>\r
index f270cfd385800d88991fd4f2ecb628545e7fa4a3..a5afd2e24261a06b2f86d1fc739f79402693d6f4 100644 (file)
                        <version>${version.argeo-commons}</version>
                </dependency>
 
-               <!-- Eclipse -->
-               <!-- <dependency> <groupId>org.eclipse.ui</groupId> <artifactId>org.eclipse.ui</artifactId> 
-                       </dependency> <dependency> <groupId>org.eclipse.core</groupId> <artifactId>org.eclipse.core.runtime</artifactId> 
-                       </dependency> <dependency> <groupId>org.eclipse.swt</groupId> <artifactId>org.eclipse.swt.gtk.linux.x86_64</artifactId> 
-                       </dependency> <dependency> <groupId>org.eclipse.swt</groupId> <artifactId>org.eclipse.swt.gtk.linux.x86</artifactId> 
-                       </dependency> -->
+               <!-- Argeo common distribution for Secured UI -->
+               <dependency>
+                       <groupId>org.argeo.commons.security</groupId>
+                       <artifactId>org.argeo.security.ui.application</artifactId>
+                       <version>${version.argeo-commons}</version>
+               </dependency>
        </dependencies>
 </project>
index d3d058144f0fe7deece93897d8d0555223ce2899..f272f05c7cf0902edff26b6145dff3f824466590 100644 (file)
@@ -13,7 +13,7 @@ public class ApplicationWorkbenchAdvisor extends WorkbenchAdvisor {
        private static final String PERSPECTIVE_ID = "org.argeo.slc.client.ui.perspectives.slcExecution";
 
     public WorkbenchWindowAdvisor createWorkbenchWindowAdvisor(IWorkbenchWindowConfigurer configurer) {
-        return new ApplicationWorkbenchWindowAdvisor(configurer);
+        return new SlcRapSecureWorkbenchWindowAdvisor(configurer);
     }
 
        public String getInitialWindowPerspectiveId() {
diff --git a/eclipse/plugins/org.argeo.slc.client.rap/src/main/java/org/argeo/slc/client/rap/ApplicationWorkbenchWindowAdvisor.java b/eclipse/plugins/org.argeo.slc.client.rap/src/main/java/org/argeo/slc/client/rap/ApplicationWorkbenchWindowAdvisor.java
deleted file mode 100644 (file)
index 58ef8af..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-package org.argeo.slc.client.rap;
-
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.ui.application.ActionBarAdvisor;
-import org.eclipse.ui.application.IActionBarConfigurer;
-import org.eclipse.ui.application.IWorkbenchWindowConfigurer;
-import org.eclipse.ui.application.WorkbenchWindowAdvisor;
-
-/**
- * Configures the initial size and appearance of a workbench window.
- */
-public class ApplicationWorkbenchWindowAdvisor extends WorkbenchWindowAdvisor {
-
-       public ApplicationWorkbenchWindowAdvisor(
-                       IWorkbenchWindowConfigurer configurer) {
-               super(configurer);
-       }
-
-       public ActionBarAdvisor createActionBarAdvisor(
-                       IActionBarConfigurer configurer) {
-               return new ApplicationActionBarAdvisor(configurer);
-       }
-
-       public void preWindowOpen() {
-               IWorkbenchWindowConfigurer configurer = getWindowConfigurer();
-               configurer.setInitialSize(new Point(1200, 900));
-               configurer.setShowCoolBar(false);
-               configurer.setShowStatusLine(false);
-       }
-}
diff --git a/eclipse/plugins/org.argeo.slc.client.rap/src/main/java/org/argeo/slc/client/rap/SlcClientRapApplication.java b/eclipse/plugins/org.argeo.slc.client.rap/src/main/java/org/argeo/slc/client/rap/SlcClientRapApplication.java
deleted file mode 100644 (file)
index 5b7fc5f..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-package org.argeo.slc.client.rap;
-
-import org.eclipse.rwt.lifecycle.IEntryPoint;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.application.WorkbenchAdvisor;
-
-/**
- * This class controls all aspects of the application's execution
- * and is contributed through the plugin.xml.
- */
-public class SlcClientRapApplication implements IEntryPoint {
-
-       public int createUI() {
-               Display display = PlatformUI.createDisplay();
-               WorkbenchAdvisor advisor = new ApplicationWorkbenchAdvisor();
-               return PlatformUI.createAndRunWorkbench( display, advisor );
-       }
-}
diff --git a/eclipse/plugins/org.argeo.slc.client.rap/src/main/java/org/argeo/slc/client/rap/SlcRapSecureWorkbenchWindowAdvisor.java b/eclipse/plugins/org.argeo.slc.client.rap/src/main/java/org/argeo/slc/client/rap/SlcRapSecureWorkbenchWindowAdvisor.java
new file mode 100644 (file)
index 0000000..fefbeeb
--- /dev/null
@@ -0,0 +1,36 @@
+package org.argeo.slc.client.rap;
+
+import org.argeo.security.ui.application.RapSecureWorkbenchWindowAdvisor;
+import org.eclipse.ui.application.IWorkbenchWindowConfigurer;
+
+/**
+ * Configures the initial size and appearance of a workbench window.
+ */
+public class SlcRapSecureWorkbenchWindowAdvisor extends
+               RapSecureWorkbenchWindowAdvisor {
+
+       public SlcRapSecureWorkbenchWindowAdvisor(
+                       IWorkbenchWindowConfigurer configurer) {
+               super(configurer);
+       }
+
+       // Customisation of the main frame can be done here.
+       @Override
+       public void preWindowOpen() {
+               super.preWindowOpen();
+               //
+               // IWorkbenchWindowConfigurer configurer = getWindowConfigurer();
+               // configurer.setShowCoolBar(true);
+               // configurer.setShowMenuBar(true);
+               // configurer.setShowStatusLine(false);
+               // configurer.setShowPerspectiveBar(true);
+               //              configurer.setTitle("Argeo Secure UI"); //$NON-NLS-1$
+               // // Full screen, see
+               // //
+               // http://dev.eclipse.org/newslists/news.eclipse.technology.rap/msg02697.html
+               // configurer.setShellStyle(SWT.NONE);
+               // Rectangle bounds = Display.getDefault().getBounds();
+               // configurer.setInitialSize(new Point(bounds.width, bounds.height));
+       }
+
+}
diff --git a/eclipse/plugins/org.argeo.slc.client.rap/src/main/java/org/argeo/slc/client/rap/SlcSecureRap.java b/eclipse/plugins/org.argeo.slc.client.rap/src/main/java/org/argeo/slc/client/rap/SlcSecureRap.java
new file mode 100644 (file)
index 0000000..f37988f
--- /dev/null
@@ -0,0 +1,26 @@
+package org.argeo.slc.client.rap;
+
+import org.argeo.security.ui.application.SecureRap;
+import org.argeo.security.ui.application.SecureWorkbenchAdvisor;
+import org.eclipse.ui.application.IWorkbenchWindowConfigurer;
+import org.eclipse.ui.application.WorkbenchAdvisor;
+import org.eclipse.ui.application.WorkbenchWindowAdvisor;
+
+/**
+ * This class controls all aspects of the application's execution and is
+ * contributed through the plugin.xml.
+ */
+public class SlcSecureRap extends SecureRap {
+
+
+       @Override
+       protected WorkbenchAdvisor createWorkbenchAdvisor() {
+               return new SecureWorkbenchAdvisor() {
+                       public WorkbenchWindowAdvisor createWorkbenchWindowAdvisor(
+                                       IWorkbenchWindowConfigurer configurer) {
+                               return new SlcRapSecureWorkbenchWindowAdvisor(configurer);
+                       }
+
+               };
+       }
+}
index 9db7888edbc283c582ff24b752eeae08ded3ea15..f884def28e17b0999492b6e111d9335442135fb0 100644 (file)
@@ -13,5 +13,6 @@ Import-Package: org.argeo.slc.client.ui.perspectives,
  org.argeo.slc.execution,
  org.argeo.slc.process,
  org.argeo.slc.runtime,
+ org.argeo.security.ui.application,
  org.argeo.slc.services,
  org.argeo.slc.services.impl
index a2babbae2d149d0ff59f43fa13910196be0257b1..feb47027df96c6c8f26d7f40d2d60ab1504c25be 100644 (file)
@@ -26,7 +26,7 @@
          point="org.eclipse.core.runtime.applications">
       <application>
          <run
-               class="org.argeo.slc.client.rcp.SlcClientRcpApplication">
+               class="org.argeo.slc.client.rcp.SlcSecureClientApplication">
          </run>
       </application>
    </extension>
            sequence="CTRL+R">
      </key>
   </extension>
+   <extension
+         id="product"
+         point="org.eclipse.core.runtime.products">
+      <product
+            application="org.argeo.slc.client.rcp.application"
+            name="SLC">
+         <property
+               name="windowImages"
+               value="icons/argeo-icon-256.png">
+         </property>
+      </product>
+   </extension>
 </plugin>
index e088f58777226d19084b1c5e4e61835b24ec38be..cbe11271d8aadd8f0ce38f6acd0abb967d077e5a 100644 (file)
        <name>SLC Client RCP</name>
        <packaging>jar</packaging>
        <dependencies>
-               
+
                <!-- SLC -->
                <dependency>
                        <groupId>org.argeo.slc.eclipse</groupId>
                        <artifactId>org.argeo.slc.client.ui</artifactId>
                        <version>${project.version}</version>
                </dependency>
-               
+
                <!-- Argeo common distribution for RCP projects -->
                <dependency>
                        <groupId>org.argeo.commons.eclipse</groupId>
                        <artifactId>org.argeo.eclipse.dep.rcp</artifactId>
                        <version>${version.argeo-commons}</version>
                </dependency>
-               
-               <!-- Eclipse -->
-               <!--   <dependency>
-                       <groupId>org.eclipse.ui</groupId>
-                       <artifactId>org.eclipse.ui</artifactId>
-               </dependency>
-               <dependency>
-                       <groupId>org.eclipse.core</groupId>
-                       <artifactId>org.eclipse.core.runtime</artifactId>
-               </dependency>
+
+               <!-- Argeo common distribution for Secured UI -->
                <dependency>
-                       <groupId>org.eclipse.swt</groupId>
-                       <artifactId>org.eclipse.swt.gtk.linux.x86_64</artifactId>
+                       <groupId>org.argeo.commons.security</groupId>
+                       <artifactId>org.argeo.security.ui.application</artifactId>
+                       <version>${version.argeo-commons}</version>
                </dependency>
-               <dependency>
-                       <groupId>org.eclipse.swt</groupId>
-                       <artifactId>org.eclipse.swt.gtk.linux.x86</artifactId>
-               </dependency> -->
+
+
+               <!-- Eclipse -->
+               <!-- <dependency> <groupId>org.eclipse.ui</groupId> <artifactId>org.eclipse.ui</artifactId> 
+                       </dependency> <dependency> <groupId>org.eclipse.core</groupId> <artifactId>org.eclipse.core.runtime</artifactId> 
+                       </dependency> <dependency> <groupId>org.eclipse.swt</groupId> <artifactId>org.eclipse.swt.gtk.linux.x86_64</artifactId> 
+                       </dependency> <dependency> <groupId>org.eclipse.swt</groupId> <artifactId>org.eclipse.swt.gtk.linux.x86</artifactId> 
+                       </dependency> -->
        </dependencies>
 </project>
diff --git a/eclipse/plugins/org.argeo.slc.client.rcp/src/main/java/org/argeo/slc/client/rcp/ApplicationWorkbenchAdvisor.java b/eclipse/plugins/org.argeo.slc.client.rcp/src/main/java/org/argeo/slc/client/rcp/ApplicationWorkbenchAdvisor.java
deleted file mode 100644 (file)
index ae2a6b7..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-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";
-//     private static final String PERSPECTIVE_ID = "org.argeo.slc.client.ui.dist.distributionPerspective";
-
-       public WorkbenchWindowAdvisor createWorkbenchWindowAdvisor(
-                       IWorkbenchWindowConfigurer configurer) {
-               return new ApplicationWorkbenchWindowAdvisor(configurer);
-       }
-
-       public String getInitialWindowPerspectiveId() {
-               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);
-       }
-
-}
diff --git a/eclipse/plugins/org.argeo.slc.client.rcp/src/main/java/org/argeo/slc/client/rcp/ApplicationWorkbenchWindowAdvisor.java b/eclipse/plugins/org.argeo.slc.client.rcp/src/main/java/org/argeo/slc/client/rcp/ApplicationWorkbenchWindowAdvisor.java
deleted file mode 100644 (file)
index 8022f40..0000000
+++ /dev/null
@@ -1,124 +0,0 @@
-package org.argeo.slc.client.rcp;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.swt.widgets.Menu;
-import org.eclipse.swt.widgets.MenuItem;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Tray;
-import org.eclipse.swt.widgets.TrayItem;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.application.ActionBarAdvisor;
-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;
-
-       public ApplicationWorkbenchWindowAdvisor(
-                       IWorkbenchWindowConfigurer configurer) {
-               super(configurer);
-       }
-
-       public ActionBarAdvisor createActionBarAdvisor(
-                       IActionBarConfigurer configurer) {
-               return new ApplicationActionBarAdvisor(configurer);
-       }
-
-       public void preWindowOpen() {
-               IWorkbenchWindowConfigurer configurer = getWindowConfigurer();
-
-               configurer.getWorkbenchConfigurer().restoreState();
-               // set default window size
-               configurer.setInitialSize(new Point(1200, 900));
-               configurer.setShowCoolBar(false);
-               configurer.setShowStatusLine(true);
-               configurer.setShowPerspectiveBar(true);
-
-       }
-
-       public void postWindowOpen() {
-               initTray();
-       }
-
-       @Override
-       public boolean preWindowShellClose() {
-               // hide but do not dispose if tray is supported
-               if (trayItem != null) {
-                       getWindowConfigurer().getWindow().getShell().setVisible(false);
-                       return false;
-               } else
-                       return true;
-       }
-
-       /** Init tray support */
-       protected void initTray() {
-               IWorkbenchWindow window = getWindowConfigurer().getWindow();
-               final Tray tray = window.getShell().getDisplay().getSystemTray();
-               trayItem = new TrayItem(tray, SWT.NONE);
-               if (trayItem == null)
-                       return;
-
-               // image
-               Image trayImage = ClientRcpPlugin.getDefault().getImageRegistry()
-                               .get("argeoTrayIcon");
-               trayItem.setImage(trayImage);
-               trayItem.setToolTipText("Argeo SLC");
-
-               // add pop-menu
-               // TODO: contribute more commands
-               trayItem.addListener(SWT.MenuDetect, new Listener() {
-                       public void handleEvent(Event event) {
-                               IWorkbenchWindow window = getWindowConfigurer().getWindow();
-                               Menu menu = new Menu(window.getShell(), SWT.POP_UP);
-                               MenuItem exit = new MenuItem(menu, SWT.NONE);
-                               exit.setText("Exit");
-                               exit.addListener(SWT.Selection, new Listener() {
-                                       public void handleEvent(Event event) {
-                                               getWindowConfigurer().getWorkbenchConfigurer()
-                                                               .getWorkbench().close();
-                                       }
-                               });
-                               menu.setVisible(true);
-                       }
-               });
-
-               // add behavior when clicked upon
-               trayItem.addListener(SWT.Selection, new Listener() {
-                       public void handleEvent(Event event) {
-                               Shell shell = getWindowConfigurer().getWindow().getShell();
-                               if (shell.isVisible()) {
-                                       if (shell.getMinimized())
-                                               shell.setMinimized(false);
-                                       else {
-                                               shell.setVisible(false);
-                                               shell.setMinimized(true);
-                                       }
-                               } else {
-                                       shell.setVisible(true);
-                                       shell.setActive();
-                                       shell.setFocus();
-                                       shell.setMinimized(false);
-                               }
-                       }
-               });
-       }
-
-       @Override
-       public void dispose() {
-               if (trayItem != null)
-                       trayItem.dispose();
-       }
-
-}
diff --git a/eclipse/plugins/org.argeo.slc.client.rcp/src/main/java/org/argeo/slc/client/rcp/SlcClientRcpApplication.java b/eclipse/plugins/org.argeo.slc.client.rcp/src/main/java/org/argeo/slc/client/rcp/SlcClientRcpApplication.java
deleted file mode 100644 (file)
index 1919c48..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-package org.argeo.slc.client.rcp;
-
-import org.eclipse.equinox.app.IApplication;
-import org.eclipse.equinox.app.IApplicationContext;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.PlatformUI;
-
-/**
- * This class controls all aspects of the application's execution
- */
-public class SlcClientRcpApplication implements IApplication {
-
-       /* (non-Javadoc)
-        * @see org.eclipse.equinox.app.IApplication#start(org.eclipse.equinox.app.IApplicationContext)
-        */
-       public Object start(IApplicationContext context) {
-               Display display = PlatformUI.createDisplay();
-               try {
-                       int returnCode = PlatformUI.createAndRunWorkbench(display, new ApplicationWorkbenchAdvisor());
-                       if (returnCode == PlatformUI.RETURN_RESTART) {
-                               return IApplication.EXIT_RESTART;
-                       }
-                       return IApplication.EXIT_OK;
-               } finally {
-                       display.dispose();
-               }
-       }
-
-       /* (non-Javadoc)
-        * @see org.eclipse.equinox.app.IApplication#stop()
-        */
-       public void stop() {
-               final IWorkbench workbench = PlatformUI.getWorkbench();
-               if (workbench == null)
-                       return;
-               final Display display = workbench.getDisplay();
-               display.syncExec(new Runnable() {
-                       public void run() {
-                               if (!display.isDisposed())
-                                       workbench.close();
-                       }
-               });
-       }
-}
diff --git a/eclipse/plugins/org.argeo.slc.client.rcp/src/main/java/org/argeo/slc/client/rcp/SlcSecureClientApplication.java b/eclipse/plugins/org.argeo.slc.client.rcp/src/main/java/org/argeo/slc/client/rcp/SlcSecureClientApplication.java
new file mode 100644 (file)
index 0000000..fb17117
--- /dev/null
@@ -0,0 +1,16 @@
+package org.argeo.slc.client.rcp;
+
+import org.argeo.security.ui.application.SecureRcp;
+import org.eclipse.ui.application.WorkbenchAdvisor;
+
+/**
+ * This class controls all aspects of the application's execution
+ */
+public class SlcSecureClientApplication extends SecureRcp {
+
+       @Override
+       protected WorkbenchAdvisor createWorkbenchAdvisor() {
+               return new SlcSecureWorkbenchAdvisor();
+       }
+
+}
diff --git a/eclipse/plugins/org.argeo.slc.client.rcp/src/main/java/org/argeo/slc/client/rcp/SlcSecureWorkbenchAdvisor.java b/eclipse/plugins/org.argeo.slc.client.rcp/src/main/java/org/argeo/slc/client/rcp/SlcSecureWorkbenchAdvisor.java
new file mode 100644 (file)
index 0000000..7b685e9
--- /dev/null
@@ -0,0 +1,42 @@
+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 SlcSecureWorkbenchAdvisor extends WorkbenchAdvisor {
+
+       // private static final String PERSPECTIVE_ID =
+       // "org.argeo.slc.client.ui.perspectives.slcExecution";
+       static final String DEFAULT_PERSPECTIVE_ID = "org.argeo.security.ui.securityPerspective"; //$NON-NLS-1$
+
+       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 SlcSecureWorkbenchWindowAdvisor(configurer);
+       }
+
+       public String getInitialWindowPerspectiveId() {
+               // return PERSPECTIVE_ID;
+               return initialPerspective;
+       }
+
+       @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);
+       }
+}
diff --git a/eclipse/plugins/org.argeo.slc.client.rcp/src/main/java/org/argeo/slc/client/rcp/SlcSecureWorkbenchWindowAdvisor.java b/eclipse/plugins/org.argeo.slc.client.rcp/src/main/java/org/argeo/slc/client/rcp/SlcSecureWorkbenchWindowAdvisor.java
new file mode 100644 (file)
index 0000000..5436a49
--- /dev/null
@@ -0,0 +1,113 @@
+package org.argeo.slc.client.rcp;
+
+import org.argeo.security.ui.application.SecureWorkbenchWindowAdvisor;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Listener;
+import org.eclipse.swt.widgets.Menu;
+import org.eclipse.swt.widgets.MenuItem;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Tray;
+import org.eclipse.swt.widgets.TrayItem;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.application.ActionBarAdvisor;
+import org.eclipse.ui.application.IActionBarConfigurer;
+import org.eclipse.ui.application.IWorkbenchWindowConfigurer;
+
+/**
+ * Set here initial default size of the UI
+ * 
+ * @author bsinou
+ * 
+ */
+public class SlcSecureWorkbenchWindowAdvisor extends
+               SecureWorkbenchWindowAdvisor {
+
+       private TrayItem trayItem;
+
+       public SlcSecureWorkbenchWindowAdvisor(IWorkbenchWindowConfigurer configurer) {
+               super(configurer);
+       }
+
+//     public ActionBarAdvisor createActionBarAdvisor(
+//                     IActionBarConfigurer configurer) {
+//             return new ApplicationActionBarAdvisor(configurer);
+//     }
+
+
+       public void postWindowOpen() {
+               initTray();
+       }
+
+       @Override
+       public boolean preWindowShellClose() {
+               // hide but do not dispose if tray is supported
+               if (trayItem != null) {
+                       getWindowConfigurer().getWindow().getShell().setVisible(false);
+                       return false;
+               } else
+                       return true;
+       }
+
+       /** Init tray support */
+       protected void initTray() {
+               IWorkbenchWindow window = getWindowConfigurer().getWindow();
+               final Tray tray = window.getShell().getDisplay().getSystemTray();
+               trayItem = new TrayItem(tray, SWT.NONE);
+               if (trayItem == null)
+                       return;
+
+               // image
+               Image trayImage = ClientRcpPlugin.getDefault().getImageRegistry()
+                               .get("argeoTrayIcon");
+               trayItem.setImage(trayImage);
+               trayItem.setToolTipText("Argeo SLC");
+
+               // add pop-menu
+               // TODO: contribute more commands
+               trayItem.addListener(SWT.MenuDetect, new Listener() {
+                       public void handleEvent(Event event) {
+                               IWorkbenchWindow window = getWindowConfigurer().getWindow();
+                               Menu menu = new Menu(window.getShell(), SWT.POP_UP);
+                               MenuItem exit = new MenuItem(menu, SWT.NONE);
+                               exit.setText("Exit");
+                               exit.addListener(SWT.Selection, new Listener() {
+                                       public void handleEvent(Event event) {
+                                               getWindowConfigurer().getWorkbenchConfigurer()
+                                                               .getWorkbench().close();
+                                       }
+                               });
+                               menu.setVisible(true);
+                       }
+               });
+
+               // add behavior when clicked upon
+               trayItem.addListener(SWT.Selection, new Listener() {
+                       public void handleEvent(Event event) {
+                               Shell shell = getWindowConfigurer().getWindow().getShell();
+                               if (shell.isVisible()) {
+                                       if (shell.getMinimized())
+                                               shell.setMinimized(false);
+                                       else {
+                                               shell.setVisible(false);
+                                               shell.setMinimized(true);
+                                       }
+                               } else {
+                                       shell.setVisible(true);
+                                       shell.setActive();
+                                       shell.setFocus();
+                                       shell.setMinimized(false);
+                               }
+                       }
+               });
+       }
+
+       @Override
+       public void dispose() {
+               if (trayItem != null)
+                       trayItem.dispose();
+       }
+
+}
index 6446df35cf30fe27572da4c7c14df3b08dfb1c27..03ef4fc25743f7b3b326e18a1216336fe3148633 100644 (file)
@@ -130,8 +130,6 @@ public class ProcessParametersEditingSupport extends EditingSupport {
                } else if (own.obj instanceof RefValue) {
                        RefValue rv = (RefValue) own.obj;
                        List<String> values = comboBoxes.get(own.name);
-                       log.debug("Get Value : " + rv.getRef() + " & index : "
-                                       + values.indexOf(rv.getRef()));
                        return values.indexOf(rv.getRef());
                } else
                        return "unsupported param type";
index ee78b30aa50f3bad96cd7854946ca76319b52b6d..96eca15d32f7a63d68b9f479435e01866c1258e7 100644 (file)
@@ -80,14 +80,9 @@ public class ExecutionModulesView extends ViewPart {
                        if (obj instanceof ExecutionModulesContentProvider.ExecutionModuleNode) {
                                ExecutionModuleDescriptor emd = ((ExecutionModulesContentProvider.ExecutionModuleNode) obj)
                                                .getDescriptor();
-                               System.out
-                                               .println("obj instanceof ExecutionModulesContentProvider.ExecutionModuleNode");
-                               log.debug("obj instanceof ExecutionModulesContentProvider.ExecutionModuleNode");
                                if (emd.getLabel() != null) {
-                                       log.debug("and label is : " + emd.getLabel());
                                        return emd.getLabel();
                                } else {
-                                       log.debug("label is null and text is : " + getText(emd));
                                        return getText(emd);
                                }
                        } else