IStructuredSelection selection = (IStructuredSelection) configsViewer
.getSelection();
if (selection.getFirstElement() != null) {
if (selection.getFirstElement() instanceof IActionElement) {
TitleAreaDialog dialog = null;
IActionElement actionElement = (IActionElement) selection.getFirstElement();
if (actionElement instanceof Action) {
dialog = new ActionPropertiesDialog(parentShell, parentElement,
(Action) selection.getFirstElement());
}
else if (actionElement instanceof BeanAction) {
dialog = new BeanActionPropertiesDialog(parentShell, parentElement,
(BeanAction) selection.getFirstElement());
}
else if (actionElement instanceof EvaluateAction) {
dialog = new EvaluateActionPropertiesDialog(parentShell, parentElement,
(EvaluateAction) selection.getFirstElement());
}
else if (actionElement instanceof Set) {
dialog = new SetActionPropertiesDialog(parentShell, parentElement,
(Set) selection.getFirstElement());
}
if (Dialog.OK == dialog.open()) {
configsViewer.refresh();
}
}
}
}
});
deleteButton = new Button(buttonArea, SWT.PUSH);
deleteButton.setText("Delete");
data1 = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
data1.widthHint = 40;
deleteButton.setLayoutData(data1);
deleteButton.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
IStructuredSelection selection = (IStructuredSelection) configsViewer
.getSelection();
if (selection.getFirstElement() != null
&& selection.getFirstElement() instanceof IActionElement) {
IActionElement actionElement = (IActionElement) selection.getFirstElement();
actions.remove(actionElement);
configsViewer.refresh(true);
}
}
});