data1.widthHint = 40;
addButton.setLayoutData(data1);
addButton.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
IArgument property = new Argument();
property.createNew(actionClone);
MethodArgumentEditorDialog dialog = new MethodArgumentEditorDialog(
getParentShell(), property);
if (dialog.open() == Dialog.OK) {
methodArguments.add(property);
configsViewer.refresh(true);
}
}
});
editButton = new Button(buttonArea, SWT.PUSH);
editButton.setText("Edit");
data1 = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
data1.widthHint = 40;
editButton.setLayoutData(data1);
editButton.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
IStructuredSelection selection = (IStructuredSelection) configsViewer
.getSelection();
if (selection.getFirstElement() != null) {
if (selection.getFirstElement() instanceof IArgument) {
IArgument property = (IArgument) selection
.getFirstElement();
MethodArgumentEditorDialog dialog = new MethodArgumentEditorDialog(
getParentShell(), property);
if (dialog.open() == Dialog.OK) {
configsViewer.refresh(true);
}
}
}
}
});
removeButton = new Button(buttonArea, SWT.PUSH);
removeButton.setText("Delete");
GridData data2 = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
data1.widthHint = 40;
removeButton.setLayoutData(data2);
removeButton.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
IStructuredSelection selection = (IStructuredSelection) configsViewer
.getSelection();
if (selection.getFirstElement() != null) {
if (selection.getFirstElement() instanceof IArgument) {
IArgument property = (IArgument) selection
.getFirstElement();
methodArguments.remove(property);
configsViewer.refresh(true);
}
}