GridData gd;
// Create Controls
final Composite body = form.getBody();
MDSashForm sashForm = new MDSashForm(body, SWT.HORIZONTAL, managedForm);
sashForm.setSashWidth(6);
tk.adapt(sashForm);
final Composite left = tk.createComposite(sashForm);
gd = new GridData(SWT.FILL, SWT.FILL, true, true);
left.setLayoutData(gd);
gl = new GridLayout(1, true);
left.setLayout(gl);
final Composite right = tk.createComposite(sashForm);
gd = new GridData(SWT.FILL, SWT.FILL, true, true);
right.setLayoutData(gd);
gl = new GridLayout(1, true);
right.setLayout(gl);
// First column
RepositorySelectionPart reposPart = new RepositorySelectionPart(left, tk, Section.TITLE_BAR | Section.TWISTIE | Section.DESCRIPTION);
managedForm.addPart(reposPart);
gd = new GridData(SWT.FILL, SWT.FILL, true, true);
gd.widthHint = 50;
gd.heightHint = 50;
reposPart.getSection().setLayoutData(PageLayoutUtils.createCollapsed());
AvailableBundlesPart availableBundlesPart = new AvailableBundlesPart(left, tk, Section.TITLE_BAR | Section.EXPANDED | Section.DESCRIPTION);
managedForm.addPart(availableBundlesPart);
gd = new GridData(SWT.FILL, SWT.FILL, true, true);
gd.widthHint = 50;
gd.heightHint = 50;
availableBundlesPart.getSection().setLayoutData(PageLayoutUtils.createExpanded());
RunFrameworkPart runFwkPart = new RunFrameworkPart(left, tk, Section.TITLE_BAR | Section.TWISTIE | Section.EXPANDED);
managedForm.addPart(runFwkPart);
gd = new GridData(SWT.FILL, SWT.FILL, true, false);
runFwkPart.getSection().setLayoutData(gd);
RunPropertiesPart runPropertiesPart = new RunPropertiesPart(left, tk, Section.TITLE_BAR | Section.TWISTIE | Section.DESCRIPTION);
managedForm.addPart(runPropertiesPart);
gd = new GridData(SWT.FILL, SWT.FILL, true, false);
runPropertiesPart.getSection().setLayoutData(gd);
RunProgramArgsPart programArgsPart = new RunProgramArgsPart(left, tk, Section.TITLE_BAR | Section.TWISTIE);
managedForm.addPart(programArgsPart);
gd = new GridData(SWT.FILL, SWT.FILL, true, false);
programArgsPart.getSection().setLayoutData(gd);
RunVMArgsPart vmArgsPart = new RunVMArgsPart(left, tk, Section.TITLE_BAR | Section.TWISTIE);
managedForm.addPart(vmArgsPart);
gd = new GridData(SWT.FILL, SWT.FILL, true, false);
vmArgsPart.getSection().setLayoutData(gd);
// SECOND COLUMN
if (supportsResolve) {
RunRequirementsPart requirementsPart = new RunRequirementsPart(right, tk, Section.TITLE_BAR | Section.TWISTIE | Section.EXPANDED | Section.DESCRIPTION);
managedForm.addPart(requirementsPart);
requirementsPart.getSection().setLayoutData(PageLayoutUtils.createExpanded());
requirementsPart.getSection().addExpansionListener(new ResizeExpansionAdapter(requirementsPart.getSection()));
RunBundlesPart runBundlesPart = new RunBundlesPart(right, tk, Section.TITLE_BAR | Section.TWISTIE);
managedForm.addPart(runBundlesPart);
runBundlesPart.getSection().setLayoutData(PageLayoutUtils.createCollapsed());
runBundlesPart.getSection().addExpansionListener(new ResizeExpansionAdapter(runBundlesPart.getSection()));
} else {
RunBundlesPart runBundlesPart = new RunBundlesPart(right, tk, Section.TITLE_BAR | Section.TWISTIE | Section.EXPANDED);
managedForm.addPart(runBundlesPart);
runBundlesPart.getSection().setLayoutData(PageLayoutUtils.createExpanded());
runBundlesPart.getSection().addExpansionListener(new ResizeExpansionAdapter(runBundlesPart.getSection()));
}
sashForm.setWeights(new int[] {
1, 1
});
sashForm.hookResizeListener();
body.setLayout(new FillLayout());
}