use of org.erlide.tracing.core.mvc.view.NodeColumn in project erlide_eclipse by erlang.
the class ControlPanelView method createNodesTable.
private void createNodesTable(final Composite parent) {
final int style = SWT.SINGLE | SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL | SWT.FULL_SELECTION | SWT.HIDE_SELECTION;
final GridData gridData = new GridData(SWT.FILL, SWT.FILL, true, true);
gridData.grabExcessVerticalSpace = true;
nodesTableViewer = new TableViewer(parent, style);
nodesTableViewer.setUseHashlookup(true);
// table
final Table table = nodesTableViewer.getTable();
table.setLayoutData(gridData);
table.setHeaderVisible(true);
table.setLinesVisible(true);
// columns
final String[] columnProperties = new String[TracePatternColumn.values().length];
for (final NodeColumn column : NodeColumn.values()) {
final TableColumn tableColumn = new TableColumn(table, SWT.LEFT, column.ordinal());
tableColumn.setResizable(true);
tableColumn.setMoveable(false);
tableColumn.setWidth(column.getWidth());
tableColumn.setText(column.getName());
columnProperties[column.ordinal()] = column.name();
}
nodesTableViewer.setColumnProperties(columnProperties);
// providers
nodesTableViewer.setLabelProvider(new NodeLabelProvider());
nodesTableViewer.setContentProvider(new NodeContentProvider());
// input
nodesTableViewer.setInput(TraceBackend.getInstance());
// editors
final CellEditor[] editors = new CellEditor[TracePatternColumn.values().length];
editors[NodeColumn.ENABLED.ordinal()] = new CheckboxCellEditor(table);
editors[NodeColumn.NODE_NAME.ordinal()] = new TextCellEditor(table);
editors[NodeColumn.COOKIE.ordinal()] = new TextCellEditor(table);
nodesTableViewer.setCellEditors(editors);
nodesTableViewer.setCellModifier(new NodeCellModifier(nodesTableViewer));
}
Aggregations