Package jadex.base.gui.filetree
Class ExpansionHandler
- java.lang.Object
-
- jadex.commons.gui.TreeExpansionHandler
-
- jadex.base.gui.filetree.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 Summary
Fields Modifier and Type Field Description protected java.util.Set
expandedpaths
The expanded node paths.protected NodePath
lastselectedpath
The node that was selected before the current project was last saved.-
Fields inherited from class jadex.commons.gui.TreeExpansionHandler
expanded, tree
-
-
Constructor Summary
Constructors Constructor Description ExpansionHandler(javax.swing.JTree tree)
Create a new tree handler.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected IFuture
handlePath(javax.swing.tree.TreePath path)
Check if an action (e.g.boolean
isExpanded(javax.swing.tree.TreePath path)
Test if a path is expanded or should be.protected java.lang.Object[]
resolveNodePath(NodePath nodepath)
Get the node and treepath for a nodepath.void
setExpandedPaths(NodePath[] paths)
Set the expanded paths.void
setSelectedPath(NodePath path)
Set the selected path.-
Methods inherited from class jadex.commons.gui.TreeExpansionHandler
handleTreeStructureChanged, isTreeExpanded, treeCollapsed, treeExpanded, treeNodesChanged, treeNodesInserted, treeNodesRemoved, treeStructureChanged
-
-
-
-
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.
-
-
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 classTreeExpansionHandler
-
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 classTreeExpansionHandler
-
-