Class ExpansionHandler

  • All Implemented Interfaces:
    java.util.EventListener, javax.swing.event.TreeExpansionListener, javax.swing.event.TreeModelListener

    public class ExpansionHandler
    extends TreeExpansionHandler
    Handles all aspects (e.g. expansion, selection) of the tree that have to happen in background as the refresher thread adds/removes nodes.
    • Field Detail

      • lastselectedpath

        protected NodePath lastselectedpath
        The node that was selected before the current project was last saved.
      • expandedpaths

        protected java.util.Set expandedpaths
        The expanded node paths.
    • Constructor Detail

      • ExpansionHandler

        public ExpansionHandler​(javax.swing.JTree tree)
        Create a new tree handler.
    • Method Detail

      • setSelectedPath

        public void setSelectedPath​(NodePath path)
        Set the selected path.
      • setExpandedPaths

        public void setExpandedPaths​(NodePath[] paths)
        Set the expanded paths.
      • handlePath

        protected IFuture handlePath​(javax.swing.tree.TreePath path)
        Check if an action (e.g. expand) has to be performed on the path.
        Overrides:
        handlePath in class TreeExpansionHandler
      • resolveNodePath

        protected java.lang.Object[] resolveNodePath​(NodePath nodepath)
        Get the node and treepath for a nodepath.
        Parameters:
        nodepath - The node path.
        Returns:
        An object array containing the node [0] and the tree path [1] or null if not found.
      • isExpanded

        public boolean isExpanded​(javax.swing.tree.TreePath path)
        Test if a path is expanded or should be.
        Overrides:
        isExpanded in class TreeExpansionHandler