From: Patrick Tasse Date: Wed, 18 Feb 2015 19:48:17 +0000 (-0500) Subject: tmf: Fix inconsistent tree item expansion in TimeGraphCombo X-Git-Url: http://drtracing.org/?a=commitdiff_plain;h=ece2fc5fb6f7289e415f528c1ba2131096c352f0;p=deliverable%2Ftracecompass.git tmf: Fix inconsistent tree item expansion in TimeGraphCombo 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 Reviewed-on: https://git.eclipse.org/r/42155 Reviewed-by: Hudson CI Reviewed-by: Alexandre Montplaisir Tested-by: Alexandre Montplaisir --- diff --git a/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/widgets/timegraph/TimeGraphCombo.java b/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/widgets/timegraph/TimeGraphCombo.java index d0d20820dd..13ecf72982 100644 --- a/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/widgets/timegraph/TimeGraphCombo.java +++ b/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/widgets/timegraph/TimeGraphCombo.java @@ -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;