]> git.argeo.org Git - lgpl/argeo-commons.git/blobdiff - org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/WorkbenchUiPlugin.java
Clean internal package structure
[lgpl/argeo-commons.git] / org.argeo.eclipse.ui.workbench / src / org / argeo / eclipse / ui / workbench / WorkbenchUiPlugin.java
index 4898e80d73f6a9df2d1c44f0e5062a7cce4db1d0..6fd8e5d3b995488294c00d4e84f8349c1197bf7d 100644 (file)
@@ -45,43 +45,21 @@ public class WorkbenchUiPlugin extends AbstractUIPlugin implements ILogListener
        public WorkbenchUiPlugin() {
        }
 
-       /*
-        * (non-Javadoc)
-        * 
-        * @see
-        * org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext
-        * )
-        */
        public void start(BundleContext context) throws Exception {
                super.start(context);
-               // weirdly, the start method is called twice...
-               // TODO check if it is still the case.
-               if (plugin == null) {
-                       plugin = this;
-                       messages = ResourceBundle.getBundle(ID + ".messages");
-                       Platform.addLogListener(this);
-                       log.debug("Eclipse logging now directed to standard logging");
-               } else
-                       log.warn("Trying to start an already started plugin.");
+               plugin = this;
+               messages = ResourceBundle.getBundle(ID + ".messages");
+               Platform.addLogListener(this);
+               if (log.isTraceEnabled())
+                       log.trace("Eclipse logging now directed to standard logging");
        }
 
-       /*
-        * (non-Javadoc)
-        * 
-        * @see
-        * org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext
-        * )
-        */
        public void stop(BundleContext context) throws Exception {
                try {
-                       // weirdly, the stop method is called twice...
-                       // TODO check if it is still the case.
-                       if (plugin != null) {
-                               Platform.removeLogListener(this);
-                               log.debug("Eclipse logging not directed anymore to standard logging");
-                               plugin = null;
-                       } else
-                               log.warn("Trying to stop an already stopped plugin.");
+                       Platform.removeLogListener(this);
+                       if (log.isTraceEnabled())
+                               log.trace("Eclipse logging not directed anymore to standard logging");
+                       plugin = null;
                } finally {
                        super.stop(context);
                }
@@ -134,7 +112,5 @@ public class WorkbenchUiPlugin extends AbstractUIPlugin implements ILogListener
                else if (severity == IStatus.CANCEL)
                        if (pluginLog.isDebugEnabled())
                                pluginLog.debug(status.getMessage(), status.getException());
-
        }
-
 }