Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorddunne2010-09-24 21:04:44 +0000
committerRyan D. Brooks2010-09-24 21:04:44 +0000
commite899d798bb8099aa0c9911a03db5a58e235496f0 (patch)
treee249b0bc8ef0c07cdd6c6eaf16f73b8c5e2b0fae /plugins/org.eclipse.osee.ote.ui.markers
parentf7668b3e4e34dfe032ee7b68b77d08061f6e155b (diff)
downloadorg.eclipse.osee-e899d798bb8099aa0c9911a03db5a58e235496f0.tar.gz
org.eclipse.osee-e899d798bb8099aa0c9911a03db5a58e235496f0.tar.xz
org.eclipse.osee-e899d798bb8099aa0c9911a03db5a58e235496f0.zip
refactor: Cleanup activators and unnecessary usage of OseeUiActivator
Diffstat (limited to 'plugins/org.eclipse.osee.ote.ui.markers')
-rw-r--r--plugins/org.eclipse.osee.ote.ui.markers/src/org/eclipse/osee/ote/ui/markers/MarkerPlugin.java39
-rw-r--r--plugins/org.eclipse.osee.ote.ui.markers/src/org/eclipse/osee/ote/ui/markers/ProcessOutfileSax.java6
2 files changed, 10 insertions, 35 deletions
diff --git a/plugins/org.eclipse.osee.ote.ui.markers/src/org/eclipse/osee/ote/ui/markers/MarkerPlugin.java b/plugins/org.eclipse.osee.ote.ui.markers/src/org/eclipse/osee/ote/ui/markers/MarkerPlugin.java
index ac79fa1c340..ae181200f81 100644
--- a/plugins/org.eclipse.osee.ote.ui.markers/src/org/eclipse/osee/ote/ui/markers/MarkerPlugin.java
+++ b/plugins/org.eclipse.osee.ote.ui.markers/src/org/eclipse/osee/ote/ui/markers/MarkerPlugin.java
@@ -23,31 +23,19 @@ import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.osee.framework.logging.OseeLog;
import org.eclipse.osee.framework.plugin.core.util.Jobs;
-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 MarkerPlugin extends OseeUiActivator {
+public class MarkerPlugin implements BundleActivator {
- private FileWatchList filesToWatch;
- // The plug-in ID
+ private static FileWatchList filesToWatch;
public static final String PLUGIN_ID = "org.eclipse.osee.ote.ui.markers";
- // The shared instance
- private static MarkerPlugin plugin;
-
- /**
- * The constructor
- */
- public MarkerPlugin() {
- }
-
@Override
public void start(BundleContext context) throws Exception {
- super.start(context);
- plugin = this;
filesToWatch = new FileWatchList();
ResourcesPlugin.getWorkspace().addResourceChangeListener(new IResourceChangeListener() {
@@ -101,26 +89,15 @@ public class MarkerPlugin extends OseeUiActivator {
@Override
public void stop(BundleContext context) throws Exception {
- plugin = null;
- super.stop(context);
- }
-
- /**
- * Returns the shared instance
- *
- * @return the shared instance
- */
- public static MarkerPlugin getDefault() {
- return plugin;
}
- public void addMarkers(IFile file) {
+ public static void addMarkers(IFile file) {
removeMarkers(file);
- Jobs.runInJob("OTE Marker Processing", new ProcessOutfileSax(this, file), MarkerPlugin.class,
- MarkerPlugin.PLUGIN_ID, false);
+ Jobs.runInJob("OTE Marker Processing", new ProcessOutfileSax(file), MarkerPlugin.class, MarkerPlugin.PLUGIN_ID,
+ false);
}
- public void removeMarkers(IFile file) {
+ public static void removeMarkers(IFile file) {
List<IMarker> markers = filesToWatch.get(file);
if (markers != null) {
for (IMarker marker : markers) {
@@ -132,7 +109,7 @@ public class MarkerPlugin extends OseeUiActivator {
}
}
- synchronized void updateMarkerInfo(IFile file, List<IMarker> markers) {
+ static synchronized void updateMarkerInfo(IFile file, List<IMarker> markers) {
List<IMarker> oldMarkers = filesToWatch.get(file);
if (oldMarkers != null) {
oldMarkers.addAll(markers);
diff --git a/plugins/org.eclipse.osee.ote.ui.markers/src/org/eclipse/osee/ote/ui/markers/ProcessOutfileSax.java b/plugins/org.eclipse.osee.ote.ui.markers/src/org/eclipse/osee/ote/ui/markers/ProcessOutfileSax.java
index 6613532a26a..d69d470945b 100644
--- a/plugins/org.eclipse.osee.ote.ui.markers/src/org/eclipse/osee/ote/ui/markers/ProcessOutfileSax.java
+++ b/plugins/org.eclipse.osee.ote.ui.markers/src/org/eclipse/osee/ote/ui/markers/ProcessOutfileSax.java
@@ -40,7 +40,6 @@ import org.xml.sax.helpers.XMLReaderFactory;
public class ProcessOutfileSax implements IExceptionableRunnable {
private final IFile file;
- private final MarkerPlugin plugin;
private static final int _1_MB = 1048576;
private static final int _20_MB = _1_MB * 20;
@@ -50,9 +49,8 @@ public class ProcessOutfileSax implements IExceptionableRunnable {
private CheckPointData currentCheckPoint = null;
protected StackTraceCollection currentStackTrace;
- public ProcessOutfileSax(MarkerPlugin plugin, IFile file) {
+ public ProcessOutfileSax(IFile file) {
this.file = file;
- this.plugin = plugin;
}
@Override
@@ -75,7 +73,7 @@ public class ProcessOutfileSax implements IExceptionableRunnable {
parseContents(contents);
OteMarkerHelper helper = new OteMarkerHelper(this.testPointDatas);
- plugin.updateMarkerInfo(file, helper.getMarkers());
+ MarkerPlugin.updateMarkerInfo(file, helper.getMarkers());
return Status.OK_STATUS;
}

Back to the top