Class LazyExpansionTreeNode

    • Field Detail

      • m_ExpansionOccurred

        protected boolean m_ExpansionOccurred
        whether the tree node has been expanded before.
    • Constructor Detail

      • LazyExpansionTreeNode

        public LazyExpansionTreeNode()
        Creates a tree node that has no parent and no children, but which allows children.
      • LazyExpansionTreeNode

        public LazyExpansionTreeNode​(Object userObject)
        Creates a tree node with no parent, no children, but which allows children, and initializes it with the specified user object.
        Parameters:
        userObject - an Object provided by the user that constitutes the node's data
      • LazyExpansionTreeNode

        public LazyExpansionTreeNode​(Object userObject,
                                     boolean allowsChildren)
        Creates a tree node with no parent, no children, initialized with the specified user object, and that allows children only if specified.
        Parameters:
        userObject - an Object provided by the user that constitutes the node's data
        allowsChildren - if true, the node is allowed to have child nodes -- otherwise, it is always a leaf node
    • Method Detail

      • setExpansionOccurred

        public void setExpansionOccurred​(boolean value)
        Sets whether the expansion has already occurred.
        Parameters:
        value - true if the expansion has already occurred.
      • getExpansionOccurred

        public boolean getExpansionOccurred()
        Returns whether the expansion has already occurred.
        Returns:
        true if the expansion has already occurred
      • canExpand

        public boolean canExpand()
        Returns whether the node can be expanded at all.

        Default implementation returns false.
        Returns:
        true if it can be expanded
      • doExpand

        protected abstract boolean doExpand()
        Expands this node.
        Returns:
        true if structure below this node was changed
      • expand

        public boolean expand()
        Expands the node, if not yet occurred.
        Returns:
        true if structure below node was changed
        See Also:
        doExpand()
      • requiresReexpand

        public boolean requiresReexpand()
        Returns whether the node requires reexpanding.

        Default implementation returns false.
        Returns:
        true if it needs to be reexpanded
      • reset

        public void reset()
        Resets the node.
        See Also:
        doReset()
      • doReset

        protected abstract void doReset()
        Resets the node.
      • collapse

        public boolean collapse()
        Collapses the node and removes all children, resetting the node.
        Returns:
        true if sub-tree was changed
      • expandOrReexpandIfNecessary

        public void expandOrReexpandIfNecessary()
        Expands or e-expands the node if necessary.
        See Also:
        expand(), reexpand()