Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Valenta2007-03-23 19:39:17 +0000
committerMichael Valenta2007-03-23 19:39:17 +0000
commit17b2bf4de6c55ee9cce8355a603af903685cf1de (patch)
treef4b74b38f77da86717923a5b8b63bc02fa42110e /bundles/org.eclipse.compare/compare/org/eclipse/compare/CompareEditorInput.java
parent532a0619215cf822737690de1ada8516c19123cd (diff)
downloadeclipse.platform.team-17b2bf4de6c55ee9cce8355a603af903685cf1de.tar.gz
eclipse.platform.team-17b2bf4de6c55ee9cce8355a603af903685cf1de.tar.xz
eclipse.platform.team-17b2bf4de6c55ee9cce8355a603af903685cf1de.zip
Bug 45247 [Structure Compare] Show compare editor structure in Outline view
Diffstat (limited to 'bundles/org.eclipse.compare/compare/org/eclipse/compare/CompareEditorInput.java')
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/CompareEditorInput.java35
1 files changed, 20 insertions, 15 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 b7f5417cc..1c6f3e8c4 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/CompareEditorInput.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/CompareEditorInput.java
@@ -166,29 +166,34 @@ public abstract class CompareEditorInput implements IEditorInput, IPropertyChang
private InternalOutlineViewerCreator fOutlineView;
private class InternalOutlineViewerCreator extends OutlineViewerCreator {
- public Viewer findStructureViewer(Viewer oldViewer,
- ICompareInput input, Composite parent,
- CompareConfiguration configuration) {
+ private OutlineViewerCreator getWrappedCreator() {
if (fContentInputPane != null) {
Viewer v = fContentInputPane.getViewer();
if (v != null) {
- OutlineViewerCreator creator = (OutlineViewerCreator)Utilities.getAdapter(v, OutlineViewerCreator.class);
- if (creator != null)
- return creator.findStructureViewer(oldViewer, input, parent, configuration);
+ return (OutlineViewerCreator)Utilities.getAdapter(v, OutlineViewerCreator.class);
}
}
return null;
}
+ public Viewer findStructureViewer(Viewer oldViewer,
+ ICompareInput input, Composite parent,
+ CompareConfiguration configuration) {
+ OutlineViewerCreator creator = getWrappedCreator();
+ if (creator != null)
+ return creator.findStructureViewer(oldViewer, input, parent, configuration);
+ return null;
+ }
public boolean hasViewerFor(Object input) {
- if (fContentInputPane != null) {
- Viewer v = fContentInputPane.getViewer();
- if (v != null) {
- OutlineViewerCreator creator = (OutlineViewerCreator)Utilities.getAdapter(v, OutlineViewerCreator.class);
- return (creator != null);
- }
- }
- return false;
+ OutlineViewerCreator creator = getWrappedCreator();
+ return (creator != null);
+ }
+
+ public Object getInput() {
+ OutlineViewerCreator creator = getWrappedCreator();
+ if (creator != null)
+ return creator.getInput();
+ return null;
}
}
@@ -253,7 +258,7 @@ public abstract class CompareEditorInput implements IEditorInput, IPropertyChang
}
};
}
- if (adapter == OutlineViewerCreator.class && getCompareResult() != null && !hasChildren(getCompareResult())) {
+ if (adapter == OutlineViewerCreator.class) {
synchronized (this) {
if (fOutlineView == null)
fOutlineView = new InternalOutlineViewerCreator();

Back to the top