My master section consists of a TableViewer and i want the master section width to be fixed and narrower when compared to details section.
This is how i’m creating the master part.
protected void createMasterPart(final IManagedForm managedForm, final Composite parent)
{
toolkit = managedForm.getToolkit();
Section section = toolkit.createSection(parent,
ExpandableComposite.EXPANDED | ExpandableComposite.TITLE_BAR );
section.setText("Sample Master Section");
Composite composite = toolkit.createComposite(section, SWT.NONE);
toolkit.paintBordersFor(composite);
section.setClient(composite);
composite.setLayout(new FormLayout());
Please let me know your suggestions
The master and the details sections are located in a SashForm. The point of a sash form is to allow the user to adjust the ratios allocated to the child forms. You can control the initial allocation of space, but you cannot make the allocation fixed. Not without re-writing a bunch of the master details form infrastructure that you are using.
To control the initial space allocation, find in your code where you extend from MasterDetailsBlock class. In that class, there is a protected member variable called “sashForm”. You will want to call setWeights() method on it. Here is a partial example of what you need.
There is no range of possible values for weights. Only their relation to each other matters. You can use percentages (like in the above example) or whatever other system makes sense to you. Note that you are not setting width of the child forms in pixels.