Author: DartPeng
Date: 2009-11-28 04:14:37 -0500 (Sat, 28 Nov 2009)
New Revision: 18900
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/actions/DeleteTaskNodeAction.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/SmooksProcessGraphicalEditor.java
Log:
JBIDE-5290
Fixed
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/actions/DeleteTaskNodeAction.java
===================================================================
---
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/actions/DeleteTaskNodeAction.java 2009-11-28
09:12:26 UTC (rev 18899)
+++
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/actions/DeleteTaskNodeAction.java 2009-11-28
09:14:37 UTC (rev 18900)
@@ -89,7 +89,13 @@
}
Command remove = null;
if (associatedElements.isEmpty()) {
- process.removeTask(currentTask);
+ Object parent = currentTask.getParent();
+ if (parent instanceof Process) {
+ ((ProcessType) parent).removeTask(currentTask);
+ }
+ if (parent instanceof TaskType) {
+ ((TaskType) parent).removeTask(currentTask);
+ }
} else {
associatedElements = getDeletedObjects(associatedElements);
CompoundCommand ccommand = new CompoundCommand();
@@ -100,12 +106,18 @@
// if (removeTaskCommand.canExecute()) {
// ccommand.append(removeTaskCommand);
// }
- process.removeTask(currentTask);
remove = RemoveCommand.create(this.provider.getEditingDomain(), listType,
SmooksPackage.Literals.SMOOKS_RESOURCE_LIST_TYPE__ABSTRACT_RESOURCE_CONFIG_GROUP,
associatedElements);
if (remove.canExecute()) {
ccommand.append(remove);
+ Object parent = currentTask.getParent();
+ if (parent instanceof Process) {
+ ((ProcessType) parent).removeTask(currentTask);
+ }
+ if (parent instanceof TaskType) {
+ ((TaskType) parent).removeTask(currentTask);
+ }
}
provider.getEditingDomain().getCommandStack().execute(ccommand);
}
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/SmooksProcessGraphicalEditor.java
===================================================================
---
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/SmooksProcessGraphicalEditor.java 2009-11-28
09:12:26 UTC (rev 18899)
+++
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/SmooksProcessGraphicalEditor.java 2009-11-28
09:14:37 UTC (rev 18900)
@@ -1120,11 +1120,19 @@
public void propertyChange(PropertyChangeEvent evt) {
String name = evt.getPropertyName();
+ Object newtask = evt.getNewValue();
if (ProcessType.PRO_ADD_CHILD.equals(name) ||
ProcessType.PRO_REMOVE_CHILD.equals(name)) {
if (getProcessGraphViewer() != null) {
getProcessGraphViewer().refresh();
getProcessGraphViewer().applyLayout();
}
}
+
+ if (ProcessType.PRO_ADD_CHILD.equals(name)) {
+ this.showTaskControl(newtask);
+ }
+ if (ProcessType.PRO_REMOVE_CHILD.equals(name)) {
+ this.showTaskControl(null);
+ }
}
}
Show replies by date