use of org.erlide.tracing.core.mvc.view.MatchSpecCellEditor in project erlide_eclipse by erlang.
the class ControlPanelView method createFunctionsTable.
private void createFunctionsTable(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;
functionsTableViewer = new TableViewer(parent, style);
functionsTableViewer.setUseHashlookup(true);
// table
final Table table = functionsTableViewer.getTable();
table.setLayoutData(gridData);
table.setHeaderVisible(true);
table.setLinesVisible(true);
// columns
final String[] columnProperties = new String[TracePatternColumn.values().length];
for (final TracePatternColumn column : TracePatternColumn.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();
}
functionsTableViewer.setColumnProperties(columnProperties);
// providers
functionsTableViewer.setLabelProvider(new TracePatternLabelProvider());
functionsTableViewer.setContentProvider(new TracePatternContentProvider());
// input
functionsTableViewer.setInput(TraceBackend.getInstance());
// editors
final CellEditor[] editors = new CellEditor[TracePatternColumn.values().length];
editors[TracePatternColumn.ENABLED.ordinal()] = new CheckboxCellEditor(table);
editors[TracePatternColumn.LOCAL.ordinal()] = new CheckboxCellEditor(table);
editors[TracePatternColumn.MODULE_NAME.ordinal()] = new TextCellEditor(table);
editors[TracePatternColumn.FUNCTION_NAME.ordinal()] = new TextCellEditor(table);
editors[TracePatternColumn.ARITY.ordinal()] = new TextCellEditor(table);
editors[TracePatternColumn.MATCH_SPEC.ordinal()] = new MatchSpecCellEditor(table);
functionsTableViewer.setCellEditors(editors);
functionsTableViewer.setCellModifier(new TracePatternCellModifier(functionsTableViewer));
}
Aggregations