annotationsTable.setSorter(new ViewerSorter());
annotationsTable.setInput(matchingAnnotations);
final Sash sash = new Sash(annotationsComposite, SWT.HORIZONTAL);
final PropertySheetPage propertySheet = new PropertySheetPage();
propertySheet.createControl(annotationsComposite);
propertySheet.setPropertySourceProvider(new IPropertySourceProvider() {
public IPropertySource getPropertySource(Object object) {
if (object instanceof Annotation) {
IPropertySource annotationPropertySource = new AnnotationPropertySource(((Annotation) object));
return annotationPropertySource;
}
return null;
}
});
annotationsTable.addSelectionChangedListener(new ISelectionChangedListener() {
public void selectionChanged(SelectionChangedEvent event) {
propertySheet.selectionChanged(null, event.getSelection());
}
});
final FormLayout form = new FormLayout();
annotationsComposite.setLayout(form);
FormData tableData = new FormData();
tableData.top = new FormAttachment(0, 0);
tableData.bottom = new FormAttachment(sash, 2);
tableData.left = new FormAttachment(0, 0);
tableData.right = new FormAttachment(100, 0);
annotationsTable.getControl().setLayoutData(tableData);
FormData propertiesData = new FormData();
propertiesData.top = new FormAttachment(sash, 2);
propertiesData.left = new FormAttachment(0, 0);
propertiesData.right = new FormAttachment(100, 0);
propertiesData.bottom = new FormAttachment(100, 0);
propertySheet.getControl().setLayoutData(propertiesData);
final FormData sashData = new FormData();
sashData.top = new FormAttachment(60, 0);
sashData.left = new FormAttachment(0, 0);
sashData.right = new FormAttachment(100, 0);