diff options
author | Michael Valenta | 2007-01-12 13:29:49 +0000 |
---|---|---|
committer | Michael Valenta | 2007-01-12 13:29:49 +0000 |
commit | d2a12f9f52aa1471c3d5c50e2b2204a71504b551 (patch) | |
tree | 95cfdd2f79b2074137ae09a5b4fe675442ad3807 | |
parent | 47d4c4c8d8acf8c35c834c5efa9207555db82fe8 (diff) | |
download | eclipse.platform.team-d2a12f9f52aa1471c3d5c50e2b2204a71504b551.tar.gz eclipse.platform.team-d2a12f9f52aa1471c3d5c50e2b2204a71504b551.tar.xz eclipse.platform.team-d2a12f9f52aa1471c3d5c50e2b2204a71504b551.zip |
Bug 71285 [Viewers] Option to open structure compare is ignored
2 files changed, 34 insertions, 10 deletions
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/CompareEditorInput.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/CompareEditorInput.java index 08352b1cf..b6f095463 100644 --- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/CompareEditorInput.java +++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/CompareEditorInput.java @@ -601,29 +601,41 @@ public abstract class CompareEditorInput implements IEditorInput, IPropertyChang } private void feedInput() { - if (fStructureInputPane != null + if (fStructureInputPane != null && (fInput instanceof ICompareInput - || !(fStructureInputPane instanceof CompareViewerSwitchingPane))) { - fStructureInputPane.setInput(fInput); + || isCustomStructureInputPane())) { + if (structureCompareOnSingleClick() || hasChildren(fInput) || isCustomStructureInputPane()) { + fStructureInputPane.setInput(fInput); + } else if (!structureCompareOnSingleClick()) { + fContentInputPane.setInput(fInput); + if (fContentInputPane.isEmpty() || fContentInputPane.getViewer() instanceof BinaryCompareViewer) { + fStructureInputPane.setInput(fInput); + } + } ISelection sel= fStructureInputPane.getSelection(); if (sel == null || sel.isEmpty()) feed1(sel); // we only feed downstream viewers if the top left pane is empty } } + private boolean isCustomStructureInputPane() { + return !(fStructureInputPane instanceof CompareViewerSwitchingPane); + } + private void feed1(final ISelection selection) { BusyIndicator.showWhile(fComposite.getDisplay(), new Runnable() { public void run() { if (selection == null || selection.isEmpty()) { Object input= fStructureInputPane.getInput(); - fContentInputPane.setInput(input); + if (input != null) + fContentInputPane.setInput(input); fStructurePane2.setInput(null); // clear downstream pane fStructurePane1.setInput(null); } else { Object input= getElement(selection); fContentInputPane.setInput(input); - if (structureCompareOnSingleClick()) + if (structureCompareOnSingleClick() || fContentInputPane.isEmpty()) fStructurePane1.setInput(input); fStructurePane2.setInput(null); // clear downstream pane if (fStructurePane1.getInput() != input) diff --git a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/CompareEditorInput.java b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/CompareEditorInput.java index 08352b1cf..b6f095463 100644 --- a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/CompareEditorInput.java +++ b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/CompareEditorInput.java @@ -601,29 +601,41 @@ public abstract class CompareEditorInput implements IEditorInput, IPropertyChang } private void feedInput() { - if (fStructureInputPane != null + if (fStructureInputPane != null && (fInput instanceof ICompareInput - || !(fStructureInputPane instanceof CompareViewerSwitchingPane))) { - fStructureInputPane.setInput(fInput); + || isCustomStructureInputPane())) { + if (structureCompareOnSingleClick() || hasChildren(fInput) || isCustomStructureInputPane()) { + fStructureInputPane.setInput(fInput); + } else if (!structureCompareOnSingleClick()) { + fContentInputPane.setInput(fInput); + if (fContentInputPane.isEmpty() || fContentInputPane.getViewer() instanceof BinaryCompareViewer) { + fStructureInputPane.setInput(fInput); + } + } ISelection sel= fStructureInputPane.getSelection(); if (sel == null || sel.isEmpty()) feed1(sel); // we only feed downstream viewers if the top left pane is empty } } + private boolean isCustomStructureInputPane() { + return !(fStructureInputPane instanceof CompareViewerSwitchingPane); + } + private void feed1(final ISelection selection) { BusyIndicator.showWhile(fComposite.getDisplay(), new Runnable() { public void run() { if (selection == null || selection.isEmpty()) { Object input= fStructureInputPane.getInput(); - fContentInputPane.setInput(input); + if (input != null) + fContentInputPane.setInput(input); fStructurePane2.setInput(null); // clear downstream pane fStructurePane1.setInput(null); } else { Object input= getElement(selection); fContentInputPane.setInput(input); - if (structureCompareOnSingleClick()) + if (structureCompareOnSingleClick() || fContentInputPane.isEmpty()) fStructurePane1.setInput(input); fStructurePane2.setInput(null); // clear downstream pane if (fStructurePane1.getInput() != input) |