AntAction antAction = getContext().getActions().getAction(cmdStr);
if (antAction == null) {
return;
}
ACSElement e = vals[vals.length - 1];
// Should we prompt the user use the element type?
if (antAction.getName().equals(name)) {
// Display the dialog box.
ACSIntrospectedElement dtde = (ACSIntrospectedElement) e;
NewElementDlg dlg = new NewElementDlg(
getContext().getParentFrame(), true);
dlg.setLists(
dtde.getPossibleChildren(ACSIntrospectedElement.TASK_ELEMENTS),
dtde.getPossibleChildren(ACSIntrospectedElement.TYPE_ELEMENTS) );
dlg.pack();
WindowUtils.centerWindow(dlg);
dlg.setTitle("Select the new element type");
dlg.setVisible(true);
// Get the element type
if (dlg.getCancel()) {
name = "";
} else {
name = dlg.getElementName();
}
}
if (name.length() > 0) {
// Create the new element
ACSElement retval =
ACSFactory.getInstance().createElement(e, name);
getContext().getEventBus().postEvent(
new NewBaseElementEvent(getContext(), retval));
} else {
// Request a refresh so the popup menu is removed