Class GTree
- All Implemented Interfaces:
BusyListener
,ImageObserver
,MenuContainer
,Serializable
,Accessible
- Direct Known Subclasses:
DataTree
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class javax.swing.JPanel
JPanel.AccessibleJPanel
Nested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
Nested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainer
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
-
Field Summary
Fields inherited from class javax.swing.JComponent
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
Fields inherited from class java.awt.Component
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addGTModelListener
(TreeModelListener listener) void
void
addMouseListener
(MouseListener listener) void
addSelectionPath
(TreePath path) void
void
void
Signals that any multithreaded work should be cancelled.void
void
void
void
collapseAll
(GTreeNode node) protected JTreeMouseListenerDelegate
static void
createSharedActions
(Tool tool, ToolActions toolActions, String owner) void
dispose()
void
void
expandedStateRestored
(TaskMonitor taskMonitor) A method that subclasses can use to be notified when tree state has been restored.void
expandPath
(GTreeNode node) void
expandPath
(TreePath path) void
expandPaths
(List<TreePath> pathsList) void
expandPaths
(TreePath[] paths) void
expandTree
(GTreeNode node) void
void
forceNewNodeIntoView
(GTreeNode parent, String childName, Consumer<GTreeNode> consumer) A specialized method that will get the child node from the given parent node when it becomes available to the model.getExpandedPaths
(GTreeNode node) Returns the filter text field in this tree.protected final JTree
getJTree()
getModel()
Returns the model for this treegetModelNode
(GTreeNode node) Gets the model node for the given node.getModelNodeForPath
(TreePath path) Gets the model node for the given path.This method returns the root node that was provided to the tree by the client, whether from the constructor or fromsetRootNode(GTreeNode)
.getNodeForLocation
(int x, int y) getPathBounds
(TreePath path) getPathForLocation
(int x, int y) getPathForRow
(int row) Returns the key that this tree uses to store preferences.int
int
getRowForPath
(TreePath treePath) protected JScrollPane
TreePath[]
getToolTipText
(MouseEvent event) Returns a state object that allows this tree to later restore its expanded and selected state.getTreeState
(GTreeNode node) getViewNode
(GTreeNode node) Gets the view node for the given node.getViewNodeForPath
(TreePath path) Gets the view node for the given path.Returns the current viewport position of the scrollable tree.This method returns the root node currently being displayed by theJTree
.boolean
boolean
isBusy()
boolean
isCollapsed
(TreePath path) boolean
boolean
boolean
isExpanded
(TreePath treePath) boolean
boolean
boolean
Returns true if the given JTree is the actual JTree used by this GTree.boolean
isPathEditable
(TreePath path) boolean
isPathSelected
(TreePath treePath) boolean
boolean
static void
printEvent
(PrintWriter out, String name, TreeModelEvent e) This method is useful for debugging tree problems.void
Causes the tree to refilter some time latervoid
refilterLater
(GTreeNode newNode) Re-filters the tree if the newNode should be included in the current filter results.void
Causes the tree to refilter immediately (before this method returns)void
removeGTModelListener
(TreeModelListener listener) void
void
removeMouseListener
(MouseListener listener) void
void
restoreTreeState
(GTreeState state) Restores the expanded and selected state of this tree to that contained in the given state object.void
runBulkTask
(GTreeBulkTask task) void
Used to run tree tasks.void
runTask
(MonitoredRunnable runnableTask) Used to run simple GTree tasks that can be expressed as aMonitoredRunnable
(or a lambda taking aTaskMonitor
).void
scrollPathToVisible
(TreePath treePath) void
setAccessibleNamePrefix
(String namePrefix) Sets an accessible name on the GTree.void
void
setBusy
(boolean busy) void
setCellEditor
(TreeCellEditor editor) void
setCellRenderer
(GTreeRenderer renderer) void
setDataTransformer
(FilterTransformer<GTreeNode> transformer) Sets a transformer object used to perform filtering.void
setDoubleClickExpansionEnabled
(boolean b) Enable or disable using double-click to open and close tree nodes.void
setDragNDropHandler
(GTreeDragNDropHandler dragNDropHandler) void
setEditable
(boolean editable) void
setEnabled
(boolean enabled) void
setEventsEnabled
(boolean b) Turns tree event notifications on/offvoid
setFilterFieldEnabled
(boolean enabled) Disabled the filter text field, but allows the tree to still filter.void
setFilteringEnabled
(boolean enabled) Disables all filtering performed by this tree.void
setFilterProvider
(GTreeFilterProvider filterProvider) protected void
setFilterRestoreState
(GTreeState state) Sets the filter restore state.void
setFilterText
(String text) void
setFilterVisible
(boolean visible) Hides the filter field.void
setHorizontalScrollPolicy
(int policy) void
setNodeEditable
(GTreeNode child) void
setPaintHandlesForLeafNodes
(boolean enable) Passing a value offalse
signals to disable theJTree
's default behavior of showing handles for leaf nodes until they are opened.void
setRootNode
(GTreeNode rootNode) Sets the root node for this tree.void
setRootNodeAllowedToCollapse
(boolean allowed) void
setRootVisible
(boolean b) void
setRowHeight
(int rowHeight) void
setScrollableUnitIncrement
(int increment) Sets the size of the scroll when mouse scrolling or pressing the scroll up/down buttons.void
setSelectedNode
(GTreeNode node) void
setSelectedNodeByNamePath
(String[] namePath) A convenience method to select a node by a path, starting with the tree root name, down each level until the desired node name.void
setSelectedNodeByPathName
(TreePath treePath) Selects the node that matches the each name in the given tree path.void
setSelectedNodes
(GTreeNode... nodes) void
setSelectedNodes
(Collection<GTreeNode> nodes) void
setSelectionModel
(GTreeSelectionModel selectionModel) void
setSelectionPath
(TreePath path) void
setSelectionPaths
(List<TreePath> pathsList) void
setSelectionPaths
(TreePath[] paths) void
setSelectionPaths
(TreePath[] path, GTreeSelectionEvent.EventOrigin origin) void
setSeletedNodeByName
(GTreeNode parentNode, String childName) A convenience method that allows clients that have created a new child node to select that node in the tree, without having to lookup the actual GTreeNode implementation.void
setShowsRootHandles
(boolean b) void
setTransferHandler
(TransferHandler handler) void
void
startEditing
(GTreeNode node) Requests that the node be edited.void
startEditing
(GTreeNode parent, String childName) Requests that the node with the given name, in the given parent, be edited.void
protected boolean
A method that subclasses can override to signal that they wish not to have this tree's built-in popup actions.toString()
protected void
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTree
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setName, setSize, setSize, show, show, size, transferFocus, transferFocusBackward, transferFocusUpCycle
-
Constructor Details
-
GTree
Creates a GTree with the given root node. The created GTree will use a threaded model for performing tasks, which allows the GUI to be responsive for reaaaaaaaaly big trees.- Parameters:
root
- The root node of the tree.
-
-
Method Details
-
setEnabled
public void setEnabled(boolean enabled) - Overrides:
setEnabled
in classJComponent
-
setEventsEnabled
public void setEventsEnabled(boolean b) Turns tree event notifications on/off- Parameters:
b
- true to enable events, false to disable events
-
setDragNDropHandler
-
setTransferHandler
- Overrides:
setTransferHandler
in classJComponent
-
getDragNDropHandler
-
setAccessibleNamePrefix
Sets an accessible name on the GTree. This prefix will be used to assign meaningful accessible names to the tree, filter text field and the filter options button such that screen readers will properly describe them.This prefix should be the base name that describes the type of items in the tree. This method will then append the necessary information to name the text field and the button.
- Parameters:
namePrefix
- the accessible name prefix to assign to the filter component. For example if the tree contains fruits, then "Fruits" would be an appropriate prefix name.
-
setCellRenderer
-
getCellRenderer
-
dispose
public void dispose() -
isDisposed
public boolean isDisposed() -
cancelWork
public void cancelWork()Signals that any multithreaded work should be cancelled. -
filterChanged
public void filterChanged() -
updateModelFilter
protected void updateModelFilter() -
createMouseListenerDelegate
-
getTreeState
Returns a state object that allows this tree to later restore its expanded and selected state.Note: See the usage note at the header of this class concerning how tree state is used relative to the
equals()
method.- Returns:
- the saved state
-
getTreeState
-
restoreTreeState
Restores the expanded and selected state of this tree to that contained in the given state object.Note: See the usage note at the header of this class concerning how tree state is used relative to the
equals()
method.- Parameters:
state
- the state to restore- See Also:
-
setFilterRestoreState
Sets the filter restore state. This method is a way to override the tree's filtering behavior, which is usually set by a call tosaveFilterRestoreState()
. Most clients will never need to call this method.- Parameters:
state
- the state to set
-
getPreferenceKey
Returns the key that this tree uses to store preferences.- Returns:
- the key that this tree uses to store preferences.
-
expandedStateRestored
A method that subclasses can use to be notified when tree state has been restored. This method is called after a major structural tree change has happened and the paths that should be opened have been opened. Thus any other nodes are closed and can be disposed, if desired.- Parameters:
taskMonitor
- the TaskMonitor
-
getExpandedPaths
-
getExpandedPaths
-
expandTree
-
expandAll
public void expandAll() -
collapseAll
-
expandPath
-
expandPath
-
expandPaths
-
expandPaths
-
clearSelectionPaths
public void clearSelectionPaths() -
setSelectedNode
-
setSelectedNodes
-
setSelectedNodes
-
setSelectionPaths
-
setSelectionPaths
-
setSelectionPath
-
setSelectedNodeByNamePath
A convenience method to select a node by a path, starting with the tree root name, down each level until the desired node name.- Parameters:
namePath
- The path to select
-
setSeletedNodeByName
A convenience method that allows clients that have created a new child node to select that node in the tree, without having to lookup the actual GTreeNode implementation.- Parameters:
parentNode
- The parent containing a child by the given namechildName
- The name of the child to select
-
setSelectedNodeByPathName
Selects the node that matches the each name in the given tree path. It is worth noting that the items in the tree path themselves are not used to identify nodes, but thetoString()
of those items will be used.- Parameters:
treePath
- The path containing the names of the path of the node to select
-
setSelectionPaths
-
isCollapsed
-
setHorizontalScrollPolicy
public void setHorizontalScrollPolicy(int policy) -
getScrollPane
-
setScrollableUnitIncrement
public void setScrollableUnitIncrement(int increment) Sets the size of the scroll when mouse scrolling or pressing the scroll up/down buttons. Most clients will not need this method, as the default behavior of the tree is correct, which is to scroll based upon the size of the nodes (which is usually uniform and a single row in size). However, some clients that have variable row height, with potentially large rows, may wish to change the scrolling behavior so that it is not too fast.- Parameters:
increment
- the new (uniform) scroll increment.
-
getModel
Returns the model for this tree- Returns:
- the model for this tree
-
getJTree
-
getViewPosition
Returns the current viewport position of the scrollable tree.- Returns:
- the current viewport position of the scrollable tree.
-
setViewPosition
-
getViewRect
-
getNodeForLocation
-
getModelNode
Gets the model node for the given node. This is useful if the node that is in the path has been replaced by a new node that is equal, but a different instance. One way this happens is if the tree is filtered and therefor the displayed nodes are clones of the model nodes. This can also happen if the tree nodes are rebuilt for some reason.- Parameters:
node
- the node- Returns:
- the corresponding model node in the tree. If the tree is filtered the viewed node will be a clone of the corresponding model node.
-
getModelNodeForPath
Gets the model node for the given path. This is useful if the node that is in the path has been replaced by a new node that is equal, but a different instance. One way this happens is if the tree is filtered and therefor the displayed nodes are clones of the model nodes. This can also happen if the tree nodes are rebuilt for some reason.- Parameters:
path
- the path of the node- Returns:
- the corresponding model node in the tree. If the tree is filtered the viewed node will be a clone of the corresponding model node.
-
getViewNode
Gets the view node for the given node. This is useful to translate to a tree path that is valid for the currently displayed tree. (Remember that if the tree is filtered, then the displayed nodes are clones of the model nodes.)- Parameters:
node
- the node- Returns:
- the current node in the displayed (possibly filtered) tree
-
getViewNodeForPath
Gets the view node for the given path. This is useful to translate to a tree path that is valid for the currently displayed tree. (Remember that if the tree is filtered, then the displayed nodes are clones of the model nodes.)- Parameters:
path
- the path of the node- Returns:
- the current node in the displayed (possibly filtered) tree
-
setActiveDropTargetNode
-
setFilterText
-
getFilterProvider
-
setFilterProvider
-
setFilterFieldEnabled
public void setFilterFieldEnabled(boolean enabled) Disabled the filter text field, but allows the tree to still filter. This is useful if you want to allow programmatic filtering, but to not allow the user to filter.- Parameters:
enabled
- True makes the filter field editable; false makes it uneditable- See Also:
-
setFilteringEnabled
public void setFilteringEnabled(boolean enabled) Disables all filtering performed by this tree. Also, the filter field of the tree will be disabled.Use this method to temporarily disable filtering.
- Parameters:
enabled
- True to allow normal filtering; false to disable all filtering- See Also:
-
setFilterVisible
public void setFilterVisible(boolean visible) Hides the filter field. Filtering will still take place, as defined by theGTreeFilterProvider
.- Parameters:
visible
- true to show the filter; false to hide it.- See Also:
-
isFilteringEnabled
public boolean isFilteringEnabled() -
setDataTransformer
Sets a transformer object used to perform filtering. This object is responsible for turning the tree's nodes into a list of strings that can be searched when filtering.- Parameters:
transformer
- the transformer to set
-
getFilterField
Returns the filter text field in this tree.- Returns:
- the filter text field in this tree.
-
isMyJTree
Returns true if the given JTree is the actual JTree used by this GTree.- Parameters:
jTree
- the tree to test- Returns:
- true if the given JTree is the actual JTree used by this GTree.
-
setRootNode
Sets the root node for this tree.NOTE: if this method is not called from the Swing thread, then the root node will be set later on the Swing thread. That is, this method will return before the work has been done.
- Parameters:
rootNode
- The node to set as the new root.
-
getModelRoot
This method returns the root node that was provided to the tree by the client, whether from the constructor or fromsetRootNode(GTreeNode)
. This node represents the data model and always contains all the nodes regardless of any filter being applied. If a filter is applied to the tree, then this is not the actual root node being displayed by theJTree
.- Returns:
- the root node as provided by the client.
-
getViewRoot
This method returns the root node currently being displayed by theJTree
. If there are no filters applied, then this will be the same as the model root (SeegetModelRoot()
). If a filter is applied, then this will be a clone of the model root that contains clones of all nodes matching the filter.- Returns:
- the root node currently being display by the
JTree
-
printEvent
This method is useful for debugging tree problems. Don't know where else to put it.- Parameters:
out
- the output writername
- use this to indicate what tree event occurred ("node inserted" "node removed", etc.)e
- the TreeModelEvent;
-
getSelectionModel
-
getGTSelectionModel
-
setSelectionModel
-
getRowCount
public int getRowCount() -
getRowForPath
-
getPathForRow
-
getSelectionPath
-
getSelectionPaths
-
getSelectedNodes
-
isExpanded
-
isPathSelected
-
isRootVisible
public boolean isRootVisible() -
setRootVisible
public void setRootVisible(boolean b) -
setShowsRootHandles
public void setShowsRootHandles(boolean b) -
scrollPathToVisible
-
getCellEditor
-
getPathForLocation
-
getPathBounds
-
setRowHeight
public void setRowHeight(int rowHeight) -
addSelectionPath
-
addTreeExpansionListener
-
removeTreeExpansionListener
-
addGTreeSelectionListener
-
removeGTreeSelectionListener
-
addGTModelListener
-
removeGTModelListener
-
setEditable
public void setEditable(boolean editable) -
forceNewNodeIntoView
A specialized method that will get the child node from the given parent node when it becomes available to the model. This method will ensure that the named child passes any current filter in order for the child to appear in the tree. This effect is temporary and will be undone when next the filter changes.This method is intended to be used by clients using an asynchronous node model, where new nodes will get created by application-level events. Such clients may wish to perform work when newly created nodes become available. This method simplifies the concurrent nature of the GTree, asynchronous nodes and the processing of asynchronous application-level events by providing a callback mechanism for clients. This method is non-blocking.
Note: this method assumes that the given parent node is in the view and not filtered out of the view. This method makes no attempt to ensure the given parent node passes any existing filter.
Note: this method will not wait forever for the given node to appear. It will eventually give up if the node never arrives.
- Parameters:
parent
- the model's parent node. If the view's parent node is passed, it will be translated to the model node.childName
- the name of the desired childconsumer
- the consumer callback to which the child node will be given when available
-
startEditing
Requests that the node with the given name, in the given parent, be edited. This operation is asynchronous. This request will be buffered as needed to wait for the given node to be added to the parent, up to a timeout period.- Parameters:
parent
- the parent nodechildName
- the name of the child to edit
-
startEditing
Requests that the node be edited. This operation is asynchronous.- Parameters:
node
- the node to edit
-
addMouseListener
- Overrides:
addMouseListener
in classComponent
-
removeMouseListener
- Overrides:
removeMouseListener
in classComponent
-
getMouseListeners
- Overrides:
getMouseListeners
in classComponent
-
setCellEditor
-
isPathEditable
-
setPaintHandlesForLeafNodes
public void setPaintHandlesForLeafNodes(boolean enable) Passing a value offalse
signals to disable theJTree
's default behavior of showing handles for leaf nodes until they are opened.- Parameters:
enable
- False to disable the default JTree behavior
-
isRootAllowedToCollapse
public boolean isRootAllowedToCollapse() -
setRootNodeAllowedToCollapse
public void setRootNodeAllowedToCollapse(boolean allowed) -
isBusy
public boolean isBusy() -
setBusy
public void setBusy(boolean busy) - Specified by:
setBusy
in interfaceBusyListener
-
refilterNow
public void refilterNow()Causes the tree to refilter immediately (before this method returns) -
refilterLater
public void refilterLater()Causes the tree to refilter some time later -
refilterLater
Re-filters the tree if the newNode should be included in the current filter results. If the new node doesn't match the filter, there is no need to refilter the tree.- Parameters:
newNode
- the node that may cause the tree to refilter.
-
getFilter
-
isFiltered
public boolean isFiltered() -
hasFilterText
public boolean hasFilterText() -
getFilterText
-
clearFilter
public void clearFilter() -
runTask
Used to run tree tasks. This method is not meant for general clients of this tree, but rather for tasks to tell the tree to perform subtasks.- Parameters:
task
- the task to run
-
runTask
Used to run simple GTree tasks that can be expressed as aMonitoredRunnable
(or a lambda taking aTaskMonitor
).- Parameters:
runnableTask
-TaskMonitor
to watch and update with progress.
-
runBulkTask
-
isEditing
public boolean isEditing() -
stopEditing
public void stopEditing() -
cancelEditing
public void cancelEditing() -
setNodeEditable
-
toString
-
getToolTipText
- Overrides:
getToolTipText
in classJComponent
-
clearSizeCache
public void clearSizeCache() -
supportsPopupActions
protected boolean supportsPopupActions()A method that subclasses can override to signal that they wish not to have this tree's built-in popup actions. Subclasses will almost never need to override this method.- Returns:
- true if popup actions are supported
-
setDoubleClickExpansionEnabled
public void setDoubleClickExpansionEnabled(boolean b) Enable or disable using double-click to open and close tree nodes. The default is true.- Parameters:
b
- true to enable
-