Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareAction.java')
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareAction.java32
1 files changed, 32 insertions, 0 deletions
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareAction.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareAction.java
new file mode 100644
index 000000000..4193d9a80
--- /dev/null
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareAction.java
@@ -0,0 +1,32 @@
+/*
+ * Licensed Materials - Property of IBM,
+ * WebSphere Studio Workbench
+ * (c) Copyright IBM Corp 2000, 2001
+ */
+package org.eclipse.compare.internal;
+
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.viewers.ISelection;
+
+import org.eclipse.ui.IActionDelegate;
+import org.eclipse.compare.CompareConfiguration;
+import org.eclipse.compare.CompareUI;
+
+
+public class CompareAction implements IActionDelegate {
+
+ private ISelection fSelection;
+
+ public void run(IAction action) {
+ CompareUI.openCompareEditor(new ResourceCompareInput(new CompareConfiguration(), fSelection));
+ }
+
+ public void selectionChanged(IAction a, ISelection s) {
+ fSelection= s;
+ // the following check is disabled because it results in a confusing UI:
+ // action might be enabled if plugin is not loaded but
+ // it gets disabled after plugin has been loaded...
+ //Object[] selection= StructuredSelection.toArray(s);
+ //((Action)a).setEnabled(selection.length == 2);
+ }
+}

Back to the top