root.setLayout(new FormLayout());
Label label = new Label(root, SWT.LEFT);
label.setText(Messages.ConnectionErrorPage_message);
ListViewer listViewer = new ListViewer(root);
listViewer.setLabelProvider(new LabelProvider(){
@Override
public String getText( Object element ) {
IService service = (IService) element;
return service.getIdentifier().toString();
}
});
listViewer.setContentProvider(new ArrayContentProvider());
listViewer.setInput(errors.keySet().toArray());
final Text text = new Text(root, SWT.BORDER | SWT.MULTI | SWT.V_SCROLL
| SWT.SCROLL_LINE);
FormData layoutData = new FormData();
layoutData.top = new FormAttachment(0);
layoutData.left = new FormAttachment(0);
label.setLayoutData(layoutData);
layoutData = new FormData();
layoutData.top = new FormAttachment(label, 2, SWT.BOTTOM);
layoutData.left = new FormAttachment(0);
layoutData.right = new FormAttachment(100);
layoutData.bottom = new FormAttachment(50);
listViewer.getList().setLayoutData(layoutData);
layoutData = new FormData();
layoutData.top = new FormAttachment(listViewer.getList(), 2, SWT.BOTTOM);
layoutData.left = new FormAttachment(0);
layoutData.right = new FormAttachment(100);
layoutData.bottom = new FormAttachment(100);
text.setLayoutData(layoutData);
listViewer.addSelectionChangedListener(new ISelectionChangedListener(){
public void selectionChanged( SelectionChangedEvent event ) {
IStructuredSelection selection = (IStructuredSelection) event.getSelection();
if (selection == null || selection.isEmpty())
return;