Trying to hide a composite within another composite (messageArea) and make the other widgets within (tree) expand to take up the space.
----
CTabFolder tabFolder = new CTabFolder(shell, SWT.CLOSE);
CTabItem newTab = new CTabItem(tabFolder, SWT.NONE);
Composite border = new Composite(tabFolder, SWT.BORDER);
GridLayout gridLayout = new GridLayout();
gridLayout.numColumns = 1;
border.setLayout(gridLayout);
Composite messageArea = new Composite(border, SWT.NONE);
GridLayout layout = new GridLayout();
layout.numColumns = 2;
messageArea.setLayout(layout);
messageArea.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
Label imageLabel = new Label(messageArea, SWT.NULL);
imageLabel.setImage(new Image(...));
imageLabel.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_CENTER
| GridData.VERTICAL_ALIGN_BEGINNING));
Label messageLabel = new Label(messageArea, SWT.WRAP);
messageLabel.setText(...)
GridData data = new GridData(GridData.GRAB_HORIZONTAL
| GridData.HORIZONTAL_ALIGN_FILL
| GridData.VERTICAL_ALIGN_BEGINNING);
messageLabel.setLayoutData(data);
Tree tree = new Tree(border, SWT.BORDER |
SWT.FULL_SELECTION | SWT.V_SCROLL | SWT.H_SCROLL);
tree.setLayoutData(new GridData(GridData.FILL_BOTH));
tree.setHeaderVisible(true);
tree.setLinesVisible(true);
TreeColumn tcPrice = new TreeColumn(...);
...
messageArea.setVisible(false);
newTab.setControl(border);
tabFolder.layout(true);
----------
Tried with tabFolder.layout(true), border.layout(true) and even (true, true) for both.