Class AbstractResourceNavTreeNode
- java.lang.Object
- 
- com.inductiveautomation.ignition.designer.navtree.model.AbstractNavTreeNode
- 
- com.inductiveautomation.ignition.designer.navtree.model.AbstractResourceNavTreeNode
 
 
- 
- All Implemented Interfaces:
- java.lang.Iterable<AbstractNavTreeNode>,- javax.swing.tree.TreeNode
 - Direct Known Subclasses:
- AbstractTopLevelContainerNode,- ClientEventScriptNode,- FolderNode,- GatewayEventScriptNode,- ModuleNode,- PipelineNode,- ResourceNode,- ScriptModuleNode,- SessionEventScriptNode,- SfcNode,- StyleClassNavTreeNode
 
 public abstract class AbstractResourceNavTreeNode extends AbstractNavTreeNode Simple subclass of AbstractNavTreeNode that has some functions for dealing with project resources represented by the node
- 
- 
Nested Class Summary- 
Nested classes/interfaces inherited from class com.inductiveautomation.ignition.designer.navtree.model.AbstractNavTreeNodeAbstractNavTreeNode.DeleteReason, AbstractNavTreeNode.PopupAction
 
- 
 - 
Field SummaryFields Modifier and Type Field Description protected DesignerContextcontextprotected AbstractNavTreeNode.PopupActionexportActionprotected javax.swing.IconinheritedIconprotected javax.swing.ActionoverrideActionprotected static AbstractNavTreeNode.PopupActionoverrideEnabledActionprotected static javax.swing.JCheckBoxMenuItemoverrideEnabledMenuItemprotected static AbstractNavTreeNode.PopupActionprotectedActionprotected static javax.swing.JCheckBoxMenuItemprotectedMenuItemprotected ProjectResourceIdresourceIdprotected ResourcePathresourcePathprotected java.lang.Booleanrestrictedprotected static AbstractNavTreeNode.PopupActionrevertActionprotected static javax.swing.JMenuItemrevertMenuItem- 
Fields inherited from class com.inductiveautomation.ignition.designer.navtree.model.AbstractNavTreeNodebold, children, childrenLoaded, copyAction, copyPathAction, cutAction, deleteAction, depth, icon, italic, log, model, name, parent, pasteAction, renameAction, selectionModel, text, thumbnail, tooltip
 
- 
 - 
