Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndre Weinand2002-01-29 10:38:55 -0500
committerAndre Weinand2002-01-29 10:38:55 -0500
commite08ba464add350629b7f2c4fa3a85a151364377e (patch)
tree8df863f3cb834f00e7d4112328c4ac549e94eeea /bundles/org.eclipse.compare/compare/org/eclipse/compare/structuremergeviewer
parentac209c0dac1f34dbfdf111f8f351232659b20f4d (diff)
downloadeclipse.platform.team-e08ba464add350629b7f2c4fa3a85a151364377e.tar.gz
eclipse.platform.team-e08ba464add350629b7f2c4fa3a85a151364377e.tar.xz
eclipse.platform.team-e08ba464add350629b7f2c4fa3a85a151364377e.zip
support for #8574
Diffstat (limited to 'bundles/org.eclipse.compare/compare/org/eclipse/compare/structuremergeviewer')
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/structuremergeviewer/StructureDiffViewer.java22
1 files changed, 15 insertions, 7 deletions
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/structuremergeviewer/StructureDiffViewer.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/structuremergeviewer/StructureDiffViewer.java
index 71489efa6..fa54ff207 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/structuremergeviewer/StructureDiffViewer.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/structuremergeviewer/StructureDiffViewer.java
@@ -10,6 +10,7 @@ import org.eclipse.swt.widgets.Tree;
import org.eclipse.swt.widgets.Control;
import org.eclipse.jface.util.*;
+import org.eclipse.jface.action.*;
import org.eclipse.jface.action.ToolBarManager;
import org.eclipse.jface.text.*;
@@ -49,7 +50,8 @@ public class StructureDiffViewer extends DiffTreeViewer {
private IStructureCreator fStructureCreator;
private IDiffContainer fRoot;
- private ChangePropertyAction fSmartAction;
+ //private ChangePropertyAction fSmartAction;
+ private ActionContributionItem fSmartActionItem;
private IContentChangeListener fContentChangedListener;
private ICompareInputChangeListener fThreeWayInputChangedListener;
private CompareViewerSwitchingPane fParent;
@@ -115,9 +117,10 @@ public class StructureDiffViewer extends DiffTreeViewer {
if (tree != null && !tree.isDisposed())
tree.setData(CompareUI.COMPARE_VIEWER_TITLE, getTitle());
- if (fStructureCreator != null) {
- if (fSmartAction != null)
- fSmartAction.setEnabled(fStructureCreator.canRewriteTree());
+ if (fStructureCreator != null && fSmartActionItem != null) {
+ IAction a= fSmartActionItem.getAction();
+ if (a != null)
+ a.setEnabled(fStructureCreator.canRewriteTree());
// FIXME: if there is an input we should create the trees!
}
}
@@ -187,7 +190,10 @@ public class StructureDiffViewer extends DiffTreeViewer {
if (input != null)
t= input.getAncestor();
- fThreeWay= t != null;
+
+ fThreeWay= (t != null);
+ fSmartActionItem.setVisible(fThreeWay);
+
if (t != fAncestorInput) {
if (fAncestorInput instanceof IContentChangeNotifier)
((IContentChangeNotifier)fAncestorInput).removeContentChangeListener(fContentChangedListener);
@@ -354,8 +360,10 @@ public class StructureDiffViewer extends DiffTreeViewer {
super.createToolItems(toolBarManager);
- fSmartAction= new ChangePropertyAction(getBundle(), getCompareConfiguration(), "action.Smart.", SMART); //$NON-NLS-1$
- toolBarManager.appendToGroup("modes", fSmartAction); //$NON-NLS-1$
+ IAction a= new ChangePropertyAction(getBundle(), getCompareConfiguration(), "action.Smart.", SMART); //$NON-NLS-1$
+ fSmartActionItem= new ActionContributionItem(a);
+ fSmartActionItem.setVisible(fThreeWay);
+ toolBarManager.appendToGroup("modes", fSmartActionItem); //$NON-NLS-1$
}
/**

Back to the top