use of org.netxms.ui.eclipse.serverconfig.views.helpers.MappingTableEntryLabelProvider in project netxms by netxms.
the class MappingTableEditor method createPartControl.
/* (non-Javadoc)
* @see org.eclipse.ui.part.WorkbenchPart#createPartControl(org.eclipse.swt.widgets.Composite)
*/
@Override
public void createPartControl(Composite parent) {
final int[] widths = { 200, 200, 400 };
final String[] names = { Messages.get().MappingTableEditor_ColKey, Messages.get().MappingTableEditor_ColValue, Messages.get().MappingTableEditor_ColComments };
viewer = new SortableTableViewer(parent, names, widths, COLUMN_KEY, SWT.UP, SWT.FULL_SELECTION | SWT.MULTI);
viewer.setContentProvider(new ArrayContentProvider());
viewer.setLabelProvider(new MappingTableEntryLabelProvider());
viewer.setComparator(new MappingTableEntryComparator());
// $NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
viewer.setColumnProperties(new String[] { "key", "value", "comments" });
CellEditor[] editors = new CellEditor[] { new TextCellEditor(viewer.getTable()), new TextCellEditor(viewer.getTable()), new TextCellEditor(viewer.getTable()) };
viewer.setCellEditors(editors);
viewer.setCellModifier(new CellModifier());
viewer.addSelectionChangedListener(new ISelectionChangedListener() {
@Override
public void selectionChanged(SelectionChangedEvent event) {
IStructuredSelection selection = (IStructuredSelection) viewer.getSelection();
actionDelete.setEnabled(selection.size() > 0);
}
});
createActions();
contributeToActionBars();
createPopupMenu();
activateContext();
refresh();
}
Aggregations