Class TagStructurePanel.StructureNode
- java.lang.Object
-
- com.inductiveautomation.ignition.designer.tags.editing.dialog.TagStructurePanel.StructureNode
-
- All Implemented Interfaces:
InfoNode
,javax.swing.tree.TreeNode
- Enclosing class:
- TagStructurePanel
public class TagStructurePanel.StructureNode extends java.lang.Object implements javax.swing.tree.TreeNode, InfoNode
-
-
Constructor Summary
Constructors Constructor Description StructureNode(TagStructurePanel.StructureNode parent, NodeBrowseInfo info, boolean isNew, boolean isValid)
StructureNode(TagStructurePanel.StructureNode parent, TagConfiguration newTag, boolean isValid)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addChild(TagStructurePanel.StructureNode node)
java.util.Enumeration
children()
void
clearChildren()
void
delete()
void
delete(boolean isMove)
void
forceSetCachedConfigModel(TagConfigurationModel model)
Sets the cached model even if already present.boolean
getAllowsChildren()
TagConfigurationModel
getCachedConfigModel()
The config model is null until loaded from the gateway, which will happen when we go to edit.TagStructurePanel.StructureNode
getChild(java.lang.String name)
Returns the child for the given name.javax.swing.tree.TreeNode
getChildAt(int childIndex)
int
getChildCount()
java.util.List<TagStructurePanel.StructureNode>
getComplexNodesInHierarchy()
Returns all of the complex tags (udt def or instance) from the root to this point.protected TagPath
getCurrentParentPath()
protected TagPath
getCurrentPath()
TagConfiguration
getEdit()
Returns the edit that can be sent to the gateway.protected TagPath
getEditPath()
int
getIndex(javax.swing.tree.TreeNode node)
NodeBrowseInfo
getInfo()
java.lang.String
getName()
javax.swing.tree.TreeNode
getParent()
boolean
isDeleted()
For rendering, use isModified to track changes to this objectboolean
isInherited()
boolean
isLeaf()
boolean
isModified()
boolean
isNew()
For rendering, use isModified to track changes to this objectvoid
loadModelDeep()
void
markModified()
void
markNew()
Happens when we copy overrides- the node was loaded, but didn't know that we were going to make a "new" inherited prop set.void
removeChild(TagStructurePanel.StructureNode node)
void
setCachedConfigModel(TagConfigurationModel model)
Sets the cached model, if not already present.protected void
setModelDeep(TagConfigurationModel model)
void
setValid(boolean valid)
java.lang.String
toString()
void
updateInfo(NodeBrowseInfo info)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.inductiveautomation.ignition.client.tags.tree.node.InfoNode
getTagType
-
-
-
-
Constructor Detail
-
StructureNode
public StructureNode(TagStructurePanel.StructureNode parent, NodeBrowseInfo info, boolean isNew, boolean isValid)
-
StructureNode
public StructureNode(TagStructurePanel.StructureNode parent, TagConfiguration newTag, boolean isValid)
-
-
Method Detail
-
setValid
public void setValid(boolean valid)
-
getComplexNodesInHierarchy
public java.util.List<TagStructurePanel.StructureNode> getComplexNodesInHierarchy()
Returns all of the complex tags (udt def or instance) from the root to this point. Used for getting parameter values.
-
clearChildren
public void clearChildren()
-
getCachedConfigModel
public TagConfigurationModel getCachedConfigModel()
The config model is null until loaded from the gateway, which will happen when we go to edit. After that, we'll hold it and won't load again until we commit or refresh.
-
setCachedConfigModel
public void setCachedConfigModel(TagConfigurationModel model)
Sets the cached model, if not already present.
-
forceSetCachedConfigModel
public void forceSetCachedConfigModel(TagConfigurationModel model)
Sets the cached model even if already present.
-
loadModelDeep
public void loadModelDeep()
-
setModelDeep
protected void setModelDeep(TagConfigurationModel model)
-
markModified
public void markModified()
-
isModified
public boolean isModified()
-
isNew
public boolean isNew()
For rendering, use isModified to track changes to this object
-
markNew
public void markNew()
Happens when we copy overrides- the node was loaded, but didn't know that we were going to make a "new" inherited prop set.
-
isInherited
public boolean isInherited()
-
isDeleted
public boolean isDeleted()
For rendering, use isModified to track changes to this object
-
delete
public void delete()
-
delete
public void delete(boolean isMove)
-
getCurrentParentPath
protected TagPath getCurrentParentPath()
-
getCurrentPath
protected TagPath getCurrentPath()
-
getEditPath
protected TagPath getEditPath()
-
getEdit
public TagConfiguration getEdit()
Returns the edit that can be sent to the gateway. The only real trick to this is that we have to be careful of renamed parent nodes. Edits will be applied IN ORDER from shallow to deep along a tree, which means that if a parent is renamed, that will be applied first- then a child edit, even a delete, needs to have a path that matches to the _new path_ of the _original node_.In other words, when building the path for the edit, we want the _updated_ parent path with the _original_ name of this node. A rename to this node will be reflected in the new name property on the config.
-
getInfo
public NodeBrowseInfo getInfo()
-
getName
public java.lang.String getName()
-
updateInfo
public void updateInfo(NodeBrowseInfo info)
-
getChildAt
public javax.swing.tree.TreeNode getChildAt(int childIndex)
- Specified by:
getChildAt
in interfacejavax.swing.tree.TreeNode
-
getChildCount
public int getChildCount()
- Specified by:
getChildCount
in interfacejavax.swing.tree.TreeNode
-
getParent
public javax.swing.tree.TreeNode getParent()
- Specified by:
getParent
in interfacejavax.swing.tree.TreeNode
-
getIndex
public int getIndex(javax.swing.tree.TreeNode node)
- Specified by:
getIndex
in interfacejavax.swing.tree.TreeNode
-
getChild
public TagStructurePanel.StructureNode getChild(java.lang.String name)
Returns the child for the given name. If multiple have the same name (due to deletion), we return the non deleted one.
-
addChild
public void addChild(TagStructurePanel.StructureNode node)
-
removeChild
public void removeChild(TagStructurePanel.StructureNode node)
-
getAllowsChildren
public boolean getAllowsChildren()
- Specified by:
getAllowsChildren
in interfacejavax.swing.tree.TreeNode
-
isLeaf
public boolean isLeaf()
- Specified by:
isLeaf
in interfacejavax.swing.tree.TreeNode
-
children
public java.util.Enumeration children()
- Specified by:
children
in interfacejavax.swing.tree.TreeNode
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-