Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/actions/ExportDataSetHandler.java')
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/actions/ExportDataSetHandler.java12
1 files changed, 4 insertions, 8 deletions
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/actions/ExportDataSetHandler.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/actions/ExportDataSetHandler.java
index 2e1e2fbf60..f42953ee4b 100644
--- a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/actions/ExportDataSetHandler.java
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/actions/ExportDataSetHandler.java
@@ -18,6 +18,7 @@ import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.FileDialog;
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.handlers.HandlerUtil;
/**
* This <code>Action</code> exports all data in the currently-active {@link GraphSelectorEditor}
@@ -26,14 +27,14 @@ import org.eclipse.ui.PlatformUI;
*/
public class ExportDataSetHandler extends AbstractHandler {
- private GraphSelectorEditor getActiveGraphEditor() {
- IEditorPart editor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
+ private GraphSelectorEditor getActiveGraphEditor(ExecutionEvent event) {
+ IEditorPart editor = HandlerUtil.getActiveEditor(event);
return editor instanceof GraphSelectorEditor ? (GraphSelectorEditor) editor : null;
}
@Override
public Object execute(ExecutionEvent event) {
- GraphSelectorEditor editor = getActiveGraphEditor();
+ GraphSelectorEditor editor = getActiveGraphEditor(event);
if (editor == null) {
return null;
}
@@ -49,9 +50,4 @@ public class ExportDataSetHandler extends AbstractHandler {
return null;
}
- @Override
- public boolean isEnabled() {
- return getActiveGraphEditor() != null;
- }
-
}

Back to the top