use of org.eclipse.jface.viewers.ArrayContentProvider in project yamcs-studio by yamcs.
the class PropertiesSelectDialog method createPropertiesViewer.
private ListViewer createPropertiesViewer(Composite parent) {
final ListViewer viewer = new ListViewer(parent, SWT.V_SCROLL | SWT.H_SCROLL | SWT.BORDER | SWT.MULTI);
viewer.setContentProvider(new ArrayContentProvider());
viewer.setLabelProvider(new PropertyListLableProvider());
viewer.getList().setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
viewer.addSelectionChangedListener(new ISelectionChangedListener() {
@SuppressWarnings("unchecked")
@Override
public void selectionChanged(SelectionChangedEvent event) {
selectedProps = ((StructuredSelection) viewer.getSelection()).toList();
}
});
viewer.addDoubleClickListener(new IDoubleClickListener() {
@Override
public void doubleClick(DoubleClickEvent event) {
okPressed();
}
});
return viewer;
}
use of org.eclipse.jface.viewers.ArrayContentProvider in project yamcs-studio by yamcs.
the class WidgetsSelectDialog method createWidgetsViewer.
private TableViewer createWidgetsViewer(Composite parent) {
final TableViewer viewer = new TableViewer(parent, SWT.V_SCROLL | SWT.H_SCROLL | SWT.BORDER | SWT.SINGLE);
viewer.setContentProvider(new ArrayContentProvider());
viewer.setLabelProvider(new WidgetsListLableProvider());
viewer.getTable().setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
viewer.addSelectionChangedListener(new ISelectionChangedListener() {
public void selectionChanged(SelectionChangedEvent event) {
selectedWidget = (String) ((StructuredSelection) viewer.getSelection()).getFirstElement();
}
});
viewer.addDoubleClickListener(new IDoubleClickListener() {
public void doubleClick(DoubleClickEvent event) {
okPressed();
}
});
return viewer;
}
Aggregations