Label lblRequired = new Label(cmpRequired, SWT.NONE);
lblRequired.setText("Required Resources");
ToolBar requiredToolbar = new ToolBar(cmpRequired, SWT.FLAT | SWT.HORIZONTAL);
requiredToolbar.setLayoutData(new GridData(SWT.RIGHT, SWT.FILL, true, false));
requiredMaximiser = new SashFormPanelMaximiser(sashForm);
requiredMaximiser.createToolItem(cmpRequired, requiredToolbar);
Table tblRequired = new Table(cmpRequired, SWT.BORDER | SWT.FULL_SELECTION | SWT.H_SCROLL);
GridData gd_tblRequired = new GridData(SWT.FILL, SWT.FILL, true, true, 2, 1);
gd_tblRequired.minimumHeight = 50;
gd_tblRequired.heightHint = 100;
tblRequired.setLayoutData(gd_tblRequired);
requiredViewer = new TableViewer(tblRequired);
requiredViewer.setContentProvider(ArrayContentProvider.getInstance());
requiredViewer.setLabelProvider(new ResourceLabelProvider());
requiredViewer.setSorter(new BundleSorter());
requiredViewer.addSelectionChangedListener(new ISelectionChangedListener() {
public void selectionChanged(SelectionChangedEvent event) {
IStructuredSelection sel = (IStructuredSelection) event.getSelection();
Resource resource = (Resource) sel.getFirstElement();
reasonsContentProvider.setOptional(false);
reasonsContentProvider.setResolution(result.getResourceWirings());
reasonsViewer.setInput(resource);
reasonsViewer.expandToLevel(2);
}
});
Composite cmpOptional = new Composite(sashForm, SWT.NONE);
cmpOptional.setLayout(new GridLayout(2, false));
Label lblOptional = new Label(cmpOptional, SWT.NONE);
lblOptional.setText("Optional Resources");
lblOptional.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false));
ToolBar optionalToolbar = new ToolBar(cmpOptional, SWT.FLAT | SWT.HORIZONTAL);
optionalToolbar.setLayoutData(new GridData(SWT.RIGHT, SWT.FILL, true, false));
optionalMaximiser = new SashFormPanelMaximiser(sashForm);
optionalMaximiser.createToolItem(cmpOptional, optionalToolbar);
Table tblOptional = new Table(cmpOptional, SWT.BORDER | SWT.CHECK | SWT.FULL_SELECTION | SWT.H_SCROLL);
tblOptional.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 2, 1));