Constructor SummaryConstructors Modifier Constructor Description protectedAbstractResourceNavTreeNode(DesignerContext context, ResourcePath path)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddBadges(BadgeTreeCellRenderer renderer, boolean selected)Add 'badges' to indicate meta information about this nodeprotected voidaddConcurrentUsersBadges(BadgeTreeCellRenderer renderer, boolean selected)protected voidaddEditActions(javax.swing.JPopupMenu menu)protected voidaddExportMenuItem(javax.swing.JPopupMenu menu)protected voidaddOverrideEnabledMenuItem(javax.swing.JPopupMenu menu)protected voidaddProtectMenuItem(javax.swing.JPopupMenu menu)protected voidaddRevertMenuItem(javax.swing.JPopupMenu menu)protected booleanalterName(java.lang.String newTextValue)booleancanCopy(java.util.List<AbstractNavTreeNode> selectedChildren)Can this edit action handler handle the copy action, given its current selection? Note that if this andAbstractNavTreeNode.canDelete(java.util.List)both return true, the cut action will also be enabled.booleancanDelete(java.util.List<AbstractNavTreeNode> selectedChildren)Can this edit action handler handle the delete action, given its current selection? Note that if this andAbstractNavTreeNode.canCopy(java.util.List)both return true, the cut action will also be enabled.voidcommitIfOpen()Implement this to commit the resource that is open for editing.java.util.Collection<ResourcePath>gatherChildrenIds(Project project)Returns the id of this resource, or if this is a folder, walks down and finds all resources ids under this folder (but not folders themselves)javax.swing.IcongetIcon()protected java.lang.StringgetInvalidNameErrorMessage(java.lang.String attemptedName)protected java.lang.Iterable<AbstractNavTreeNode.PopupAction>getPopupActions()Provide a list ofPopupActions that will be set up byAbstractNavTreeNode.setupEditActions(javax.swing.tree.TreePath[], java.util.List<com.inductiveautomation.ignition.designer.navtree.model.AbstractNavTreeNode>); that is, will have theirAbstractNavTreeNode.PopupAction.selectionandAbstractNavTreeNode.PopupAction.actionHandlerset.java.util.Optional<ProjectResource>getProjectResource()The ProjectResource that this node representsProjectResourceIdgetResourceId()ResourcePathgetResourcePath()voidinstall(AbstractNavTreeNode parent)booleanisChanged()booleanisEditable()Override this and return true if you want your node's text to be editable.booleanisInherited()True if this node's resource is inherited from a parent project.booleanisLocal()protected booleanisOpen()Override this to indicate whether or not this resource is open for editingbooleanisOverridden()True if this node's resource is present and overriding a resource from a parent project.booleanisOverrideEnabled()protected booleanisProtectedEnabled()booleanisRestricted()Used to display protected Icon for project resources that are able to be protected.protected booleanisValid(java.lang.String name)Override this if you want special naming rules for your node.voidonDoubleClick()Called when this node is double-clicked on.voidonEdit(java.lang.String newTextValue)Called after this node has been edited in the tree.protected voidonResourceModified(ProjectResource resource)AbstractResourceNavTreeNode adds a project listener to listen for changes to this node's resource.protected voidopen()Implement this to open this resource up for editingvoidrevert()voidselectChild(ResourcePath... ids)In an invoke later, tries to find a child resource-backed node with the given id to select.voidsetOverrideEnabled(boolean enabled)voidsetProtected(boolean prot)voidsetRevertedResourcePath(ResourcePath resourcePath)protected voidsetupEditActions(javax.swing.tree.TreePath[] paths, java.util.List<AbstractNavTreeNode> selection)Searches for a common edit action handling parent, and initializes each popup action by callingAbstractNavTreeNode.PopupAction.setSelection(AbstractNavTreeNode, AbstractNavTreeNode, List)protected voiduninstall()Called when the node is removed from the tree.- 
Methods inherited from class com.inductiveautomation.ignition.designer.navtree.model.AbstractNavTreeNodecanDrag, canDrop, canPaste, checkChildren, children, confirmDelete, createResourceCopy, debug, debug, dispatchSelectionEvent, doCopy, doCut, doDelete, doPaste, expand, expandAndSelect, findChild, findCommonEditActionHandler, findDropHandler, findEditActionHandler, forceChildrenReload, getAllowsChildren, getChildAt, getChildCount, getClipboard, getDeleteAction, getDepth, getExpandedIcon, getIndex, getModel, getName, getParent, getSelectionModel, getSortOrder, getText, getThumbnail, getTooltip, getWorkspaceName, initPopupMenu, isBold, isEditActionHandler, isItalic, isLeaf, isSelected, isTopLevelNode, isValidName, iterator, loadChildren, newLogger, notifyChildNameChanged, onChildrenSelected, onSelected, pathToRoot, recreate, recreate, refresh, reload, select, select, setBold, setChildren, setIcon, setItalic, setName, setText, setThumbnail, setTooltip, showPopupMenu, toString, uninstallChildren, useThumbnailTooltip, visitIfLoaded
 
- 
 
- 
- 
- 
Field Detail- 
context@Nonnull protected final DesignerContext context 
 - 
resourcePath@Nonnull protected final ResourcePath resourcePath 
 - 
resourceId@Nonnull protected final ProjectResourceId resourceId 
 - 
inheritedIconprotected javax.swing.Icon inheritedIcon 
 - 
restrictedprotected java.lang.Boolean restricted 
 - 
protectedActionprotected static final AbstractNavTreeNode.PopupAction protectedAction 
 - 
