Remove UI dependencies in tmf.core.
[deliverable/tracecompass.git] / org.eclipse.linuxtools.tmf.ui / src / org / eclipse / linuxtools / internal / tmf / ui / Activator.java
index 61ac6df2b39b56501ce486010aa3b23a65e70625..6b290faff69fa4c88235b9ec3754058cdaf4856e 100644 (file)
@@ -7,17 +7,20 @@
  * http://www.eclipse.org/legal/epl-v10.html
  *
  * Contributors:
- *   Francois Chouinard - Initial API and implementation
+ *     Francois Chouinard - Initial API and implementation
  *******************************************************************************/
 
 package org.eclipse.linuxtools.internal.tmf.ui;
 
 import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Platform;
 import org.eclipse.core.runtime.Status;
 import org.eclipse.jface.resource.ImageDescriptor;
 import org.eclipse.jface.resource.ImageRegistry;
+import org.eclipse.linuxtools.tmf.core.event.ITmfEvent;
 import org.eclipse.linuxtools.tmf.ui.project.model.TmfTraceElement;
 import org.eclipse.linuxtools.tmf.ui.properties.TmfTimePreferences;
+import org.eclipse.linuxtools.tmf.ui.viewers.events.TmfEventAdapterFactory;
 import org.eclipse.swt.graphics.Image;
 import org.eclipse.ui.plugin.AbstractUIPlugin;
 import org.osgi.framework.BundleContext;
@@ -41,6 +44,8 @@ public class Activator extends AbstractUIPlugin {
      */
     private static Activator plugin;
 
+    private TmfEventAdapterFactory fTmfEventAdapterFactory;
+
     // ------------------------------------------------------------------------
     // Constructors
     // ------------------------------------------------------------------------
@@ -75,12 +80,17 @@ public class Activator extends AbstractUIPlugin {
         TmfUiTracer.init();
         TmfTraceElement.init();
         TmfTimePreferences.init();
+
+        fTmfEventAdapterFactory = new TmfEventAdapterFactory();
+        Platform.getAdapterManager().registerAdapters(fTmfEventAdapterFactory, ITmfEvent.class);
     }
 
     @Override
     public void stop(BundleContext context) throws Exception {
         TmfUiTracer.stop();
         plugin = null;
+
+        Platform.getAdapterManager().unregisterAdapters(fTmfEventAdapterFactory);
         super.stop(context);
     }
 
@@ -137,6 +147,7 @@ public class Activator extends AbstractUIPlugin {
         reg.put(ITmfImageConstants.IMG_UI_SEQ_DIAGRAM_OBJ, getImageFromPath(ITmfImageConstants.IMG_UI_SEQ_DIAGRAM_OBJ));
         reg.put(ITmfImageConstants.IMG_UI_ARROW_COLLAPSE_OBJ, getImageFromPath(ITmfImageConstants.IMG_UI_ARROW_COLLAPSE_OBJ));
         reg.put(ITmfImageConstants.IMG_UI_ARROW_UP_OBJ, getImageFromPath(ITmfImageConstants.IMG_UI_ARROW_UP_OBJ));
+        reg.put(ITmfImageConstants.IMG_UI_CONFLICT, getImageFromPath(ITmfImageConstants.IMG_UI_CONFLICT));
     }
 
     /**
This page took 0.024893 seconds and 5 git commands to generate.