tmf: Fix inconsistent tree item expansion in TimeGraphCombo
authorPatrick Tasse <patrick.tasse@gmail.com>
Wed, 18 Feb 2015 19:48:17 +0000 (14:48 -0500)
committerPatrick Tasse <patrick.tasse@gmail.com>
Tue, 24 Feb 2015 19:16:18 +0000 (14:16 -0500)
When refresh() is called, the tree viewer expanded all items but the
time graph viewer expanded to the auto-expand level. The tree viewer now
also expands to the auto-expand level.

When an entry filter is applied, the tree viewer expanded all items but
the time graph viewer expanded to the auto-expand level. The time graph
viewer now also expands all items.

Change-Id: Ied0d42d54a2a2b027e879db0d6f960854314eebe
Signed-off-by: Patrick Tasse <patrick.tasse@gmail.com>
Reviewed-on: https://git.eclipse.org/r/42155
Reviewed-by: Hudson CI
Reviewed-by: Alexandre Montplaisir <alexmonthy@voxpopuli.im>
Tested-by: Alexandre Montplaisir <alexmonthy@voxpopuli.im>
org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/widgets/timegraph/TimeGraphCombo.java

index d0d20820dd5ff8ae192f17cd153a803802389277..13ecf72982284261cb2246009100fbbe9fdfc8c5 100644 (file)
@@ -680,6 +680,7 @@ public class TimeGraphCombo extends Composite {
                 fTreeViewer.refresh();
                 fTreeViewer.expandAll();
                 fTimeGraphViewer.refresh();
+                fTimeGraphViewer.expandAll();
                 fInhibitTreeSelection = false;
                 alignTreeItems(true);
                 // Reset selection
@@ -891,10 +892,13 @@ public class TimeGraphCombo extends Composite {
     public void refresh() {
         fInhibitTreeSelection = true;
         Tree tree = fTreeViewer.getTree();
-        tree.setRedraw(false);
-        fTreeViewer.refresh();
-        fTreeViewer.expandAll();
-        tree.setRedraw(true);
+        try {
+            tree.setRedraw(false);
+            fTreeViewer.refresh();
+            fTreeViewer.expandToLevel(fTreeViewer.getAutoExpandLevel());
+        } finally {
+            tree.setRedraw(true);
+        }
         fTimeGraphViewer.refresh();
         alignTreeItems(true);
         fInhibitTreeSelection = false;
This page took 0.025493 seconds and 5 git commands to generate.