Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcvs2001-06-15 16:16:40 -0400
committercvs2001-06-15 16:16:40 -0400
commite83ea398c04d8b2e9a0363717cd1c1eeadc745fb (patch)
treebc8130923a5f09db2832b5b455b498c90a0989df /bundles/org.eclipse.compare/compare/org/eclipse/compare/structuremergeviewer
parent60abf2c63f9420fcb3048b4bf0c9c2b2ac55985e (diff)
downloadeclipse.platform.team-e83ea398c04d8b2e9a0363717cd1c1eeadc745fb.tar.gz
eclipse.platform.team-e83ea398c04d8b2e9a0363717cd1c1eeadc745fb.tar.xz
eclipse.platform.team-e83ea398c04d8b2e9a0363717cd1c1eeadc745fb.zip
eg: 1GFDFH2: ITPJUI:ALL - Structure compare Ctrl-P causes error when previous in an unexpanded folderv0_125
Diffstat (limited to 'bundles/org.eclipse.compare/compare/org/eclipse/compare/structuremergeviewer')
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/structuremergeviewer/DiffTreeViewer.java17
1 files changed, 16 insertions, 1 deletions
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/structuremergeviewer/DiffTreeViewer.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/structuremergeviewer/DiffTreeViewer.java
index 3d7cbe246..9de9f9cdd 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/structuremergeviewer/DiffTreeViewer.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/structuremergeviewer/DiffTreeViewer.java
@@ -581,7 +581,22 @@ public class DiffTreeViewer extends TreeViewer {
private void internalSetSelection(TreeItem ti) {
if (ti != null) {
Object data= ti.getData();
- setSelection(new StructuredSelection(data), true);
+ if (data == null) {
+ //1GFDFH2: ITPJUI:ALL - Structure compare Ctrl-P causes error when previous in an unexpanded folder
+ TreeItem parent= ti.getParentItem();
+ if (parent != null) {
+ Object parentData= parent.getData();
+ if (parentData != null) {
+ expandToLevel(parentData, 99);
+ TreeItem[] items= parent.getItems();
+ if (items != null && items.length > 0)
+ data= items[items.length-1].getData();
+ }
+ }
+ }
+
+ if (data != null)
+ setSelection(new StructuredSelection(data), true);
}
}

Back to the top