Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrbrooks2010-10-08 15:01:44 -0400
committerRyan D. Brooks2010-10-08 15:01:44 -0400
commit524c8a1dc6eb3b26a509f8c6591f26ba8dddac5b (patch)
treea842b57048a7f85c7dfb5a1bbca9a0cac1e5f518
parent9a31c0d441b383ffa3ceec14f3005c583fef2168 (diff)
downloadorg.eclipse.osee-524c8a1dc6eb3b26a509f8c6591f26ba8dddac5b.tar.gz
org.eclipse.osee-524c8a1dc6eb3b26a509f8c6591f26ba8dddac5b.tar.xz
org.eclipse.osee-524c8a1dc6eb3b26a509f8c6591f26ba8dddac5b.zip
refactor: Remove unnecessary dependencies on OseeUiActivator
-rw-r--r--plugins/org.eclipse.osee.ats.config.demo/src/org/eclipse/osee/ats/config/demo/internal/OseeAtsConfigDemoActivator.java7
-rw-r--r--plugins/org.eclipse.osee.framework.ui.plugin/src/org/eclipse/osee/framework/ui/plugin/OseeUiActivator.java17
-rw-r--r--plugins/org.eclipse.osee.framework.ui.plugin/src/org/eclipse/osee/framework/ui/plugin/internal/OseePluginUiActivator.java51
-rw-r--r--plugins/org.eclipse.osee.framework.ui.service.control/src/org/eclipse/osee/framework/ui/service/control/ControlPlugin.java17
-rw-r--r--plugins/org.eclipse.osee.ote.define/src/org/eclipse/osee/ote/define/OteDefinePlugin.java14
-rw-r--r--plugins/org.eclipse.osee.ote.ui.host.cmd/src/org/eclipse/osee/ote/ui/host/cmd/UiPlugin.java20
-rw-r--r--plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/watch/WatchView.java4
-rw-r--r--plugins/org.eclipse.osee.ote.ui/src/org/eclipse/osee/ote/ui/RemoteConsoleLauncher.java7
-rw-r--r--plugins/org.eclipse.osee.ote.ui/src/org/eclipse/osee/ote/ui/internal/TestCoreGuiPlugin.java108
9 files changed, 82 insertions, 163 deletions
diff --git a/plugins/org.eclipse.osee.ats.config.demo/src/org/eclipse/osee/ats/config/demo/internal/OseeAtsConfigDemoActivator.java b/plugins/org.eclipse.osee.ats.config.demo/src/org/eclipse/osee/ats/config/demo/internal/OseeAtsConfigDemoActivator.java
index 46ee812c3e..3e15c7bb21 100644
--- a/plugins/org.eclipse.osee.ats.config.demo/src/org/eclipse/osee/ats/config/demo/internal/OseeAtsConfigDemoActivator.java
+++ b/plugins/org.eclipse.osee.ats.config.demo/src/org/eclipse/osee/ats/config/demo/internal/OseeAtsConfigDemoActivator.java
@@ -16,13 +16,9 @@ import org.eclipse.osee.framework.ui.plugin.OseeUiActivator;
* The activator class controls the plug-in life cycle
*/
public class OseeAtsConfigDemoActivator extends OseeUiActivator {
- // The shared instance.
private static OseeAtsConfigDemoActivator plugin;
public static final String PLUGIN_ID = "org.eclipse.osee.ats.config.demo";
- /**
- * The constructor.
- */
public OseeAtsConfigDemoActivator() {
super(PLUGIN_ID);
plugin = this;
@@ -31,5 +27,4 @@ public class OseeAtsConfigDemoActivator extends OseeUiActivator {
public static OseeAtsConfigDemoActivator getInstance() {
return plugin;
}
-
-}
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.framework.ui.plugin/src/org/eclipse/osee/framework/ui/plugin/OseeUiActivator.java b/plugins/org.eclipse.osee.framework.ui.plugin/src/org/eclipse/osee/framework/ui/plugin/OseeUiActivator.java
index 2ee114df30..b631b7a829 100644
--- a/plugins/org.eclipse.osee.framework.ui.plugin/src/org/eclipse/osee/framework/ui/plugin/OseeUiActivator.java
+++ b/plugins/org.eclipse.osee.framework.ui.plugin/src/org/eclipse/osee/framework/ui/plugin/OseeUiActivator.java
@@ -26,7 +26,6 @@ import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.osee.framework.jdk.core.util.Lib;
import org.eclipse.osee.framework.logging.OseeLog;
import org.eclipse.osee.framework.plugin.core.PluginUtil;
-import org.eclipse.osee.framework.ui.plugin.internal.OseePluginUiActivator;
import org.eclipse.osee.framework.ui.plugin.util.Result;
import org.eclipse.swt.program.Program;
import org.eclipse.ui.plugin.AbstractUIPlugin;
@@ -36,16 +35,9 @@ import org.osgi.framework.BundleContext;
* @author Ryan D. Brooks
*/
public abstract class OseeUiActivator extends AbstractUIPlugin {
- private OseeUiActivator parentPlugin;
private PluginUtil helper;
private final String pluginId;
- @Deprecated
- protected OseeUiActivator() {
- super();
- this.pluginId = "org.eclipse.osee.framework.ui.plugin";
- }
-
protected OseeUiActivator(String pluginId) {
super();
this.pluginId = pluginId;
@@ -82,15 +74,6 @@ public abstract class OseeUiActivator extends AbstractUIPlugin {
@Override
public void start(BundleContext context) throws Exception {
super.start(context);
-
- parentPlugin = OseePluginUiActivator.getInstance();
- /*
- * parentPlugin will be the CorePlugin except in the case of CorePlugin itself when parentPlugin will be null
- */
- if (parentPlugin == this) {
- parentPlugin = null;
- }
-
helper = new PluginUtil(pluginId);
}
diff --git a/plugins/org.eclipse.osee.framework.ui.plugin/src/org/eclipse/osee/framework/ui/plugin/internal/OseePluginUiActivator.java b/plugins/org.eclipse.osee.framework.ui.plugin/src/org/eclipse/osee/framework/ui/plugin/internal/OseePluginUiActivator.java
index d17d4f93a1..1aa9453b30 100644
--- a/plugins/org.eclipse.osee.framework.ui.plugin/src/org/eclipse/osee/framework/ui/plugin/internal/OseePluginUiActivator.java
+++ b/plugins/org.eclipse.osee.framework.ui.plugin/src/org/eclipse/osee/framework/ui/plugin/internal/OseePluginUiActivator.java
@@ -13,74 +13,29 @@ package org.eclipse.osee.framework.ui.plugin.internal;
import org.eclipse.osee.framework.core.exception.OseeCoreException;
import org.eclipse.osee.framework.core.exception.OseeExceptions;
import org.eclipse.osee.framework.plugin.core.IActionReportingService;
-import org.eclipse.osee.framework.ui.plugin.OseeUiActivator;
+import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
import org.osgi.util.tracker.ServiceTracker;
/**
* a The activator class controls the plug-in life cycle
*/
-public class OseePluginUiActivator extends OseeUiActivator {
+public class OseePluginUiActivator implements BundleActivator {
public static final String PLUGIN_ID = "org.eclipse.osee.framework.ui.plugin";
private static OseePluginUiActivator plugin;
private ServiceTracker tracker;
- public OseePluginUiActivator() {
- super(PLUGIN_ID);
- plugin = this;
- }
-
@Override
public void start(BundleContext context) throws Exception {
- super.start(context);
-
tracker = new ServiceTracker(context, IActionReportingService.class.getName(), null);
tracker.open();
-
- // TODO: This isn't needed anymore
- // if (PlatformUI.isWorkbenchRunning()) {
- // IWorkbench workbench = PlatformUI.getWorkbench();
- // workbench.addWorkbenchListener(new IWorkbenchListener() {
- //
- // @Override
- // public void postShutdown(IWorkbench workbench) {
- // }
- //
- // @Override
- // public boolean preShutdown(IWorkbench workbench, boolean forced) {
- // try {
- // if (Lib.isWindows()) {
- // String clearCache = OseeInfo.getValue("clear_cache");
- // if (Boolean.parseBoolean(clearCache)) {
- // Location location = Platform.getInstallLocation();
- // URL url = FileLocator.toFileURL(location.getURL());
- // File file = new File(url.getFile());
- // File cache =
- // new File(new File(new File(file, "p2"), "org.eclipse.equinox.p2.metadata.repository"),
- // "cache");
- // File[] files = cache.listFiles();
- // for (File toDelete : files) {
- // toDelete.delete();
- // }
- //
- // Lib.deleteContents(new File(new File(file, "configuration"), "org.eclipse.osgi"));
- // }
- // }
- // } catch (Throwable th) {
- //
- // }
- // return true;
- // }
- //
- // });
- // }
+ plugin = this;
}
@Override
public void stop(BundleContext context) throws Exception {
- super.stop(context);
if (tracker != null) {
tracker.close();
}
diff --git a/plugins/org.eclipse.osee.framework.ui.service.control/src/org/eclipse/osee/framework/ui/service/control/ControlPlugin.java b/plugins/org.eclipse.osee.framework.ui.service.control/src/org/eclipse/osee/framework/ui/service/control/ControlPlugin.java
index 5f1565d475..ab9a5e022d 100644
--- a/plugins/org.eclipse.osee.framework.ui.service.control/src/org/eclipse/osee/framework/ui/service/control/ControlPlugin.java
+++ b/plugins/org.eclipse.osee.framework.ui.service.control/src/org/eclipse/osee/framework/ui/service/control/ControlPlugin.java
@@ -11,7 +11,7 @@
package org.eclipse.osee.framework.ui.service.control;
import org.eclipse.osee.framework.plugin.core.IWorkbenchUserService;
-import org.eclipse.osee.framework.ui.plugin.OseeUiActivator;
+import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
import org.osgi.util.tracker.ServiceTracker;
@@ -20,22 +20,16 @@ import org.osgi.util.tracker.ServiceTracker;
*
* @author Roberto E. Escobar
*/
-public class ControlPlugin extends OseeUiActivator {
-
+public class ControlPlugin implements BundleActivator {
public static final String PLUGIN_ID = "org.eclipse.osee.framework.ui.service.control";
- private static ControlPlugin pluginInstance; // The shared instance.
+ private static ControlPlugin pluginInstance;
private ServiceTracker tracker;
- public ControlPlugin() {
- super(PLUGIN_ID);
- pluginInstance = this;
- }
-
@Override
public void start(BundleContext context) throws Exception {
- super.start(context);
tracker = new ServiceTracker(context, IWorkbenchUserService.class.getName(), null);
tracker.open();
+ pluginInstance = this;
}
@Override
@@ -43,7 +37,6 @@ public class ControlPlugin extends OseeUiActivator {
if (tracker != null) {
tracker.close();
}
- super.stop(context);
}
/**
@@ -56,4 +49,4 @@ public class ControlPlugin extends OseeUiActivator {
public IWorkbenchUserService getDirectoryService() {
return (IWorkbenchUserService) tracker.getService();
}
-}
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.ote.define/src/org/eclipse/osee/ote/define/OteDefinePlugin.java b/plugins/org.eclipse.osee.ote.define/src/org/eclipse/osee/ote/define/OteDefinePlugin.java
index d4d0ba1ace..f95a947093 100644
--- a/plugins/org.eclipse.osee.ote.define/src/org/eclipse/osee/ote/define/OteDefinePlugin.java
+++ b/plugins/org.eclipse.osee.ote.define/src/org/eclipse/osee/ote/define/OteDefinePlugin.java
@@ -10,16 +10,20 @@
*******************************************************************************/
package org.eclipse.osee.ote.define;
-import org.eclipse.osee.framework.ui.plugin.OseeUiActivator;
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
/**
* The activator class controls the plug-in life cycle
*/
-public class OteDefinePlugin extends OseeUiActivator {
+public class OteDefinePlugin implements BundleActivator {
public static final String PLUGIN_ID = "org.eclipse.osee.ote.define";
- public OteDefinePlugin() {
- super(PLUGIN_ID);
+ @Override
+ public void start(BundleContext context) throws Exception {
}
-}
+ @Override
+ public void stop(BundleContext context) throws Exception {
+ }
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.ote.ui.host.cmd/src/org/eclipse/osee/ote/ui/host/cmd/UiPlugin.java b/plugins/org.eclipse.osee.ote.ui.host.cmd/src/org/eclipse/osee/ote/ui/host/cmd/UiPlugin.java
index e68c04bc5f..0b1d4d2109 100644
--- a/plugins/org.eclipse.osee.ote.ui.host.cmd/src/org/eclipse/osee/ote/ui/host/cmd/UiPlugin.java
+++ b/plugins/org.eclipse.osee.ote.ui.host.cmd/src/org/eclipse/osee/ote/ui/host/cmd/UiPlugin.java
@@ -10,21 +10,27 @@
*******************************************************************************/
package org.eclipse.osee.ote.ui.host.cmd;
-import org.eclipse.osee.framework.ui.plugin.OseeUiActivator;
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
/**
* The main plugin class to be used in the desktop.
*/
-public class UiPlugin extends OseeUiActivator {
+public class UiPlugin implements BundleActivator {
public static final String PLUGIN_ID = "org.eclipse.osee.ote.ui.host.cmd";
private static UiPlugin plugin;
- public UiPlugin() {
- super(PLUGIN_ID);
+ public static UiPlugin getInstance() {
+ return plugin;
+ }
+
+ @Override
+ public void start(BundleContext context) {
plugin = this;
}
- public static UiPlugin getInstance() {
- return plugin;
+ @Override
+ public void stop(BundleContext context) {
+ // method overridden only to satisfy its defining interface
}
-}
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/watch/WatchView.java b/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/watch/WatchView.java
index 9625823440..f4f4b3bf44 100644
--- a/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/watch/WatchView.java
+++ b/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/watch/WatchView.java
@@ -56,7 +56,6 @@ import org.eclipse.osee.framework.plugin.core.IActionable;
import org.eclipse.osee.framework.plugin.core.util.Jobs;
import org.eclipse.osee.framework.plugin.core.util.OseeData;
import org.eclipse.osee.framework.ui.plugin.OseeUiActions;
-import org.eclipse.osee.framework.ui.plugin.OseeUiActivator;
import org.eclipse.osee.framework.ui.plugin.util.HelpUtil;
import org.eclipse.osee.framework.ui.swt.Displays;
import org.eclipse.osee.framework.ui.swt.ImageManager;
@@ -120,9 +119,6 @@ import org.osgi.framework.Bundle;
* @author Ken J. Aguilar
*/
public final class WatchView extends ViewPart implements IActionable, IMessageDictionaryListener, ITestConnectionListener, IOteMessageClientView {
-
- protected static final OseeUiActivator plugin = Activator.getDefault();
-
private MessageXViewer treeViewer;
private final ClientMessageServiceTracker msgServiceTracker;
diff --git a/plugins/org.eclipse.osee.ote.ui/src/org/eclipse/osee/ote/ui/RemoteConsoleLauncher.java b/plugins/org.eclipse.osee.ote.ui/src/org/eclipse/osee/ote/ui/RemoteConsoleLauncher.java
index 9f7a5d3868..bb69e50c2e 100644
--- a/plugins/org.eclipse.osee.ote.ui/src/org/eclipse/osee/ote/ui/RemoteConsoleLauncher.java
+++ b/plugins/org.eclipse.osee.ote.ui/src/org/eclipse/osee/ote/ui/RemoteConsoleLauncher.java
@@ -20,8 +20,9 @@ public class RemoteConsoleLauncher extends ServiceTracker {
private OteRemoteConsole remoteConsole;
private final IOteConsoleService oteConsoleService;
+
public RemoteConsoleLauncher(IOteConsoleService oteConsoleService) {
- super(TestCoreGuiPlugin.getDefault().getBundle().getBundleContext(), IOteClientService.class.getName(), null);
+ super(TestCoreGuiPlugin.getContext(), IOteClientService.class.getName(), null);
this.oteConsoleService = oteConsoleService;
}
@@ -36,8 +37,8 @@ public class RemoteConsoleLauncher extends ServiceTracker {
@Override
public void close() {
if (remoteConsole != null) {
- IOteClientService service = (IOteClientService) getService();
- service.removeConnectionListener(remoteConsole);
+ IOteClientService service = (IOteClientService) getService();
+ service.removeConnectionListener(remoteConsole);
remoteConsole.close();
}
super.close();
diff --git a/plugins/org.eclipse.osee.ote.ui/src/org/eclipse/osee/ote/ui/internal/TestCoreGuiPlugin.java b/plugins/org.eclipse.osee.ote.ui/src/org/eclipse/osee/ote/ui/internal/TestCoreGuiPlugin.java
index 9add875e30..b40bb12557 100644
--- a/plugins/org.eclipse.osee.ote.ui/src/org/eclipse/osee/ote/ui/internal/TestCoreGuiPlugin.java
+++ b/plugins/org.eclipse.osee.ote.ui/src/org/eclipse/osee/ote/ui/internal/TestCoreGuiPlugin.java
@@ -16,10 +16,10 @@ import org.eclipse.osee.framework.core.exception.OseeExceptions;
import org.eclipse.osee.framework.core.operation.AbstractOperation;
import org.eclipse.osee.framework.core.operation.Operations;
import org.eclipse.osee.framework.plugin.core.IWorkbenchUserService;
-import org.eclipse.osee.framework.ui.plugin.OseeFormActivator;
import org.eclipse.osee.framework.ui.plugin.workspace.SafeWorkspaceAccess;
import org.eclipse.osee.ote.ui.IOteConsoleService;
import org.eclipse.osee.ote.ui.RemoteConsoleLauncher;
+import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceReference;
import org.osgi.framework.ServiceRegistration;
@@ -28,80 +28,70 @@ import org.osgi.util.tracker.ServiceTracker;
/**
* The main plugin class to be used in the desktop.
*/
-public class TestCoreGuiPlugin extends OseeFormActivator {
+public class TestCoreGuiPlugin implements BundleActivator {
public static final String PLUGIN_ID = "org.eclipse.osee.ote.ui";
- private static TestCoreGuiPlugin pluginInstance;
+ private static TestCoreGuiPlugin instance;
private ServiceRegistration oteConsoleServiceRegistration;
private ServiceTracker workbenchUserServiceTracker;
private ServiceTracker workspaceStartTracker;
private OteConsoleServiceImpl oteConsoleService;
-
-
- public TestCoreGuiPlugin() {
- super(PLUGIN_ID);
- pluginInstance = this;
- }
+ private BundleContext context;
@Override
public void start(final BundleContext context) throws Exception {
- super.start(context);
-
- workspaceStartTracker =
- new ServiceTracker(context, SafeWorkspaceAccess.class.getName(), null) {
- private RemoteConsoleLauncher tracker;
-
- @Override
- public void removedService(ServiceReference reference, Object service) {
- if (oteConsoleService != null) {
- oteConsoleServiceRegistration.unregister();
- oteConsoleService.close();
- oteConsoleService = null;
- }
- if (tracker != null) {
- tracker.close();
- }
- super.removedService(reference, service);
- }
-
- @Override
- public void close() {
- if (tracker != null) {
- tracker.close();
- }
- super.close();
- }
-
+ this.context = context;
+ instance = this;
+ workspaceStartTracker = new ServiceTracker(context, SafeWorkspaceAccess.class.getName(), null) {
+ private RemoteConsoleLauncher tracker;
- @Override
- public void modifiedService(ServiceReference reference, Object service) {
- // TODO Auto-generated method stub
+ @Override
+ public void removedService(ServiceReference reference, Object service) {
+ if (oteConsoleService != null) {
+ oteConsoleServiceRegistration.unregister();
+ oteConsoleService.close();
+ oteConsoleService = null;
+ }
+ if (tracker != null) {
+ tracker.close();
+ }
+ super.removedService(reference, service);
+ }
+ @Override
+ public void close() {
+ if (tracker != null) {
+ tracker.close();
}
+ super.close();
+ }
+ @Override
+ public void modifiedService(ServiceReference reference, Object service) {
+ // TODO Auto-generated method stub
- @Override
- public Object addingService(ServiceReference reference) {
- oteConsoleService = new OteConsoleServiceImpl();
- oteConsoleServiceRegistration =
- context.registerService(IOteConsoleService.class.getName(), oteConsoleService, null);
- if (System.getProperty("NO_OTE_REMOTE_CONSOLE") == null) {
- tracker = new RemoteConsoleLauncher(oteConsoleService);
- tracker.open(true);
- }
- return super.addingService(reference);
+ }
+
+ @Override
+ public Object addingService(ServiceReference reference) {
+ oteConsoleService = new OteConsoleServiceImpl();
+ oteConsoleServiceRegistration =
+ context.registerService(IOteConsoleService.class.getName(), oteConsoleService, null);
+ if (System.getProperty("NO_OTE_REMOTE_CONSOLE") == null) {
+ tracker = new RemoteConsoleLauncher(oteConsoleService);
+ tracker.open(true);
}
- };
+ return super.addingService(reference);
+ }
+ };
workspaceStartTracker.open(true);
workbenchUserServiceTracker = new ServiceTracker(context, IWorkbenchUserService.class.getName(), null);
workbenchUserServiceTracker.open();
-
-
if (System.getProperty("NO_OTE_ARTIFACT_BULK_LOAD") == null) {
startOTEArtifactBulkLoad();
}
@@ -118,9 +108,7 @@ public class TestCoreGuiPlugin extends OseeFormActivator {
oteConsoleService = null;
}
workspaceStartTracker.close();
- pluginInstance = null;
-
- super.stop(context);
+ instance = null;
}
private void startOTEArtifactBulkLoad() {
@@ -146,16 +134,14 @@ public class TestCoreGuiPlugin extends OseeFormActivator {
}
public static TestCoreGuiPlugin getDefault() {
- return pluginInstance;
- }
-
- @Override
- protected String getPluginName() {
- return PLUGIN_ID;
+ return instance;
}
public IOteConsoleService getOteConsoleService() {
return oteConsoleService;
}
+ public static BundleContext getContext() {
+ return instance.context;
+ }
} \ No newline at end of file

Back to the top