use of org.netxms.ui.eclipse.widgets.helpers.AttributeLabelProvider in project netxms by netxms.
the class PersistentStorageView method createPartControl.
/* (non-Javadoc)
* @see org.eclipse.ui.part.WorkbenchPart#createPartControl(org.eclipse.swt.widgets.Composite)
*/
@Override
public void createPartControl(Composite parent) {
// GridLayout layout = new GridLayout();
// layout.verticalSpacing = WidgetHelper.INNER_SPACING;
// layout.marginWidth = 0;
// layout.marginHeight = 0;
// parent.setLayout(layout);
final String[] setColumnNames = { "Key", "Value" };
final int[] setColumnWidths = { 150, 200 };
viewerSetValue = new SortableTableViewer(parent, setColumnNames, setColumnWidths, 0, SWT.UP, SWT.BORDER | SWT.MULTI | SWT.FULL_SELECTION);
viewerSetValue.setContentProvider(new ArrayContentProvider());
viewerSetValue.setLabelProvider(new AttributeLabelProvider());
viewerSetValue.setComparator(new ObjectLabelComparator((ILabelProvider) viewerSetValue.getLabelProvider()));
viewerSetValue.addSelectionChangedListener(new ISelectionChangedListener() {
@Override
public void selectionChanged(SelectionChangedEvent event) {
int size = ((IStructuredSelection) viewerSetValue.getSelection()).size();
actionEdit.setEnabled(size == 1);
actionDelete.setEnabled(size > 0);
}
});
createActions();
contributeToActionBars();
createPopupMenu();
refresh();
}
Aggregations