protectedMenuItemprotected static final javax.swing.JCheckBoxMenuItem protectedMenuItem 
 - 
overrideEnabledActionprotected static final AbstractNavTreeNode.PopupAction overrideEnabledAction 
 - 
overrideEnabledMenuItemprotected static final javax.swing.JCheckBoxMenuItem overrideEnabledMenuItem 
 - 
revertActionprotected static final AbstractNavTreeNode.PopupAction revertAction 
 - 
revertMenuItemprotected static final javax.swing.JMenuItem revertMenuItem 
 - 
overrideActionprotected javax.swing.Action overrideAction 
 - 
exportActionprotected final AbstractNavTreeNode.PopupAction exportAction 
 
- 
 - 
Constructor Detail- 
AbstractResourceNavTreeNodeprotected AbstractResourceNavTreeNode(@Nonnull DesignerContext context, @Nonnull ResourcePath path)
 
- 
 - 
Method Detail- 
addBadgespublic void addBadges(BadgeTreeCellRenderer renderer, boolean selected) Description copied from class:AbstractNavTreeNodeAdd 'badges' to indicate meta information about this node- Overrides:
- addBadgesin class- AbstractNavTreeNode
- Parameters:
- renderer- the renderer; call- BadgeTreeCellRenderer.addBadge(Badge)to add your badge(s)
- selected- the state of this node
 
 - 
addConcurrentUsersBadgesprotected void addConcurrentUsersBadges(BadgeTreeCellRenderer renderer, boolean selected) 
 - 
getProjectResourcepublic java.util.Optional<ProjectResource> getProjectResource() The ProjectResource that this node represents
 - 
getResourceId@Nonnull public ProjectResourceId getResourceId() 
 - 
getResourcePath@Nonnull public ResourcePath getResourcePath() 
 - 
setRevertedResourcePathpublic void setRevertedResourcePath(ResourcePath resourcePath) 
 - 
setProtectedpublic void setProtected(boolean prot) 
 - 
setOverrideEnabledpublic void setOverrideEnabled(boolean enabled) 
 - 
installpublic void install(AbstractNavTreeNode parent) - Overrides:
- installin class- AbstractNavTreeNode
 
 - 
uninstallprotected void uninstall() Description copied from class:AbstractNavTreeNodeCalled when the node is removed from the tree. Override to provide meaningful implementation.- Overrides:
- uninstallin class- AbstractNavTreeNode
 
 - 
isOverrideEnabledpublic boolean isOverrideEnabled() 
 - 
isProtectedEnabledprotected boolean isProtectedEnabled() 
 - 
isValidprotected boolean isValid(java.lang.String name) Override this if you want special naming rules for your node. Note that project imports assume RESOURCE_NAME_PATTERN is valid for all resource types. Write unit tests for overrides.- Parameters:
- name- name to evaluate
- Returns:
- true if matches the pattern
 
 - 
isInheritedpublic boolean isInherited() True if this node's resource is inherited from a parent project.
 - 
isOverriddenpublic boolean isOverridden() True if this node's resource is present and overriding a resource from a parent project.
 - 
isLocalpublic boolean isLocal() 
 - 
isChangedpublic boolean isChanged() 
 - 
isEditablepublic boolean isEditable() Description copied from class:AbstractNavTreeNodeOverride this and return true if you want your node's text to be editable. SeeAbstractNavTreeNode.onEdit(String)- Overrides:
- isEditablein class- AbstractNavTreeNode
 
 - 
isOpenprotected boolean isOpen() Override this to indicate whether or not this resource is open for editing
 - 
openprotected void open() Implement this to open this resource up for editing
 - 
commitIfOpenpublic void commitIfOpen() Implement this to commit the resource that is open for editing.
 - 
revertpublic void revert() 
 - 
onDoubleClickpublic void onDoubleClick() Description copied from class:AbstractNavTreeNodeCalled when this node is double-clicked on.- Overrides:
- onDoubleClickin class- AbstractNavTreeNode
 
 - 
