addButton.setText("Add");
GridData data1 = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
addButton.setLayoutData(data1);
addButton.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
ExceptionHandler action = new ExceptionHandler();
action.createNew(parentElement);
if (DialogUtils.openPropertiesDialog(parentElement, action,
true) == Dialog.OK) {
exceptionHandler.add(action);
configsViewer.refresh();
}
}
});
editButton = new Button(buttonArea, SWT.PUSH);
editButton.setText("Edit");
data1 = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
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 ExceptionHandler) {
if (DialogUtils.openPropertiesDialog(parentElement,
(ExceptionHandler) selection.getFirstElement(),
true) == Dialog.OK) {
configsViewer.refresh();
}
}
}
}
});
deleteButton = new Button(buttonArea, SWT.PUSH);
deleteButton.setText("Delete");
data1 = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
deleteButton.setLayoutData(data1);
deleteButton.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
IStructuredSelection selection = (IStructuredSelection) configsViewer
.getSelection();
if (selection.getFirstElement() != null
&& selection.getFirstElement() instanceof ExceptionHandler) {
ExceptionHandler actionElement = (ExceptionHandler) selection
.getFirstElement();
exceptionHandler.remove(actionElement);
configsViewer.refresh(true);
}
}