tmf: Bug 497994: Hide Table action does not layout properly
authorPatrick Tasse <patrick.tasse@gmail.com>
Fri, 15 Jul 2016 21:03:36 +0000 (17:03 -0400)
committerPatrick Tasse <patrick.tasse@gmail.com>
Mon, 18 Jul 2016 15:34:52 +0000 (11:34 -0400)
Change-Id: I8b1f2c741203434b80ea5165d430b01d16514225
Signed-off-by: Patrick Tasse <patrick.tasse@gmail.com>
Reviewed-on: https://git.eclipse.org/r/77418
Reviewed-by: Matthew Khouzam <matthew.khouzam@ericsson.com>
Tested-by: Matthew Khouzam <matthew.khouzam@ericsson.com>
tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/viewers/events/TmfEventsTable.java

index 62ee7b0b5c294521936904fdc44afa23aa03d046..b2af93c7d8e841ed8edaa448864a8f3fd36807b9 100644 (file)
@@ -664,6 +664,7 @@ public class TmfEventsTable extends TmfComponent implements IGotoMarker, IColorS
 
     private Composite fComposite;
     private SashForm fSashForm;
+    private Composite fTableComposite;
     private TmfRawEventViewer fRawViewer;
     private ITmfTrace fTrace;
     private volatile boolean fPackDone = false;
@@ -812,16 +813,16 @@ public class TmfEventsTable extends TmfComponent implements IGotoMarker, IColorS
         fSashForm.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
 
         // Create a composite for the table and its header bar
-        Composite tableComposite = new Composite(fSashForm, SWT.NONE);
-        tableComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
+        fTableComposite = new Composite(fSashForm, SWT.NONE);
+        fTableComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
         gl = new GridLayout(1, false);
         gl.marginHeight = 0;
         gl.marginWidth = 0;
         gl.verticalSpacing = 0;
-        tableComposite.setLayout(gl);
+        fTableComposite.setLayout(gl);
 
         // Create an events table header bar
-        fHeaderBar = new TmfEventsTableHeader(tableComposite, SWT.NONE, new IEventsTableHeaderListener() {
+        fHeaderBar = new TmfEventsTableHeader(fTableComposite, SWT.NONE, new IEventsTableHeaderListener() {
             @Override
             public void filterSelected(ITmfFilter filter) {
                 if (filter instanceof TmfFilterMatchesNode) {
@@ -849,7 +850,7 @@ public class TmfEventsTable extends TmfComponent implements IGotoMarker, IColorS
 
         // Create a virtual table
         final int style = SWT.H_SCROLL | SWT.V_SCROLL | SWT.MULTI | SWT.FULL_SELECTION;
-        fTable = new TmfVirtualTable(tableComposite, style);
+        fTable = new TmfVirtualTable(fTableComposite, style);
 
         // Set the table layout
         final GridData layoutData = new GridData(SWT.FILL, SWT.FILL, true, true);
@@ -1048,7 +1049,7 @@ public class TmfEventsTable extends TmfComponent implements IGotoMarker, IColorS
         final IAction showTableAction = new Action(Messages.TmfEventsTable_ShowTableActionText) {
             @Override
             public void run() {
-                fTable.setVisible(true);
+                fTableComposite.setVisible(true);
                 fSashForm.layout();
             }
         };
@@ -1056,7 +1057,7 @@ public class TmfEventsTable extends TmfComponent implements IGotoMarker, IColorS
         final IAction hideTableAction = new Action(Messages.TmfEventsTable_HideTableActionText) {
             @Override
             public void run() {
-                fTable.setVisible(false);
+                fTableComposite.setVisible(false);
                 fSashForm.layout();
             }
         };
This page took 0.029232 seconds and 5 git commands to generate.