Author: koen.aers(a)jboss.com
Date: 2008-07-24 08:52:32 -0400 (Thu, 24 Jul 2008)
New Revision: 9263
Modified:
trunk/flow/plugins/org.jboss.tools.flow.common.graph/src/main/java/org/jboss/tools/flow/editor/command/AddElementCommand.java
trunk/flow/plugins/org.jboss.tools.flow.common.graph/src/main/java/org/jboss/tools/flow/editor/core/AbstractRootWrapper.java
trunk/flow/plugins/org.jboss.tools.flow.common.graph/src/main/java/org/jboss/tools/flow/editor/core/ContainerWrapper.java
Log:
add support to overrule node add
Modified:
trunk/flow/plugins/org.jboss.tools.flow.common.graph/src/main/java/org/jboss/tools/flow/editor/command/AddElementCommand.java
===================================================================
---
trunk/flow/plugins/org.jboss.tools.flow.common.graph/src/main/java/org/jboss/tools/flow/editor/command/AddElementCommand.java 2008-07-24
09:14:15 UTC (rev 9262)
+++
trunk/flow/plugins/org.jboss.tools.flow.common.graph/src/main/java/org/jboss/tools/flow/editor/command/AddElementCommand.java 2008-07-24
12:52:32 UTC (rev 9263)
@@ -55,5 +55,9 @@
parent.removeElement(child);
child.setParent(null);
}
+
+ public boolean canExecute() {
+ return parent.acceptsElement(child);
+ }
}
Modified:
trunk/flow/plugins/org.jboss.tools.flow.common.graph/src/main/java/org/jboss/tools/flow/editor/core/AbstractRootWrapper.java
===================================================================
---
trunk/flow/plugins/org.jboss.tools.flow.common.graph/src/main/java/org/jboss/tools/flow/editor/core/AbstractRootWrapper.java 2008-07-24
09:14:15 UTC (rev 9262)
+++
trunk/flow/plugins/org.jboss.tools.flow.common.graph/src/main/java/org/jboss/tools/flow/editor/core/AbstractRootWrapper.java 2008-07-24
12:52:32 UTC (rev 9263)
@@ -59,6 +59,7 @@
}
public void addElement(NodeWrapper element) {
+ if (!acceptsElement(element)) return;
internalAddElement(element);
localAddElement(element);
notifyListeners(CHANGE_ELEMENTS);
@@ -68,6 +69,10 @@
elements.put(element.getId(), element);
}
+ public boolean acceptsElement(NodeWrapper element) {
+ return true;
+ }
+
protected abstract void internalAddElement(NodeWrapper element);
public void removeElement(NodeWrapper element) {
Modified:
trunk/flow/plugins/org.jboss.tools.flow.common.graph/src/main/java/org/jboss/tools/flow/editor/core/ContainerWrapper.java
===================================================================
---
trunk/flow/plugins/org.jboss.tools.flow.common.graph/src/main/java/org/jboss/tools/flow/editor/core/ContainerWrapper.java 2008-07-24
09:14:15 UTC (rev 9262)
+++
trunk/flow/plugins/org.jboss.tools.flow.common.graph/src/main/java/org/jboss/tools/flow/editor/core/ContainerWrapper.java 2008-07-24
12:52:32 UTC (rev 9263)
@@ -29,5 +29,7 @@
List<NodeWrapper> getElements();
AbstractRootWrapper getProcessWrapper();
+
+ boolean acceptsElement(NodeWrapper element);
}
Show replies by date