Class JTree
java.lang.Object
vaadinx.awt.Component
vaadinx.awt.Container
vaadinx.swing.JComponent
vaadinx.swing.JTree
- All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, Scrollable, FieldReconciler.Reconcilable
public class JTree
extends JComponent
implements Scrollable, Accessible, FieldReconciler.Reconcilable
Emulator for
JTree — a thin delegating shell over its
SJTree peer; R_leaf_peer_lockdown-locked-down (JDK leaf — private peer ctor).
Implements Scrollable and
Accessible to match the JDK interface set.- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classDrop location for a JTree drop (D_jtree_row_dnd — emulator forjavax.swing.JTree.DropLocation).protected classKeepsexpandedStatein step with the model, as the JDK's does: a new root clears the table, a changed or removed subtree loses its toggled paths, and the selection leaves nodes that are gone. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringprotected TreeCellEditorprotected TreeCellRendererCurrently installed JDK-shaped cell renderer; seeded with DefaultTreeCellRenderer.protected booleanstatic final Stringstatic final Stringstatic final Stringprotected booleanstatic final Stringprotected booleanstatic final Stringstatic final Stringprotected booleanstatic final Stringprotected intstatic final Stringprotected booleanstatic final Stringprotected TreeSelectionModelstatic final Stringprotected booleanstatic final Stringprotected intstatic final Stringprotected TreeModelprotected TreeModelListenerThe JDK hook's listener, subscribed totreeModel; keepsexpandedStatein step with the model.static final Stringprotected intFields inherited from class JComponent
TOOL_TIP_TEXT_KEY, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOWFields inherited from class Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, FILL_CHROME, FILL_DEFAULT, LEFT_ALIGNMENT, listenerList, RIGHT_ALIGNMENT, TOP_ALIGNMENTFields inherited from interface ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddSelectionInterval(int index0, int index1) voidaddSelectionPath(TreePath path) voidaddSelectionPaths(TreePath[] paths) voidaddSelectionRow(int row) voidaddSelectionRows(int[] rows) voidvoidvoidFired before every expansion and collapse, programmatic or the user's, and a veto holds, as in the JDK.voidCancels the in-flight edit with no write-back.voidprotected voidClears the toggled-paths table; fires nothing, as in the JDK.voidcollapsePath(TreePath path) voidcollapseRow(int row) convertValueToText(Object value, boolean selected, boolean expanded, boolean leaf, int row, boolean hasFocus) The JDK-overridable node-to-text formatting hook the default renderer's text flows through.protected static TreeModelcreateTreeModel(Object value) JDK'screateTreeModelshape: wrap the entries under a synthetic "root" node (hidden by the calling ctor'ssetRootVisible(false)).protected TreeModelListenerTheJTree.TreeModelHandlerthe JDK subscribes to the model; an override may return its own, ornullfor none.voidexpandPath(TreePath path) voidexpandRow(int row) voidfireTreeCollapsed(TreePath path) Notifies theTreeExpansionListeners last to first, as the JDK does.voidfireTreeExpanded(TreePath path) Notifies theTreeExpansionListeners last to first, as the JDK does.voidfireTreeWillCollapse(TreePath path) Notifies theTreeWillExpandListeners last to first, as the JDK does; the first veto stops it.voidfireTreeWillExpand(TreePath path) Notifies theTreeWillExpandListeners last to first, as the JDK does; the first veto stops it.protected voidgetClosestPathForLocation(int x, int y) The clicked path during a mouse handler's dispatch, null otherwise — seegetRowForLocation(int, int).intgetClosestRowForLocation(int x, int y) protected static TreeModelJDK's sample model (javax.swing.JTree.getDefaultTreeModel()): the "JTree" root with colors / sports / food children.protected Enumeration<TreePath> getDescendantToggledPaths(TreePath parent) The toggled paths underparent,parentincluded.booleanfinal DropModegetExpandedDescendants(TreePath parent) The expanded, visible descendants ofparent, excludingparent; empty when there are none,nullwhenparentis not expanded.booleanbooleanintintintgetModel()getNextMatch(String prefix, int startingRow, Position.Bias bias) WARN — type-ahead node search isn't modelled.getPathBounds(TreePath path) R_layouts_close_enough — no server-side cell bounds.getPathForLocation(int x, int y) The clicked path during a mouse handler's dispatch, null otherwise — seegetRowForLocation(int, int).getPathForRow(int row) getRowBounds(int row) R_layouts_close_enough — no server-side cell bounds.intintgetRowForLocation(int x, int y) The clicked row during a user mouse handler's dispatch (theselectOnRightClickidiom), -1 otherwise, whatever the coordinates: there is no server-side pixel→row map (R_layouts_close_enough).intgetRowForPath(TreePath path) -1when an ancestor is collapsed, so the path has no row.intintgetScrollableBlockIncrement(Rectangle visibleRect, int orientation, int direction) booleanbooleanintgetScrollableUnitIncrement(Rectangle visibleRect, int orientation, int direction) booleanintTreePath[]int[]Resolved through the installedRowMapper(the visible-node walk).booleanintgetUI()intbooleanhasBeenExpanded(TreePath path) Whetherpathwas ever expanded or collapsed, as the JDK's toggled-paths table records.booleanisCollapsed(int row) booleanisCollapsed(TreePath path) booleanbooleanbooleanisExpanded(int row) The node atrow's own expanded flag; its ancestors are expanded, or it would have no row.booleanisExpanded(TreePath path) Whetherpathand every one of its ancestors is expanded.booleanJDK: fixed row height means a positiverowHeight.booleanbooleanisPathEditable(TreePath path) JDK subclass hook — defaults toisEditable().booleanisPathSelected(TreePath path) booleanbooleanisRowSelected(int row) booleanbooleanvoidmakeVisible(TreePath path) final voidD_field_write_reconcile repair hook — seeJSlider.reconcileFields().protected booleanremoveDescendantSelectedPaths(TreePath path, boolean includePath) Removes the selected paths underpath;trueif there were any.protected voidremoveDescendantToggledPaths(Enumeration<TreePath> toRemove) Removes every toggled path under each oftoRemove, the paths themselves included.voidremoveSelectionInterval(int index0, int index1) voidremoveSelectionPath(TreePath path) voidremoveSelectionPaths(TreePath[] paths) voidremoveSelectionRow(int row) voidremoveSelectionRows(int[] rows) voidvoidvoidvoidscrollPathToVisible(TreePath path) Expands ancestors (firing TreeExpansionEvents) then scrolls, when the path is then visible; R_layouts_close_enough — no pixel guarantee.voidscrollRowToVisible(int row) voidsetAnchorSelectionPath(TreePath newPath) voidsetCellEditor(TreeCellEditor cellEditor) Stores the editor and fires"cellEditor"; the editor is inert.voidvoidsetDragEnabled(boolean b) final voidsetDropMode(DropMode dropMode) voidsetEditable(boolean flag) Arms rename-in-place editing — double-click a node, or callstartEditingAtPath(TreePath).protected voidsetExpandedState(TreePath path, boolean state) The JDK's expansion engine.voidsetExpandsSelectedPaths(boolean newValue) voidsetInvokesStopCellEditing(boolean newValue) voidsetLargeModel(boolean newValue) voidsetLeadSelectionPath(TreePath newPath) voidvoidsetRootVisible(boolean rootVisible) voidsetRowHeight(int rowHeight) voidsetScrollsOnExpand(boolean newValue) voidsetSelectionInterval(int index0, int index1) voidsetSelectionModel(TreeSelectionModel selectionModel) voidsetSelectionPath(TreePath path) voidsetSelectionPaths(TreePath[] paths) voidsetSelectionRow(int row) voidsetSelectionRows(int[] rows) voidsetShowsRootHandles(boolean newValue) voidsetToggleClickCount(int clickCount) voidvoidsetVisibleRowCount(int newCount) voidstartEditingAtPath(TreePath path) Selectspathand opens a text editor on its node, seeded fromconvertValueToText(Object, boolean, boolean, boolean, int, boolean).booleanCommits the in-flight edit (write-back viavalueForPathChanged);trueif editing was in progress.voidupdateUI()Methods inherited from class JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, 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, 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, paramString, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, 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, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, updateMethods inherited from class Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, addSlotChild, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, fireHierarchyEvent, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, peerContentElement, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, removeSlotChild, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTreeMethods inherited from class Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, applyBackgroundToPeer, applyVisibleToPeer, awtListeners, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, defaultFillCssClass, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, fireComponentEvent, 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, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isThemeDefault, 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, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setName, setSize, setSize, show, show, size, suppressMouseBridge, toString, transferFocus, transferFocusBackward, transferFocusUpCycle, withPeer, withPeerOnLiveUI
-
Field Details
-
CELL_RENDERER_PROPERTY
- See Also:
-
TREE_MODEL_PROPERTY
- See Also:
-
ROOT_VISIBLE_PROPERTY
- See Also:
-
SHOWS_ROOT_HANDLES_PROPERTY
- See Also:
-
ROW_HEIGHT_PROPERTY
- See Also:
-
CELL_EDITOR_PROPERTY
- See Also:
-
EDITABLE_PROPERTY
- See Also:
-
LARGE_MODEL_PROPERTY
- See Also:
-
SELECTION_MODEL_PROPERTY
- See Also:
-
VISIBLE_ROW_COUNT_PROPERTY
- See Also:
-
INVOKES_STOP_CELL_EDITING_PROPERTY
- See Also:
-
SCROLLS_ON_EXPAND_PROPERTY
- See Also:
-
TOGGLE_CLICK_COUNT_PROPERTY
- See Also:
-
LEAD_SELECTION_PATH_PROPERTY
- See Also:
-
ANCHOR_SELECTION_PATH_PROPERTY
- See Also:
-
EXPANDS_SELECTED_PATHS_PROPERTY
- See Also:
-
cellRenderer
Currently installed JDK-shaped cell renderer; seeded with DefaultTreeCellRenderer. -
treeModelListener
The JDK hook's listener, subscribed totreeModel; keepsexpandedStatein step with the model. -
treeModel
-
selectionModel
-
rootVisible
protected boolean rootVisible -
showsRootHandles
protected boolean showsRootHandles -
rowHeight
protected int rowHeight -
scrollsOnExpand
protected boolean scrollsOnExpand -
toggleClickCount
protected int toggleClickCount -
visibleRowCount
protected int visibleRowCount -
editable
protected boolean editable -
invokesStopCellEditing
protected boolean invokesStopCellEditing -
largeModel
protected boolean largeModel -
cellEditor
-
-
Constructor Details
-
JTree
public JTree()JDK shape: shows the sample demo model. -
JTree
-
JTree
-
JTree
-
JTree
-
JTree
-
JTree
-
-
Method Details
-
reconcileFields
public final void reconcileFields()D_field_write_reconcile repair hook — seeJSlider.reconcileFields().- Specified by:
reconcileFieldsin interfaceFieldReconciler.Reconcilable
-
getDefaultTreeModel
JDK's sample model (javax.swing.JTree.getDefaultTreeModel()): the "JTree" root with colors / sports / food children. -
createTreeModel
JDK'screateTreeModelshape: wrap the entries under a synthetic "root" node (hidden by the calling ctor'ssetRootVisible(false)). Nested arrays / Vectors / Hashtables recurse — the eager equivalent of the JDK's lazyDynamicUtilTreeNodeexpansion (R_best_effort_behaviour). -
getModel
-
setModel
-
getCellRenderer
-
setCellRenderer
-
convertValueToText
public String convertValueToText(Object value, boolean selected, boolean expanded, boolean leaf, int row, boolean hasFocus) The JDK-overridable node-to-text formatting hook the default renderer's text flows through. Subclasses overriding this (a common migration pattern) take effect on every rendered cell. -
isRootVisible
public boolean isRootVisible() -
setRootVisible
public void setRootVisible(boolean rootVisible) -
getSelectionModel
-
setSelectionModel
-
setSelectionPath
-
setSelectionPaths
-
addSelectionPath
-
addSelectionPaths
-
removeSelectionPath
-
removeSelectionPaths
-
getSelectionPath
-
getSelectionPaths
-
getSelectionCount
public int getSelectionCount() -
isPathSelected
-
isSelectionEmpty
public boolean isSelectionEmpty() -
clearSelection
public void clearSelection() -
getLastSelectedPathComponent
-
getLeadSelectionPath
- Returns:
- this tree's own lead path, not the selection model's —
they are two stores and the JDK keeps them apart: measured on
JDK 25,
setLeadSelectionPath(pathNotInTheTree)moves this one and leaves the model's where it was. What holds them in step on an ordinary selection change issyncAnchorAndLeadFromSelection().
-
setSelectionRow
public void setSelectionRow(int row) -
setSelectionRows
public void setSelectionRows(int[] rows) -
addSelectionRow
public void addSelectionRow(int row) -
addSelectionRows
public void addSelectionRows(int[] rows) -
removeSelectionRow
public void removeSelectionRow(int row) -
removeSelectionRows
public void removeSelectionRows(int[] rows) -
setSelectionInterval
public void setSelectionInterval(int index0, int index1) -
addSelectionInterval
public void addSelectionInterval(int index0, int index1) -
removeSelectionInterval
public void removeSelectionInterval(int index0, int index1) -
getSelectionRows
public int[] getSelectionRows()Resolved through the installedRowMapper(the visible-node walk). -
getMinSelectionRow
public int getMinSelectionRow() -
getMaxSelectionRow
public int getMaxSelectionRow() -
getLeadSelectionRow
public int getLeadSelectionRow() -
isRowSelected
public boolean isRowSelected(int row) -
addTreeSelectionListener
-
removeTreeSelectionListener
-
getTreeSelectionListeners
-
fireValueChanged
-
expandPath
-
collapsePath
-
expandRow
public void expandRow(int row) -
collapseRow
public void collapseRow(int row) -
isExpanded
Whetherpathand every one of its ancestors is expanded. -
isExpanded
public boolean isExpanded(int row) The node atrow's own expanded flag; its ancestors are expanded, or it would have no row. -
isCollapsed
-
isCollapsed
public boolean isCollapsed(int row) -
hasBeenExpanded
Whetherpathwas ever expanded or collapsed, as the JDK's toggled-paths table records. -
makeVisible
-
isVisible
-
scrollPathToVisible
Expands ancestors (firing TreeExpansionEvents) then scrolls, when the path is then visible; R_layouts_close_enough — no pixel guarantee. -
scrollRowToVisible
public void scrollRowToVisible(int row) -
getExpandedDescendants
The expanded, visible descendants ofparent, excludingparent; empty when there are none,nullwhenparentis not expanded. Read from the toggled-paths table, so in no particular order, as in the JDK. -
setExpandedState
The JDK's expansion engine. Expands every collapsed ancestor first, each vetoable by aTreeWillExpandListenerand announced to theTreeExpansionListeners, then expands or collapsespathitself the same way; a veto stops the walk where it lands. Collapsing moves a selection inside the collapsed subtree ontopath. Every change is flushed to the peer. -
clearToggledPaths
protected void clearToggledPaths()Clears the toggled-paths table; fires nothing, as in the JDK. -
removeDescendantToggledPaths
Removes every toggled path under each oftoRemove, the paths themselves included. -
getDescendantToggledPaths
The toggled paths underparent,parentincluded. -
removeDescendantSelectedPaths
Removes the selected paths underpath;trueif there were any. -
createTreeModelListener
TheJTree.TreeModelHandlerthe JDK subscribes to the model; an override may return its own, ornullfor none. -
addTreeExpansionListener
-
removeTreeExpansionListener
-
getTreeExpansionListeners
-
fireTreeExpanded
Notifies theTreeExpansionListeners last to first, as the JDK does. -
fireTreeCollapsed
Notifies theTreeExpansionListeners last to first, as the JDK does. -
addTreeWillExpandListener
Fired before every expansion and collapse, programmatic or the user's, and a veto holds, as in the JDK. For a toggle in the browser the peer has already opened or closed the node by then; a veto closes or reopens it again, so the user may see it flicker. -
removeTreeWillExpandListener
-
getTreeWillExpandListeners
-
fireTreeWillExpand
Notifies theTreeWillExpandListeners last to first, as the JDK does; the first veto stops it.- Throws:
ExpandVetoException
-
fireTreeWillCollapse
Notifies theTreeWillExpandListeners last to first, as the JDK does; the first veto stops it.- Throws:
ExpandVetoException
-
getRowCount
public int getRowCount() -
getPathForRow
-
getRowForPath
-1when an ancestor is collapsed, so the path has no row. -
getRowForLocation
public int getRowForLocation(int x, int y) The clicked row during a user mouse handler's dispatch (theselectOnRightClickidiom), -1 otherwise, whatever the coordinates: there is no server-side pixel→row map (R_layouts_close_enough). The call graph is the JDK's, so an override of any method it reaches runs. -
getPathForLocation
The clicked path during a mouse handler's dispatch, null otherwise — seegetRowForLocation(int, int). -
getClosestPathForLocation
The clicked path during a mouse handler's dispatch, null otherwise — seegetRowForLocation(int, int). -
getClosestRowForLocation
public int getClosestRowForLocation(int x, int y) -
getPathBounds
-
getRowBounds
R_layouts_close_enough — no server-side cell bounds. -
getShowsRootHandles
public boolean getShowsRootHandles() -
setShowsRootHandles
public void setShowsRootHandles(boolean newValue) -
getRowHeight
public int getRowHeight() -
setRowHeight
public void setRowHeight(int rowHeight) -
isFixedRowHeight
public boolean isFixedRowHeight()JDK: fixed row height means a positiverowHeight. -
getScrollsOnExpand
public boolean getScrollsOnExpand() -
setScrollsOnExpand
public void setScrollsOnExpand(boolean newValue) -
getToggleClickCount
public int getToggleClickCount() -
setToggleClickCount
public void setToggleClickCount(int clickCount) -
getVisibleRowCount
public int getVisibleRowCount() -
setVisibleRowCount
public void setVisibleRowCount(int newCount) -
getExpandsSelectedPaths
public boolean getExpandsSelectedPaths() -
setExpandsSelectedPaths
public void setExpandsSelectedPaths(boolean newValue) -
getInvokesStopCellEditing
public boolean getInvokesStopCellEditing() -
setInvokesStopCellEditing
public void setInvokesStopCellEditing(boolean newValue) -
isLargeModel
public boolean isLargeModel() -
setLargeModel
public void setLargeModel(boolean newValue) -
getAnchorSelectionPath
-
setAnchorSelectionPath
-
setLeadSelectionPath
-
isEditable
public boolean isEditable() -
setEditable
public void setEditable(boolean flag) Arms rename-in-place editing — double-click a node, or callstartEditingAtPath(TreePath).falsedisarms it. Round-trips per R_swing_is_truth + fires the"editable"PCE. -
isPathEditable
JDK subclass hook — defaults toisEditable(). -
getCellEditor
- Returns:
- the editor
setCellEditor(TreeCellEditor)installed, ornull— rename-in-place is driven internally and never routes through one
-
setCellEditor
Stores the editor and fires"cellEditor"; the editor is inert. Installing an arbitrary editor component stays out per D_gap_severity_triage sub-bucket (b), and the built-in text rename (setEditable(boolean)) is the only editing reproduced — that is the declined effect. State and notification are owed regardless (R_decline_effect_only, D_owed_events). -
isEditing
public boolean isEditing() -
getEditingPath
-
startEditingAtPath
Selectspathand opens a text editor on its node, seeded fromconvertValueToText(Object, boolean, boolean, boolean, int, boolean). No-op unless the tree iseditableandisPathEditable(TreePath)allows the path. Any in-flight edit commits first (JDK terminate-by-commit). -
stopEditing
public boolean stopEditing()Commits the in-flight edit (write-back viavalueForPathChanged);trueif editing was in progress. -
cancelEditing
public void cancelEditing()Cancels the in-flight edit with no write-back. -
getNextMatch
WARN — type-ahead node search isn't modelled. -
getDragEnabled
public boolean getDragEnabled() -
setDragEnabled
public void setDragEnabled(boolean b) -
getDropMode
-
setDropMode
-
getPreferredScrollableViewportSize
- Specified by:
getPreferredScrollableViewportSizein interfaceScrollable
-
getScrollableUnitIncrement
- Specified by:
getScrollableUnitIncrementin interfaceScrollable
-
getScrollableBlockIncrement
- Specified by:
getScrollableBlockIncrementin interfaceScrollable
-
getScrollableTracksViewportWidth
public boolean getScrollableTracksViewportWidth()- Specified by:
getScrollableTracksViewportWidthin interfaceScrollable
-
getScrollableTracksViewportHeight
public boolean getScrollableTracksViewportHeight()- Specified by:
getScrollableTracksViewportHeightin interfaceScrollable
-
getUIClassID
- Overrides:
getUIClassIDin classJComponent
-
updateUI
public void updateUI()- Overrides:
updateUIin classJComponent
-
getUI
- Overrides:
getUIin classJComponent
-
setUI
-
getAccessibleContext
- Specified by:
getAccessibleContextin interfaceAccessible- Overrides:
getAccessibleContextin classComponent
-