Class AbstractResourceNavTreeNode

    • Field Detail

      • resourcePath

        @Nonnull
        protected final ResourcePath resourcePath
      • inheritedIcon

        protected javax.swing.Icon inheritedIcon
      • restricted

        protected java.lang.Boolean restricted
      • protectedMenuItem

        protected static final javax.swing.JCheckBoxMenuItem protectedMenuItem
      • overrideEnabledMenuItem

        protected static final javax.swing.JCheckBoxMenuItem overrideEnabledMenuItem
      • revertMenuItem

        protected static final javax.swing.JMenuItem revertMenuItem
      • editDocumentationMenuItem

        protected static final javax.swing.JMenuItem editDocumentationMenuItem
      • overrideAction

        protected javax.swing.Action overrideAction
    • Constructor Detail

      • AbstractResourceNavTreeNode

        protected AbstractResourceNavTreeNode​(@Nonnull
                                              DesignerContext context,
                                              @Nonnull
                                              ResourcePath path)
    • Method Detail

      • addConcurrentUsersBadges

        protected void addConcurrentUsersBadges​(BadgeTreeCellRenderer renderer,
                                                boolean selected)
      • getProjectResource

        public java.util.Optional<ProjectResource> getProjectResource()
        The ProjectResource that this node represents
      • getResourcePath

        @Nonnull
        public ResourcePath getResourcePath()
      • setRevertedResourcePath

        public void setRevertedResourcePath​(ResourcePath resourcePath)
      • setProtected

        public void setProtected​(boolean prot)
      • setOverrideEnabled

        public void setOverrideEnabled​(boolean enabled)
      • uninstall

        protected void uninstall()
        Description copied from class: AbstractNavTreeNode
        Called when the node is removed from the tree. Override to provide meaningful implementation.
        Overrides:
        uninstall in class AbstractNavTreeNode
      • isOverrideEnabled

        public boolean isOverrideEnabled()
      • isProtectedEnabled

        protected boolean isProtectedEnabled()
      • isValid

        protected 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
      • isInherited

        public boolean isInherited()
        True if this node's resource is inherited from a parent project.
      • isOverridden

        public boolean isOverridden()
        True if this node's resource is present and overriding a resource from a parent project.
      • isLocal

        public boolean isLocal()
      • isChanged

        public boolean isChanged()
      • isOpen

        protected boolean isOpen()
        Override this to indicate whether or not this resource is open for editing
      • open

        protected void open()
        Implement this to open this resource up for editing
      • commitIfOpen

        public void commitIfOpen()
        Implement this to commit the resource that is open for editing.
      • revert

        public void revert()
      • editDocumentation

        public void editDocumentation()
      • alterName

        protected boolean alterName​(java.lang.String newTextValue)
      • getInvalidNameErrorMessage

        protected java.lang.String getInvalidNameErrorMessage​(java.lang.String attemptedName)
      • getAdditionalExportIds

        protected java.util.List<ResourcePath> getAdditionalExportIds()
      • addExportMenuItem

        protected void addExportMenuItem​(javax.swing.JPopupMenu menu)
      • addRevertMenuItem

        protected void addRevertMenuItem​(javax.swing.JPopupMenu menu)
      • addProtectMenuItem

        protected void addProtectMenuItem​(javax.swing.JPopupMenu menu)
      • addOverrideEnabledMenuItem

        protected void addOverrideEnabledMenuItem​(javax.swing.JPopupMenu menu)
      • addDocumentationMenuItem

        protected void addDocumentationMenuItem​(javax.swing.JPopupMenu menu)
      • isRestricted

        public boolean isRestricted()
        Description copied from class: AbstractNavTreeNode
        Used 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:
        isRestricted in class AbstractNavTreeNode
      • selectChild

        public void selectChild​(ResourcePath... ids)
        In an invoke later, tries to find a child resource-backed node with the given id to select.
      • gatherChildrenIds

        public 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)
      • onResourceModified

        protected 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