From: Matthew Khouzam Date: Tue, 29 Mar 2016 17:04:31 +0000 (-0400) Subject: tmf.ui: Make TmfEventsTable#PackColumns return a value X-Git-Url: http://git.efficios.com/?a=commitdiff_plain;ds=sidebyside;h=19d1060f64efa19f57784a42ff9ccd05c6867bfa;p=deliverable%2Ftracecompass.git tmf.ui: Make TmfEventsTable#PackColumns return a value This allows extending classes to know whether the pack actually happened or if it was fast returned. The quick return shows that the columns have already been packed. If the method does pack the columns, we know that it was done the first time (on a new trace open) or after. This can allow extending classes to have a hook to a location where the columns have been initialized as they are not yet in the consutructor or in "init". Change-Id: Ia4f3ab76e144d937bb5a8eb5e7597c9e99b3114f Signed-off-by: Matthew Khouzam Reviewed-on: https://git.eclipse.org/r/69469 Reviewed-by: Hudson CI Reviewed-by: Marc-Andre Laperle Tested-by: Marc-Andre Laperle --- diff --git a/tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/viewers/events/TmfEventsTable.java b/tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/viewers/events/TmfEventsTable.java index 1b4287e27a..7ad2b6d01c 100644 --- a/tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/viewers/events/TmfEventsTable.java +++ b/tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/viewers/events/TmfEventsTable.java @@ -2553,10 +2553,16 @@ public class TmfEventsTable extends TmfComponent implements IGotoMarker, IColorS /** * Pack the columns. + * + * @return + * Whether or not a pack was done in this call. Otherwise, it was already done by a + * previous call + * + * @since 2.0 */ - protected void packColumns() { + protected boolean packColumns() { if (fPackDone) { - return; + return false; } fTable.setRedraw(false); try { @@ -2571,6 +2577,7 @@ public class TmfEventsTable extends TmfComponent implements IGotoMarker, IColorS fTable.setRedraw(true); } fPackDone = true; + return true; } private void packMarginColumn() {