Search in sources :

Example 1 with NewPropertyDialog

use of net.sourceforge.pmd.eclipse.ui.dialogs.NewPropertyDialog in project pmd-eclipse-plugin by pmd.

the class FormArranger method addAddButton.

private void addAddButton() {
    Button button = new Button(parent, SWT.PUSH);
    button.setText("Add new...");
    button.addSelectionListener(new SelectionListener() {

        public void widgetDefaultSelected(SelectionEvent e) {
        }

        public void widgetSelected(SelectionEvent e) {
            NewPropertyDialog dialog = new NewPropertyDialog(parent.getShell(), editorFactoriesByValueType, propertySource, changeListener);
            if (dialog.open() == Window.OK) {
                PropertyDescriptor<?> desc = dialog.descriptor();
                propertySource.definePropertyDescriptor(desc);
                rearrangeFor(propertySource);
            }
        }
    });
}
Also used : PropertyDescriptor(net.sourceforge.pmd.properties.PropertyDescriptor) Button(org.eclipse.swt.widgets.Button) SelectionEvent(org.eclipse.swt.events.SelectionEvent) NewPropertyDialog(net.sourceforge.pmd.eclipse.ui.dialogs.NewPropertyDialog) SelectionListener(org.eclipse.swt.events.SelectionListener)

Aggregations

NewPropertyDialog (net.sourceforge.pmd.eclipse.ui.dialogs.NewPropertyDialog)1 PropertyDescriptor (net.sourceforge.pmd.properties.PropertyDescriptor)1 SelectionEvent (org.eclipse.swt.events.SelectionEvent)1 SelectionListener (org.eclipse.swt.events.SelectionListener)1 Button (org.eclipse.swt.widgets.Button)1