onEditpublic void onEdit(java.lang.String newTextValue) Description copied from class:AbstractNavTreeNodeCalled after this node has been edited in the tree.- Overrides:
- onEditin class- AbstractNavTreeNode
 
 - 
alterNameprotected boolean alterName(java.lang.String newTextValue) 
 - 
getInvalidNameErrorMessageprotected java.lang.String getInvalidNameErrorMessage(java.lang.String attemptedName) 
 - 
getPopupActionsprotected java.lang.Iterable<AbstractNavTreeNode.PopupAction> getPopupActions() Description copied from class:AbstractNavTreeNodeProvide a list ofPopupActions that will be set up byAbstractNavTreeNode.setupEditActions(javax.swing.tree.TreePath[], java.util.List<com.inductiveautomation.ignition.designer.navtree.model.AbstractNavTreeNode>); that is, will have theirAbstractNavTreeNode.PopupAction.selectionandAbstractNavTreeNode.PopupAction.actionHandlerset.- Overrides:
- getPopupActionsin class- AbstractNavTreeNode
 
 - 
setupEditActionsprotected void setupEditActions(javax.swing.tree.TreePath[] paths, java.util.List<AbstractNavTreeNode> selection)Description copied from class:AbstractNavTreeNodeSearches for a common edit action handling parent, and initializes each popup action by callingAbstractNavTreeNode.PopupAction.setSelection(AbstractNavTreeNode, AbstractNavTreeNode, List)- Overrides:
- setupEditActionsin class- AbstractNavTreeNode
 
 - 
addEditActionsprotected void addEditActions(javax.swing.JPopupMenu menu) - Overrides:
- addEditActionsin class- AbstractNavTreeNode
 
 - 
addExportMenuItemprotected void addExportMenuItem(javax.swing.JPopupMenu menu) 
 - 
addRevertMenuItemprotected void addRevertMenuItem(javax.swing.JPopupMenu menu) 
 - 
addProtectMenuItemprotected void addProtectMenuItem(javax.swing.JPopupMenu menu) 
 - 
addOverrideEnabledMenuItemprotected void addOverrideEnabledMenuItem(javax.swing.JPopupMenu menu) 
 - 
getIconpublic javax.swing.Icon getIcon() - Overrides:
- getIconin class- AbstractNavTreeNode
 
 - 
isRestrictedpublic boolean isRestricted() Description copied from class:AbstractNavTreeNodeUsed to display protected Icon for project resources that are able to be protected. This method is overridden in AbstractProtectableResource to return if the the project resource it contains is actually.- Overrides:
- isRestrictedin class- AbstractNavTreeNode
 
 - 
selectChildpublic void selectChild(ResourcePath... ids) In an invoke later, tries to find a child resource-backed node with the given id to select.
 - 
gatherChildrenIdspublic java.util.Collection<ResourcePath> gatherChildrenIds(Project project) Returns the id of this resource, or if this is a folder, walks down and finds all resources ids under this folder (but not folders themselves)
 - 
canDeletepublic boolean canDelete(java.util.List<AbstractNavTreeNode> selectedChildren) Description copied from class:AbstractNavTreeNodeCan this edit action handler handle the delete action, given its current selection? Note that if this andAbstractNavTreeNode.canCopy(java.util.List)both return true, the cut action will also be enabled.- Overrides:
- canDeletein class- AbstractNavTreeNode
 
 - 
canCopypublic boolean canCopy(java.util.List<AbstractNavTreeNode> selectedChildren) Description copied from class:AbstractNavTreeNodeCan this edit action handler handle the copy action, given its current selection? Note that if this andAbstractNavTreeNode.canDelete(java.util.List)both return true, the cut action will also be enabled.- Overrides:
- canCopyin class- AbstractNavTreeNode
 
 - 
onResourceModifiedprotected void onResourceModified(ProjectResource resource) AbstractResourceNavTreeNode adds a project listener to listen for changes to this node's resource. When it is modified, this will be invoked. If you override, you should invoke super() because it controls the node's italic state for modified resources
 
- 
 
-