]> git.argeo.org Git - gpl/argeo-slc.git/blobdiff - eclipse/plugins/org.argeo.slc.client.rcp/src/main/java/org/argeo/slc/client/rcp/SlcSecureWorkbenchWindowAdvisor.java
Update license header
[gpl/argeo-slc.git] / eclipse / plugins / org.argeo.slc.client.rcp / src / main / java / org / argeo / slc / client / rcp / SlcSecureWorkbenchWindowAdvisor.java
index d83f8c9ead86249317491d21dfc828a24b040f09..8f3913f88943b880e3c6011d7e9052c693a904df 100644 (file)
@@ -19,6 +19,7 @@ import org.eclipse.ui.part.EditorInputTransfer;
 /** Set here initial default size of the UI */
 public class SlcSecureWorkbenchWindowAdvisor extends
                SecureWorkbenchWindowAdvisor {
+       public final static String IN_TRAY_PROPERTY = "org.argeo.slc.ui.inTray";
 
        private TrayItem trayItem;
 
@@ -28,7 +29,10 @@ public class SlcSecureWorkbenchWindowAdvisor extends
        }
 
        public void postWindowOpen() {
-               initTray();
+               String inTray = System.getProperty(IN_TRAY_PROPERTY);
+               if (inTray != null && inTray.equals("true")) {
+                       initTray();
+               }
        }
 
        @Override
@@ -76,7 +80,8 @@ public class SlcSecureWorkbenchWindowAdvisor extends
        /** Init tray support */
        protected void initTray() {
                IWorkbenchWindow window = getWindowConfigurer().getWindow();
-               final Tray tray = window.getShell().getDisplay().getSystemTray();
+               Shell shell = window.getShell();
+               final Tray tray = shell.getDisplay().getSystemTray();
                trayItem = new TrayItem(tray, SWT.NONE);
                if (trayItem == null)
                        return;
@@ -124,6 +129,9 @@ public class SlcSecureWorkbenchWindowAdvisor extends
                                }
                        }
                });
+
+               // start hidden
+               // shell.setVisible(false);
        }
 
        @Override