From aa32f26dd544ec4c98b0099f59ebe25e2d06de74 Mon Sep 17 00:00:00 2001 From: davidcok Date: Thu, 3 Aug 2023 16:52:01 -0400 Subject: [PATCH 1/5] WIP --- .../src/com/ge/research/rack/views/NodegroupsView.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tools/rack/rack.plugin/src/com/ge/research/rack/views/NodegroupsView.java b/tools/rack/rack.plugin/src/com/ge/research/rack/views/NodegroupsView.java index 99238361..aedeb745 100644 --- a/tools/rack/rack.plugin/src/com/ge/research/rack/views/NodegroupsView.java +++ b/tools/rack/rack.plugin/src/com/ge/research/rack/views/NodegroupsView.java @@ -94,6 +94,7 @@ public class NodegroupsView extends ViewPart implements INodegroupView { private Table table; private Button selectAllButton; + private Composite topComposite; public String getProjectPath() { return ""; @@ -120,6 +121,7 @@ public void createPartControl(Composite parent) { final Display display = Display.getCurrent(); final ScrolledComposite sc = new ScrolledComposite(parent, SWT.H_SCROLL | SWT.V_SCROLL); + this.topComposite = sc; final Composite composite = new Composite(sc, SWT.NONE); sc.setContent(composite); @@ -192,7 +194,7 @@ public void handleEvent(Event arg0) { table = new Table(floatContainer, SWT.CHECK | SWT.H_SCROLL | SWT.V_SCROLL); table.removeAll(); - table.setSize(1130, 600); + table.setSize(1130, 60); table.setHeaderVisible(true); table.setLinesVisible(true); table.setHeaderBackground(display.getSystemColor(SWT.COLOR_TITLE_BACKGROUND_GRADIENT)); @@ -255,6 +257,7 @@ private void refreshNodegroupList() { table.setEnabled(table.getItemCount() > 0); Arrays.stream(table.getColumns()).forEach(TableColumn::pack); table.pack(); + topComposite.pack(); } catch (final Exception e) { RackConsole.getConsole().warning(UPDATE_NODEGROUP_LIST_ERROR); @@ -288,7 +291,8 @@ private void filterNodegroups(String searchTerm) { table.setEnabled(table.getItemCount() > 0); // Arrays.stream(table.getColumns()).forEach(TableColumn::pack); - // table.pack(); + table.pack(); + topComposite.pack(); } catch (final Exception e) { RackConsole.getConsole().warning(UPDATE_NODEGROUP_LIST_ERROR); From f27ee74efb4c3a302cedbe939d8c827e53e607ec Mon Sep 17 00:00:00 2001 From: davidcok Date: Tue, 22 Aug 2023 10:56:50 -0400 Subject: [PATCH 2/5] Checkpoint for Table --- .../research/rack/views/NodegroupsView.java | 36 ++++++++++++------- 1 file changed, 23 insertions(+), 13 deletions(-) diff --git a/tools/rack/rack.plugin/src/com/ge/research/rack/views/NodegroupsView.java b/tools/rack/rack.plugin/src/com/ge/research/rack/views/NodegroupsView.java index 49c81ff8..fcabdef5 100644 --- a/tools/rack/rack.plugin/src/com/ge/research/rack/views/NodegroupsView.java +++ b/tools/rack/rack.plugin/src/com/ge/research/rack/views/NodegroupsView.java @@ -45,6 +45,7 @@ import org.eclipse.jface.dialogs.MessageDialog; import org.eclipse.swt.SWT; import org.eclipse.swt.custom.ScrolledComposite; +import org.eclipse.swt.events.SelectionAdapter; import org.eclipse.swt.events.SelectionEvent; import org.eclipse.swt.events.SelectionListener; import org.eclipse.swt.layout.FormAttachment; @@ -58,6 +59,7 @@ import org.eclipse.swt.widgets.Label; import org.eclipse.swt.widgets.Listener; import org.eclipse.swt.widgets.Menu; +import org.eclipse.swt.widgets.ScrollBar; import org.eclipse.swt.widgets.Table; import org.eclipse.swt.widgets.TableColumn; import org.eclipse.swt.widgets.TableItem; @@ -131,7 +133,7 @@ public void createPartControl(Composite parent) { layout.verticalSpacing = 10; composite.setLayout(layout); - composite.setSize(1130 / 2, 600); +// composite.setSize(1130 / 2, 600); if (!ConnectionUtil.ping()) { return; @@ -184,8 +186,7 @@ public void handleEvent(Event arg0) { } }); - /* Select All Button not supported in SWT table - float workaround */ - final Composite floatContainer = new Composite(composite, SWT.BORDER); + final Composite floatContainer = new Composite(composite, SWT.NONE); floatContainer.setLayout(new FormLayout()); final FormData tableFloatPosition = new FormData(); tableFloatPosition.top = new FormAttachment(0); @@ -195,7 +196,7 @@ public void handleEvent(Event arg0) { table = new Table(floatContainer, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL); table.removeAll(); - table.setSize(1130, 60); +// table.setSize(1130, 60); table.setHeaderVisible(true); table.setLinesVisible(true); table.setHeaderBackground(display.getSystemColor(SWT.COLOR_TITLE_BACKGROUND_GRADIENT)); @@ -218,24 +219,32 @@ public void handleEvent(Event arg0) { makeActions(); hookContextMenu(); - final TableColumn col1 = new TableColumn(table, SWT.CENTER); - col1.setText("Nodegroup ID"); // Accommodate select all button buffer - table.showColumn(col1); +// final TableColumn col1 = new TableColumn(table, SWT.CENTER); +// col1.setText("Nodegroup ID"); // Accommodate select all button buffer +// table.showColumn(col1); - Stream.of("Comments", "Creation Data", "Creator") + Stream.of("Nodegroup ID", "Comments", "Creation Data", "Creator") .forEach( header -> { - final TableColumn col = new TableColumn(table, SWT.CENTER | SWT.WRAP); + final TableColumn col = new TableColumn(table, SWT.LEFT); col.setText(header); table.showColumn(col); }); refreshNodegroupList(); +// var listener = new SelectionAdapter() { +// public void widgetSelected(SelectionEvent e) { +// super.widgetSelected(e); +// var sb = (ScrollBar)e.widget; +// System.out.println("SB " + sb.getMinimum() + " " + sb.getMaximum() + " " + sb.getIncrement() + " " + sb.getThumb() + " " + sb.getPageIncrement()); +// sb = sb; +// } +// }; +// sc.getHorizontalBar().addSelectionListener(listener); // Initially show all columns for visibility / view reset - Arrays.stream(table.getColumns()).forEach(c -> c.setWidth(150)); - +// Arrays.stream(table.getColumns()).forEach(c -> c.setWidth(150)); composite.pack(); } @@ -248,8 +257,8 @@ private void refreshNodegroupList() { .forEach( row -> { final TableItem item = new TableItem(table, SWT.NONE); - item.setData(row); row.remove(4); // Remove application data "semTK" + item.setData(row); for (int j = 0; j < row.size(); j++) { item.setText(j, row.get(j)); } @@ -257,7 +266,8 @@ private void refreshNodegroupList() { table.setEnabled(table.getItemCount() > 0); Arrays.stream(table.getColumns()).forEach(TableColumn::pack); - table.pack(); +// table.getColumns()[1].setWidth(250); +// table.pack(); topComposite.pack(); } catch (final Exception e) { From facb3bcbcb4f644ed721ba06764a049b6ebd0d53 Mon Sep 17 00:00:00 2001 From: davidcok Date: Wed, 23 Aug 2023 10:30:57 -0400 Subject: [PATCH 3/5] Checkpoint --- .../research/rack/views/NodegroupsView.java | 87 +++++-------------- 1 file changed, 20 insertions(+), 67 deletions(-) diff --git a/tools/rack/rack.plugin/src/com/ge/research/rack/views/NodegroupsView.java b/tools/rack/rack.plugin/src/com/ge/research/rack/views/NodegroupsView.java index fcabdef5..5d6f029a 100644 --- a/tools/rack/rack.plugin/src/com/ge/research/rack/views/NodegroupsView.java +++ b/tools/rack/rack.plugin/src/com/ge/research/rack/views/NodegroupsView.java @@ -48,6 +48,7 @@ import org.eclipse.swt.events.SelectionAdapter; import org.eclipse.swt.events.SelectionEvent; import org.eclipse.swt.events.SelectionListener; +import org.eclipse.swt.layout.FillLayout; import org.eclipse.swt.layout.FormAttachment; import org.eclipse.swt.layout.FormData; import org.eclipse.swt.layout.FormLayout; @@ -98,6 +99,8 @@ public class NodegroupsView extends ViewPart implements INodegroupView { private Table table; private Button selectAllButton; private Composite topComposite; + private Composite composite; + private Composite floatContainer; public String getProjectPath() { return ""; @@ -124,17 +127,17 @@ public void createPartControl(Composite parent) { final Display display = Display.getCurrent(); final ScrolledComposite sc = new ScrolledComposite(parent, SWT.H_SCROLL | SWT.V_SCROLL); + sc.setLayout(new FillLayout()); this.topComposite = sc; - final Composite composite = new Composite(sc, SWT.NONE); + composite = new Composite(sc, SWT.NONE); sc.setContent(composite); + sc.setMinSize(composite.computeSize(SWT.DEFAULT, SWT.DEFAULT)); GridLayout layout = new GridLayout(); layout.numColumns = 1; layout.verticalSpacing = 10; composite.setLayout(layout); -// composite.setSize(1130 / 2, 600); - if (!ConnectionUtil.ping()) { return; } @@ -186,7 +189,7 @@ public void handleEvent(Event arg0) { } }); - final Composite floatContainer = new Composite(composite, SWT.NONE); + floatContainer = new Composite(composite, SWT.NONE); floatContainer.setLayout(new FormLayout()); final FormData tableFloatPosition = new FormData(); tableFloatPosition.top = new FormAttachment(0); @@ -196,7 +199,6 @@ public void handleEvent(Event arg0) { table = new Table(floatContainer, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL); table.removeAll(); -// table.setSize(1130, 60); table.setHeaderVisible(true); table.setLinesVisible(true); table.setHeaderBackground(display.getSystemColor(SWT.COLOR_TITLE_BACKGROUND_GRADIENT)); @@ -205,24 +207,10 @@ public void handleEvent(Event arg0) { table.setFocus(); table.setLayoutData(tableFloatPosition); -// table.addSelectionListener(new NodegroupSelectionListener()); - -// final FormData selectAllButtonPosition = new FormData(); -// selectAllButtonPosition.left = new FormAttachment(table, 1, SWT.LEFT); -// selectAllButtonPosition.top = new FormAttachment(table, 2, SWT.TOP); -// -// selectAllButton = new Button(floatContainer, SWT.CHECK); -// selectAllButton.setLayoutData(selectAllButtonPosition); -// selectAllButton.moveAbove(table); -// selectAllButton.addSelectionListener(new NodegroupSelectAllListener()); makeActions(); hookContextMenu(); -// final TableColumn col1 = new TableColumn(table, SWT.CENTER); -// col1.setText("Nodegroup ID"); // Accommodate select all button buffer -// table.showColumn(col1); - Stream.of("Nodegroup ID", "Comments", "Creation Data", "Creator") .forEach( header -> { @@ -233,19 +221,18 @@ public void handleEvent(Event arg0) { }); refreshNodegroupList(); -// var listener = new SelectionAdapter() { -// public void widgetSelected(SelectionEvent e) { -// super.widgetSelected(e); -// var sb = (ScrollBar)e.widget; -// System.out.println("SB " + sb.getMinimum() + " " + sb.getMaximum() + " " + sb.getIncrement() + " " + sb.getThumb() + " " + sb.getPageIncrement()); -// sb = sb; -// } -// }; -// sc.getHorizontalBar().addSelectionListener(listener); // Initially show all columns for visibility / view reset // Arrays.stream(table.getColumns()).forEach(c -> c.setWidth(150)); - composite.pack(); + + parent.pack(); +// var cols = table.getColumns(); +// String s = "WIDTH " + parent.getSize().x + " " + topComposite.getSize().x + " " + composite.getSize().x + " " + floatContainer.getSize().x + " " + table.getSize().x; +// for (var c: cols) s = s + " " + c.getWidth(); +// var sb = topComposite.getHorizontalBar(); +// s = s + " SB " + sb.getSelection() + " " + sb.getMinimum() + " " + sb.getMaximum() + " " + sb.getIncrement() + " " + sb.getPageIncrement() + " " + sb.getThumb(); +// s = s; + } private void refreshNodegroupList() { @@ -266,8 +253,10 @@ private void refreshNodegroupList() { table.setEnabled(table.getItemCount() > 0); Arrays.stream(table.getColumns()).forEach(TableColumn::pack); -// table.getColumns()[1].setWidth(250); -// table.pack(); + + table.pack(); + floatContainer.pack(); + composite.pack(); topComposite.pack(); } catch (final Exception e) { @@ -349,13 +338,6 @@ public ArrayList getSelectedNodegroups() { .filter(d -> !d.isEmpty()) .map(d -> (String) d.get(0)) .collect(Collectors.toCollection(ArrayList::new)); - -// return Arrays.stream(table.getItems()) -// .filter(ng -> ng.getChecked()) -// .map(ng -> (List) ng.getData()) -// .filter(d -> !d.isEmpty()) -// .map(d -> (String) d.get(0)) -// .collect(Collectors.toCollection(ArrayList::new)); } private class DeleteSelectedNodeGroupsAction extends Action { @@ -445,33 +427,4 @@ protected IStatus run(IProgressMonitor monitor) { } } -// private class NodegroupSelectAllListener implements SelectionListener { -// -// @Override -// public void widgetSelected(final SelectionEvent e) { -// if (null == table) { -// return; -// } -// final boolean selectAll = ((Button) e.getSource()).getSelection(); -// Arrays.stream(table.getItems()).forEach(i -> i.setChecked(selectAll)); -// } -// -// @Override -// public void widgetDefaultSelected(final SelectionEvent e) {} -// } -// -// private class NodegroupSelectionListener implements SelectionListener { -// -// @Override -// public void widgetSelected(final SelectionEvent e) { -// if (null == selectAllButton) { -// return; -// } -// selectAllButton.setSelection( -// Arrays.stream(table.getItems()).allMatch(p -> p.getChecked())); -// } -// -// @Override -// public void widgetDefaultSelected(final SelectionEvent e) {} -// } } From 8724e5215c1721b761bfb2c488f5a8e50eb2fdd8 Mon Sep 17 00:00:00 2001 From: davidcok Date: Wed, 24 Jan 2024 10:19:10 -0500 Subject: [PATCH 4/5] Formatting --- .../research/rack/views/NodegroupsView.java | 31 +++++++++---------- 1 file changed, 14 insertions(+), 17 deletions(-) diff --git a/tools/rack/rack.plugin/src/com/ge/research/rack/views/NodegroupsView.java b/tools/rack/rack.plugin/src/com/ge/research/rack/views/NodegroupsView.java index 561a7c74..aa8c21cf 100644 --- a/tools/rack/rack.plugin/src/com/ge/research/rack/views/NodegroupsView.java +++ b/tools/rack/rack.plugin/src/com/ge/research/rack/views/NodegroupsView.java @@ -49,9 +49,6 @@ import org.eclipse.jface.dialogs.MessageDialog; import org.eclipse.swt.SWT; import org.eclipse.swt.custom.ScrolledComposite; -import org.eclipse.swt.events.SelectionAdapter; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.events.SelectionListener; import org.eclipse.swt.layout.FillLayout; import org.eclipse.swt.layout.FormAttachment; import org.eclipse.swt.layout.FormData; @@ -64,7 +61,6 @@ import org.eclipse.swt.widgets.Label; import org.eclipse.swt.widgets.Listener; import org.eclipse.swt.widgets.Menu; -import org.eclipse.swt.widgets.ScrollBar; import org.eclipse.swt.widgets.Table; import org.eclipse.swt.widgets.TableColumn; import org.eclipse.swt.widgets.TableItem; @@ -231,15 +227,17 @@ public void handleEvent(Event arg0) { refreshNodegroupList(); // Initially show all columns for visibility / view reset -// Arrays.stream(table.getColumns()).forEach(c -> c.setWidth(150)); + // Arrays.stream(table.getColumns()).forEach(c -> c.setWidth(150)); parent.pack(); -// var cols = table.getColumns(); -// String s = "WIDTH " + parent.getSize().x + " " + topComposite.getSize().x + " " + composite.getSize().x + " " + floatContainer.getSize().x + " " + table.getSize().x; -// for (var c: cols) s = s + " " + c.getWidth(); -// var sb = topComposite.getHorizontalBar(); -// s = s + " SB " + sb.getSelection() + " " + sb.getMinimum() + " " + sb.getMaximum() + " " + sb.getIncrement() + " " + sb.getPageIncrement() + " " + sb.getThumb(); -// s = s; + // var cols = table.getColumns(); + // String s = "WIDTH " + parent.getSize().x + " " + topComposite.getSize().x + " " + + // composite.getSize().x + " " + floatContainer.getSize().x + " " + table.getSize().x; + // for (var c: cols) s = s + " " + c.getWidth(); + // var sb = topComposite.getHorizontalBar(); + // s = s + " SB " + sb.getSelection() + " " + sb.getMinimum() + " " + sb.getMaximum() + // + " " + sb.getIncrement() + " " + sb.getPageIncrement() + " " + sb.getThumb(); + // s = s; } @@ -341,11 +339,11 @@ private void makeActions() { } public ArrayList getSelectedNodegroups() { - return Arrays.stream(table.getSelection()) - .map(ng -> (List) ng.getData()) - .filter(d -> !d.isEmpty()) - .map(d -> (String) d.get(0)) - .collect(Collectors.toCollection(ArrayList::new)); + return Arrays.stream(table.getSelection()) + .map(ng -> (List) ng.getData()) + .filter(d -> !d.isEmpty()) + .map(d -> (String) d.get(0)) + .collect(Collectors.toCollection(ArrayList::new)); } private class DeleteSelectedNodeGroupsAction extends Action { @@ -439,5 +437,4 @@ protected IStatus run(IProgressMonitor monitor) { return Status.OK_STATUS; } } - } From 93db1d1d2713d76876c5e65befd7ef61fe477d53 Mon Sep 17 00:00:00 2001 From: davidcok Date: Fri, 22 Mar 2024 13:24:13 -0400 Subject: [PATCH 5/5] Fixed up scrollbar behavior --- .../research/rack/views/NodegroupsView.java | 92 +++++++++++-------- 1 file changed, 53 insertions(+), 39 deletions(-) diff --git a/tools/rack/rack.plugin/src/com/ge/research/rack/views/NodegroupsView.java b/tools/rack/rack.plugin/src/com/ge/research/rack/views/NodegroupsView.java index 658a87ea..a106882e 100644 --- a/tools/rack/rack.plugin/src/com/ge/research/rack/views/NodegroupsView.java +++ b/tools/rack/rack.plugin/src/com/ge/research/rack/views/NodegroupsView.java @@ -49,10 +49,13 @@ import org.eclipse.jface.dialogs.MessageDialog; import org.eclipse.swt.SWT; import org.eclipse.swt.custom.ScrolledComposite; +import org.eclipse.swt.events.ControlAdapter; +import org.eclipse.swt.events.ControlEvent; import org.eclipse.swt.layout.FillLayout; import org.eclipse.swt.layout.FormAttachment; import org.eclipse.swt.layout.FormData; import org.eclipse.swt.layout.FormLayout; +import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.widgets.Button; import org.eclipse.swt.widgets.Composite; @@ -92,7 +95,7 @@ public class NodegroupsView extends ViewPart implements INodegroupView { private Table table; private Button selectAllButton; - private Composite topComposite; + private ScrolledComposite topComposite; private Composite composite; private Composite floatContainer; @@ -117,20 +120,33 @@ public void setFocus() { @Override public void createPartControl(Composite parent) { - + + // Notes: + // The table starts with an extra column. This appears to be a known WON'T FIX. + // The extra column can be resized to zero width. + // The code below sets each of the nested composite to fill out horizontally. + // Then the table does also. This appears to be necessary when there is an encapsulating ScrolledComposite. + final Display display = Display.getCurrent(); final ScrolledComposite sc = new ScrolledComposite(parent, SWT.H_SCROLL | SWT.V_SCROLL); sc.setLayout(new FillLayout()); this.topComposite = sc; composite = new Composite(sc, SWT.NONE); + sc.setExpandHorizontal(true); sc.setContent(composite); - sc.setMinSize(composite.computeSize(SWT.DEFAULT, SWT.DEFAULT)); GridLayout layout = new GridLayout(); layout.numColumns = 1; layout.verticalSpacing = 10; + var gdata = new GridData(); + gdata.grabExcessHorizontalSpace = true; + gdata.grabExcessVerticalSpace = true; + gdata.horizontalAlignment = SWT.FILL; + gdata.verticalAlignment = SWT.FILL; + gdata.widthHint = SWT.FILL; composite.setLayout(layout); + composite.setLayoutData(gdata); if (!ConnectionUtil.ping()) { return; @@ -184,33 +200,27 @@ public void handleEvent(Event arg0) { }); floatContainer = new Composite(composite, SWT.NONE); - floatContainer.setLayout(new FormLayout()); - final FormData tableFloatPosition = new FormData(); - tableFloatPosition.top = new FormAttachment(0); - tableFloatPosition.left = new FormAttachment(0); - tableFloatPosition.right = new FormAttachment(100); - tableFloatPosition.bottom = new FormAttachment(100); - - table = new Table(floatContainer, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL); + var floatLayout = new GridLayout(1, true); + var floatData = new GridData(); + floatData.horizontalAlignment = SWT.FILL; + floatData.grabExcessHorizontalSpace = true; + floatContainer.setLayoutData(floatData); + floatContainer.setLayout(floatLayout); + + table = new Table(floatContainer, SWT.MULTI | SWT.NO_SCROLL); table.removeAll(); table.setHeaderVisible(true); table.setLinesVisible(true); table.setHeaderBackground(display.getSystemColor(SWT.COLOR_TITLE_BACKGROUND_GRADIENT)); - table.setHeaderForeground(display.getSystemColor(SWT.COLOR_TITLE_FOREGROUND)); - table.setFocus(); - table.setLayoutData(tableFloatPosition); - // table.addSelectionListener(new NodegroupSelectionListener()); - - // final FormData selectAllButtonPosition = new FormData(); - // selectAllButtonPosition.left = new FormAttachment(table, 1, SWT.LEFT); - // selectAllButtonPosition.top = new FormAttachment(table, 2, SWT.TOP); - // - // selectAllButton = new Button(floatContainer, SWT.CHECK); - // selectAllButton.setLayoutData(selectAllButtonPosition); - // selectAllButton.moveAbove(table); - // selectAllButton.addSelectionListener(new NodegroupSelectAllListener()); + var tableData = new GridData(); + tableData.horizontalAlignment = SWT.FILL; + // Setting FILL here allows the table to fill out the horizontal width of the view window. + // But it also makes the ScrolledComposite think horizontal scrollbars are never needed + // so we have to rely on the table's own scrollbars. + tableData.grabExcessHorizontalSpace = true; + table.setLayoutData(tableData); makeActions(); hookContextMenu(); @@ -219,26 +229,25 @@ public void handleEvent(Event arg0) { .forEach( header -> { final TableColumn col = new TableColumn(table, SWT.LEFT); - col.setText(header); table.showColumn(col); + col.addControlListener( new ControlAdapter() { + @Override + public void controlResized(ControlEvent e) { + resetScrollbarSize(); + } + }); }); - + refreshNodegroupList(); - // Initially show all columns for visibility / view reset - // Arrays.stream(table.getColumns()).forEach(c -> c.setWidth(150)); - - parent.pack(); - // var cols = table.getColumns(); - // String s = "WIDTH " + parent.getSize().x + " " + topComposite.getSize().x + " " + - // composite.getSize().x + " " + floatContainer.getSize().x + " " + table.getSize().x; - // for (var c: cols) s = s + " " + c.getWidth(); - // var sb = topComposite.getHorizontalBar(); - // s = s + " SB " + sb.getSelection() + " " + sb.getMinimum() + " " + sb.getMaximum() - // + " " + sb.getIncrement() + " " + sb.getPageIncrement() + " " + sb.getThumb(); - // s = s; + } + + private void resetScrollbarSize() { + int minwidth = 20; // To account for margins + for (int k=0; k< table.getColumnCount(); k++) minwidth += table.getColumn(k).getWidth(); + topComposite.setMinSize(composite.computeSize(minwidth, SWT.DEFAULT)); } private void refreshNodegroupList() { @@ -263,6 +272,7 @@ private void refreshNodegroupList() { table.pack(); floatContainer.pack(); composite.pack(); + resetScrollbarSize(); topComposite.pack(); } catch (final Exception e) { @@ -298,7 +308,11 @@ private void filterNodegroups(String searchTerm) { table.setEnabled(table.getItemCount() > 0); // Arrays.stream(table.getColumns()).forEach(TableColumn::pack); table.pack(); - topComposite.pack(); + floatContainer.pack(); + composite.pack(); + resetScrollbarSize(); + //topComposite.pack(); // With this pack, the scrollbars disappear when the filter is changed. + // though they reappear if the view window is resized. } catch (final Exception e) { ErrorMessageUtil.warning(UPDATE_NODEGROUP_LIST_ERROR);