Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUwe Stieber2012-02-12 08:56:10 +0000
committerUwe Stieber2012-02-12 08:56:10 +0000
commitfa2c1e67395a966938100d3f3d55274629a14e83 (patch)
treed259960f424ce2b1c40eadb359f5f5d90b0b8a17 /target_explorer/plugins/org.eclipse.tcf.te.runtime.model
parent0d51474334c863a0731c54715ee73bfaaf8cf5cd (diff)
downloadorg.eclipse.tcf-fa2c1e67395a966938100d3f3d55274629a14e83.tar.gz
org.eclipse.tcf-fa2c1e67395a966938100d3f3d55274629a14e83.tar.xz
org.eclipse.tcf-fa2c1e67395a966938100d3f3d55274629a14e83.zip
Target Explorer: Peer model node to inherit from ContainerModelNode
Diffstat (limited to 'target_explorer/plugins/org.eclipse.tcf.te.runtime.model')
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.runtime.model/src/org/eclipse/tcf/te/runtime/model/ModelNode.java6
1 files changed, 5 insertions, 1 deletions
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.runtime.model/src/org/eclipse/tcf/te/runtime/model/ModelNode.java b/target_explorer/plugins/org.eclipse.tcf.te.runtime.model/src/org/eclipse/tcf/te/runtime/model/ModelNode.java
index 35ea1dfbd..deb6ca238 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.runtime.model/src/org/eclipse/tcf/te/runtime/model/ModelNode.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.runtime.model/src/org/eclipse/tcf/te/runtime/model/ModelNode.java
@@ -40,6 +40,10 @@ public class ModelNode extends PropertiesContainer implements IModelNode, IModel
// Flag to control if property change events are suppressed
// until the model node is added to a parent container model node.
protected boolean suppressEventsOnNullParent = true;
+ // Flag to control if the node parent can change after set
+ // to a non-null value. Default is that the node parent cannot
+ // change after set to a non-null value.
+ protected boolean allowSetParentOnNonNullParent = false;
/**
* Constructor.
@@ -79,7 +83,7 @@ public class ModelNode extends PropertiesContainer implements IModelNode, IModel
@Override
public final void setParent(IContainerModelNode parent) {
Assert.isTrue(checkThreadAccess(), "Illegal Thread Access"); //$NON-NLS-1$
- if (this.parent != null) {
+ if (this.parent != null && !allowSetParentOnNonNullParent) {
throw new IllegalStateException("Model node already associated with a parent container model node!"); //$NON-NLS-1$
}
this.parent = parent;

Back to the top