Rationalize the TMF commands
[deliverable/tracecompass.git] / org.eclipse.linuxtools.tmf.ui / src / org / eclipse / linuxtools / internal / tmf / ui / project / handlers / OpenAction.java
index 507923f7dabf181ffbe944981cf310b271803dcf..883c827a9c1229628168a5680ba19e862f45c8de 100644 (file)
@@ -27,10 +27,15 @@ import org.eclipse.linuxtools.tmf.ui.project.model.TmfTraceElement;
 import org.eclipse.ui.IWorkbenchPage;
 import org.eclipse.ui.handlers.IHandlerService;
 
+/**
+ * <b><u>OpenAction</u></b>
+ * <p>
+ * Implement me. Please.
+ * <p>
+ */
 public class OpenAction extends Action {
 
-    private static final String OPEN_TRACE_COMMAND_ID = "org.eclipse.linuxtools.tmf.ui.command.project.trace.open"; //$NON-NLS-1$
-    private static final String OPEN_EXPERIMENT_COMMAND_ID = "org.eclipse.linuxtools.tmf.ui.command.project.experiment.open"; //$NON-NLS-1$
+    private static final String OPEN_COMMAND_ID = "org.eclipse.ui.navigate.openResource"; //$NON-NLS-1$
 
     private final IWorkbenchPage page;
     private final ISelectionProvider selectionProvider;
@@ -74,10 +79,8 @@ public class OpenAction extends Action {
     public void run() {
         try {
             IHandlerService handlerService = (IHandlerService) page.getActivePart().getSite().getService(IHandlerService.class);
-            if (element instanceof TmfTraceElement) {
-                handlerService.executeCommand(OPEN_TRACE_COMMAND_ID, null);
-            } else if (element instanceof TmfExperimentElement) {
-                handlerService.executeCommand(OPEN_EXPERIMENT_COMMAND_ID, null);
+            if (element instanceof TmfTraceElement || element instanceof TmfExperimentElement) {
+                handlerService.executeCommand(OPEN_COMMAND_ID, null);
             }
         } catch (ExecutionException e) {
             Activator.getDefault().logError("Error opening resource " + element.getName(), e); //$NON-NLS-1$
This page took 0.024297 seconds and 5 git commands to generate.