I’m trying to build an eclipse plugin view where I have a view that has an input bar at the top and a TableViewer at the bottom. Currently I’m trying to build 2 separate composites within a larger composite, but I’m having a hard time controlling the size of each of the individual composites. Here is some code:
public void createPartControl(Composite parent) {
FillLayout parentLayout = new FillLayout(SWT.VERTICAL);
parent.setLayout(parentLayout);
Composite composite = new Composite(parent, SWT.BORDER);
composite.setLayout(new FillLayout());
viewer = new TableViewer(composite, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL);
Composite composite2 = new Composite(parent, SWT.BORDER);
GridLayout gridLayout = new GridLayout();
composite2.setLayout(gridLayout);
GridData expGridData = new GridData();
expGridData.horizontalAlignment = GridData.FILL;
expGridData.grabExcessHorizontalSpace = true;
expGridData.grabExcessVerticalSpace = true;
Label expLabel = new Label(composite2, SWT.NONE);
expLabel.setText("Express");
Text exp = new Text(composite2, SWT.BORDER);
exp.setLayoutData(expGridData);
}
I’m trying to shrink composite 2 while increasing the size of composite1, both of which reside in the parent composite. I’ve tried looking through methods for the FillLayout as well as the composites themselves but I haven’t found anything that works.
Thanks for any help
Try this one 🙂