use of net.sf.eclipsecs.ui.util.table.EnhancedCheckBoxTableViewer in project eclipse-cs by checkstyle.
the class CheckConfigurationConfigureDialog method createTableViewer.
private Control createTableViewer(Composite parent) {
mConfiguredModulesGroup = new Group(parent, SWT.NULL);
mConfiguredModulesGroup.setLayout(new GridLayout());
// $NON-NLS-1$
mConfiguredModulesGroup.setText("\0");
Table table = new Table(mConfiguredModulesGroup, SWT.CHECK | SWT.BORDER | SWT.MULTI | SWT.FULL_SELECTION);
table.setLayoutData(new GridData(GridData.FILL_BOTH));
table.setHeaderVisible(true);
table.setLinesVisible(true);
TableLayout tableLayout = new TableLayout();
table.setLayout(tableLayout);
TableColumn column1 = new TableColumn(table, SWT.NULL);
column1.setAlignment(SWT.CENTER);
column1.setText(Messages.CheckConfigurationConfigureDialog_colEnabled);
tableLayout.addColumnData(new ColumnWeightData(15));
TableColumn column2 = new TableColumn(table, SWT.NULL);
column2.setText(Messages.CheckConfigurationConfigureDialog_colModule);
tableLayout.addColumnData(new ColumnWeightData(30));
TableColumn column3 = new TableColumn(table, SWT.NULL);
column3.setText(Messages.CheckConfigurationConfigureDialog_colSeverity);
tableLayout.addColumnData(new ColumnWeightData(20));
TableColumn column4 = new TableColumn(table, SWT.NULL);
column4.setText(Messages.CheckConfigurationConfigureDialog_colComment);
tableLayout.addColumnData(new ColumnWeightData(35));
mTableViewer = new EnhancedCheckBoxTableViewer(table);
ModuleLabelProvider multiProvider = new ModuleLabelProvider();
mTableViewer.setLabelProvider(multiProvider);
mTableViewer.setTableComparableProvider(multiProvider);
mTableViewer.setTableSettingsProvider(multiProvider);
mTableViewer.setContentProvider(new ArrayContentProvider());
mTableViewer.addFilter(mGroupFilter);
mTableViewer.installEnhancements();
mTableViewer.addDoubleClickListener(mController);
mTableViewer.addSelectionChangedListener(mController);
mTableViewer.addCheckStateListener(mController);
mTableViewer.getTable().addKeyListener(mController);
Composite buttons = new Composite(mConfiguredModulesGroup, SWT.NULL);
GridLayout layout = new GridLayout(2, true);
layout.marginHeight = 0;
layout.marginWidth = 0;
buttons.setLayout(layout);
buttons.setLayoutData(new GridData());
mRemoveButton = new Button(buttons, SWT.PUSH);
mRemoveButton.setText((Messages.CheckConfigurationConfigureDialog_btnRemove));
mRemoveButton.setLayoutData(new GridData());
mRemoveButton.addSelectionListener(mController);
mEditButton = new Button(buttons, SWT.PUSH);
mEditButton.setText((Messages.CheckConfigurationConfigureDialog_btnOpen));
mEditButton.setLayoutData(new GridData());
mEditButton.addSelectionListener(mController);
return mConfiguredModulesGroup;
}
Aggregations