use of ch.acanda.eclipse.pmd.ui.util.SelectionAdapter in project eclipse-pmd by acanda.
the class AddRuleSetConfigurationWizardPage method createControl.
@Override
public void createControl(final Composite parent) {
final Composite container = new Composite(parent, SWT.NULL);
setControl(container);
container.setLayout(new GridLayout(3, false));
final Label lblLocation = new Label(container, SWT.NONE);
lblLocation.setText("Location:");
location = new Text(container, SWT.BORDER);
location.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
SWTBotID.set(location, SWTBotID.LOCATION);
browse = new Button(container, SWT.NONE);
browse.setText("Browse...");
SWTBotID.set(browse, SWTBotID.BROWSE);
browse.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(final SelectionEvent e) {
controller.browse(((Control) e.widget).getShell());
}
});
final Label lblName = new Label(container, SWT.NONE);
lblName.setText("Name:");
name = new Text(container, SWT.BORDER);
name.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
SWTBotID.set(name, SWTBotID.NAME);
// This button is only here to make this row the same height as the previous row.
// Without this button the distance between the text of this row and the text of
// the previous row is much larger than the distance between the text of this row
// and the table of the next row.
final Button button = new Button(container, SWT.NONE);
button.setEnabled(false);
button.setVisible(false);
final Label lblRules = new Label(container, SWT.NONE);
final GridData lblRulesGridData = new GridData(SWT.LEFT, SWT.TOP, false, false);
lblRulesGridData.verticalIndent = 3;
lblRules.setLayoutData(lblRulesGridData);
lblRules.setText("Rules:");
final Composite tableComposite = new Composite(container, SWT.NONE);
tableComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
final TableColumnLayout tableCompositeTableColumnLayout = new TableColumnLayout();
tableComposite.setLayout(tableCompositeTableColumnLayout);
tableViewer = new TableViewer(tableComposite, SWT.BORDER | SWT.FULL_SELECTION | SWT.HIDE_SELECTION);
final Table table = tableViewer.getTable();
table.setLinesVisible(true);
SWTBotID.set(table, SWTBotID.RULES);
final TableViewerColumn tableViewerColumn = new TableViewerColumn(tableViewer, SWT.NONE);
final TableColumn tblclmnName = tableViewerColumn.getColumn();
tableCompositeTableColumnLayout.setColumnData(tblclmnName, new ColumnWeightData(1, 200, false));
tblclmnName.setText("Name");
new Label(container, SWT.NONE);
new Label(container, SWT.NONE);
new Label(container, SWT.NONE);
new Label(container, SWT.NONE);
initDataBindings();
}
use of ch.acanda.eclipse.pmd.ui.util.SelectionAdapter in project eclipse-pmd by acanda.
the class PMDPropertyPage method createContents.
@Override
protected Control createContents(final Composite parent) {
final Composite composite = new Composite(parent, SWT.NULL);
final GridLayout layout = new GridLayout(3, false);
layout.marginWidth = 0;
composite.setLayout(layout);
composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
enablePMDCheckbox = new Button(composite, SWT.CHECK);
enablePMDCheckbox.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false, 3, 1));
enablePMDCheckbox.setText("Enable PMD for this project");
SWTBotID.set(enablePMDCheckbox, SWTBotID.ENABLE_PMD);
final Label separator = new Label(composite, SWT.SEPARATOR | SWT.HORIZONTAL);
separator.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 3, 1));
final Label lblSelectRulesSets = new Label(composite, SWT.NONE);
lblSelectRulesSets.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false, 3, 1));
lblSelectRulesSets.setText("Select rules sets");
final RuleSetConfigurationTable ruleSetConfigurationTable = new RuleSetConfigurationTable(composite, controller.getModel());
ruleSetConfigurationTable.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 2, 2));
addRuleSet = new Button(composite, SWT.NONE);
SWTBotID.set(addRuleSet, SWTBotID.ADD);
setButtonLayoutData(addRuleSet);
addRuleSet.setText("Add...");
addRuleSet.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(final SelectionEvent e) {
controller.addRuleSetConfiguration(((Control) e.widget).getShell());
}
});
initDataBindings();
return composite;
}
Aggregations