Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Valenta2007-01-09 15:08:33 +0000
committerMichael Valenta2007-01-09 15:08:33 +0000
commitdacfccb13bfa79dc80cb31286aa38dcd90a7d4b6 (patch)
treeab16fd7f1169433ef9bc050d2b528b21e31d4b3c /bundles/org.eclipse.compare/compare/org/eclipse/compare/CompareEditorInput.java
parent6dd519754e6b8d8b5d5f3b9568aa59236ab14a84 (diff)
downloadeclipse.platform.team-dacfccb13bfa79dc80cb31286aa38dcd90a7d4b6.tar.gz
eclipse.platform.team-dacfccb13bfa79dc80cb31286aa38dcd90a7d4b6.tar.xz
eclipse.platform.team-dacfccb13bfa79dc80cb31286aa38dcd90a7d4b6.zip
Bug 169953 [Edit] Compare editor does not take focus
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.java17
1 files changed, 12 insertions, 5 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 537f65609..6e0a8e1b7 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/CompareEditorInput.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/CompareEditorInput.java
@@ -499,7 +499,8 @@ public abstract class CompareEditorInput implements IEditorInput, IPropertyChang
final Splitter h= new Splitter(parent, direction);
fStructureInputPane= createStructureInputPane(h);
- fFocusPane= fStructureInputPane;
+ if (hasChildren(getCompareResult()))
+ fFocusPane= fStructureInputPane;
fStructurePane1= new CompareViewerSwitchingPane(h, SWT.BORDER | SWT.FLAT, true) {
protected Viewer getViewer(Viewer oldViewer, Object input) {
@@ -581,10 +582,8 @@ public abstract class CompareEditorInput implements IEditorInput, IPropertyChang
final Composite parent) {
return new CompareViewerSwitchingPane(parent, SWT.BORDER | SWT.FLAT, true) {
protected Viewer getViewer(Viewer oldViewer, Object input) {
- if (input instanceof IDiffContainer) {
- IDiffContainer dn= (IDiffContainer) input;
- if (dn.hasChildren())
- return createDiffViewer(this);
+ if (CompareEditorInput.this.hasChildren(input)) {
+ return createDiffViewer(this);
}
if (input instanceof ICompareInput)
return findStructureViewer(oldViewer, (ICompareInput)input, this);
@@ -592,6 +591,14 @@ public abstract class CompareEditorInput implements IEditorInput, IPropertyChang
}
};
}
+
+ /* private */ boolean hasChildren(Object input) {
+ if (input instanceof IDiffContainer) {
+ IDiffContainer dn= (IDiffContainer) input;
+ return (dn.hasChildren());
+ }
+ return false;
+ }
private void feedInput() {
if (fStructureInputPane != null

Back to the top