|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JTree
org.jdesktop.swingx.JXTree
public class JXTree
JXTree. PENDING: support filtering/sorting.
Nested Class Summary | |
---|---|
class |
JXTree.CellEditorRemover
This class tracks changes in the keyboard focus state. |
class |
JXTree.DelegatingRenderer
A decorator for the original TreeCellRenderer. |
protected static class |
JXTree.TreeAdapter
|
protected class |
JXTree.XTreeModelHandler
Listens to the model and updates the expandedState accordingly
when nodes are removed, or changed. |
Nested classes/interfaces inherited from class javax.swing.JTree |
---|
javax.swing.JTree.AccessibleJTree, javax.swing.JTree.DropLocation, javax.swing.JTree.DynamicUtilTreeNode, javax.swing.JTree.EmptySelectionModel, javax.swing.JTree.TreeModelHandler, javax.swing.JTree.TreeSelectionRedirector |
Nested classes/interfaces inherited from class javax.swing.JComponent |
---|
javax.swing.JComponent.AccessibleJComponent |
Nested classes/interfaces inherited from class java.awt.Container |
---|
java.awt.Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component |
---|
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
Field Summary | |
---|---|
protected CompoundHighlighter |
compoundHighlighter
|
protected ComponentAdapter |
dataAdapter
|
protected FilterPipeline |
filters
|
Fields inherited from class javax.swing.JTree |
---|
ANCHOR_SELECTION_PATH_PROPERTY, CELL_EDITOR_PROPERTY, CELL_RENDERER_PROPERTY, cellEditor, cellRenderer, editable, EDITABLE_PROPERTY, EXPANDS_SELECTED_PATHS_PROPERTY, INVOKES_STOP_CELL_EDITING_PROPERTY, invokesStopCellEditing, LARGE_MODEL_PROPERTY, largeModel, LEAD_SELECTION_PATH_PROPERTY, ROOT_VISIBLE_PROPERTY, rootVisible, ROW_HEIGHT_PROPERTY, rowHeight, SCROLLS_ON_EXPAND_PROPERTY, scrollsOnExpand, SELECTION_MODEL_PROPERTY, selectionModel, selectionRedirector, SHOWS_ROOT_HANDLES_PROPERTY, showsRootHandles, TOGGLE_CLICK_COUNT_PROPERTY, toggleClickCount, TREE_MODEL_PROPERTY, treeModel, treeModelListener, VISIBLE_ROW_COUNT_PROPERTY, visibleRowCount |
Fields inherited from class javax.swing.JComponent |
---|
accessibleContext, 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 |
---|
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 | |
---|---|
JXTree()
Constructs a JXTree with a sample model. |
|
JXTree(java.util.Hashtable value)
Constructs a JXTree created from a Hashtable which does not
display with root. |
|
JXTree(java.lang.Object[] value)
Constructs a JXTree with each element of the specified array
as the child of a new root node which is not displayed. |
|
JXTree(javax.swing.tree.TreeModel newModel)
Constructs an instance of JXTree which displays the root
node -- the tree is created using the specified data model. |
|
JXTree(javax.swing.tree.TreeNode root)
Constructs a JXTree with the specified TreeNode as its root,
which displays the root node. |
|
JXTree(javax.swing.tree.TreeNode root,
boolean asksAllowsChildren)
Constructs a JXTree with the specified TreeNode as its root,
which displays the root node and which decides whether a node is a leaf
node in the specified manner. |
|
JXTree(java.util.Vector value)
Constructs a JXTree with each element of the specified
Vector as the child of a new root node which is not displayed. |
Method Summary | |
---|---|
void |
addHighlighter(Highlighter highlighter)
Appends a Highlighter to the end of the list of used
Highlighter s. |
protected void |
analyseFocus()
This is called from cell editor listener if edit terminated. |
void |
collapseAll()
Collapses all nodes in the tree table. |
java.lang.String |
convertValueToText(java.lang.Object value,
boolean selected,
boolean expanded,
boolean leaf,
int row,
boolean hasFocus)
|
protected javax.swing.tree.TreeCellRenderer |
createDefaultCellRenderer()
Creates and returns the default cell renderer to use. |
protected javax.swing.event.ChangeListener |
createHighlighterChangeListener()
Creates and returns the ChangeListener observing Highlighters. |
protected TreeRolloverController<JXTree> |
createLinkController()
|
protected RolloverProducer |
createRolloverProducer()
creates and returns the RolloverProducer to use with this tree. |
protected javax.swing.event.TreeModelListener |
createTreeModelListener()
|
protected void |
doFind()
|
void |
expandAll()
Expands all nodes in the tree table. |
javax.swing.tree.TreeCellRenderer |
getCellRenderer()
|
protected ComponentAdapter |
getComponentAdapter()
|
protected ComponentAdapter |
getComponentAdapter(int index)
Convenience to access a configured ComponentAdapter. |
protected CompoundHighlighter |
getCompoundHighlighter()
Returns the CompoundHighlighter assigned to the table, null if none. |
protected javax.swing.event.ChangeListener |
getHighlighterChangeListener()
Returns the ChangeListener to use with highlighters. |
Highlighter[] |
getHighlighters()
Returns the Highlighter s used by this table. |
protected TreeRolloverController<JXTree> |
getLinkController()
|
Searchable |
getSearchable()
|
java.awt.Color |
getSelectionBackground()
Returns the background color for selected cells. |
java.awt.Color |
getSelectionForeground()
Returns the selection foreground color. |
javax.swing.tree.TreePath[] |
getSelectionPaths()
overridden to always return a not-null array (following SwingX convention). |
int[] |
getSelectionRows()
overridden to always return a not-null array (following SwingX convention). |
java.lang.String |
getStringAt(int row)
Returns the string representation of the cell value at the given position. |
java.lang.String |
getStringAt(javax.swing.tree.TreePath path)
Returns the string representation of the cell value at the given position. |
protected java.lang.reflect.Method |
getValueConversionMethod(javax.swing.tree.TreeModel model)
Tries to find and return a method for Object --> to String conversion on the model by reflection. |
javax.swing.tree.TreeCellRenderer |
getWrappedCellRenderer()
Returns the renderer installed by client code or the default if none has been set. |
boolean |
isOverwriteRendererIcons()
Returns a boolean indicating whether the per-tree icons should be copied to the renderer on setCellRenderer. |
boolean |
isRolloverEnabled()
returns the rolloverEnabled property. |
void |
removeHighlighter(Highlighter highlighter)
Removes the given Highlighter. |
void |
removeNotify()
Overridden to release the CellEditorRemover, if any. |
void |
setCellRenderer(javax.swing.tree.TreeCellRenderer renderer)
|
void |
setClosedIcon(javax.swing.Icon closedIcon)
Sets the Icon to use for a closed folder node. |
void |
setCollapsedIcon(javax.swing.Icon collapsedIcon)
Sets the Icon to use for the handle of a collapsed node. |
void |
setExpandedIcon(javax.swing.Icon expandedIcon)
Sets the Icon to use for the handle of an expanded node. |
void |
setHighlighters(Highlighter... highlighters)
Sets the Highlighter s to the table, replacing any old settings. |
void |
setLeafIcon(javax.swing.Icon leafIcon)
Sets the Icon to use for a leaf node. |
void |
setModel(javax.swing.tree.TreeModel newModel)
|
void |
setOpenIcon(javax.swing.Icon openIcon)
Sets the Icon to use for an open folder node. |
void |
setOverwriteRendererIcons(boolean overwrite)
Property to control whether per-tree icons should be copied to the renderer on setCellRenderer. |
void |
setRolloverEnabled(boolean rolloverEnabled)
Property to enable/disable rollover support. |
void |
setSearchable(Searchable searchable)
sets the Searchable for this editor. |
void |
setSelectionBackground(java.awt.Color selectionBackground)
Sets the background color for selected cells. |
void |
setSelectionForeground(java.awt.Color selectionForeground)
Sets the foreground color for selected cells. |
void |
startEditingAtPath(javax.swing.tree.TreePath path)
|
protected void |
updateHighlighterUI()
Updates highlighter after updateUI changes. |
void |
updateUI()
|
Methods inherited from class javax.swing.JTree |
---|
addSelectionInterval, addSelectionPath, addSelectionPaths, addSelectionRow, addSelectionRows, addTreeExpansionListener, addTreeSelectionListener, addTreeWillExpandListener, cancelEditing, clearSelection, clearToggledPaths, collapsePath, collapseRow, createTreeModel, expandPath, expandRow, fireTreeCollapsed, fireTreeExpanded, fireTreeWillCollapse, fireTreeWillExpand, fireValueChanged, getAccessibleContext, getAnchorSelectionPath, getCellEditor, getClosestPathForLocation, getClosestRowForLocation, getDefaultTreeModel, getDescendantToggledPaths, getDragEnabled, getDropLocation, getDropMode, getEditingPath, getExpandedDescendants, getExpandsSelectedPaths, getInvokesStopCellEditing, getLastSelectedPathComponent, getLeadSelectionPath, getLeadSelectionRow, getMaxSelectionRow, getMinSelectionRow, getModel, getNextMatch, getPathBetweenRows, getPathBounds, getPathForLocation, getPathForRow, getPreferredScrollableViewportSize, getRowBounds, getRowCount, getRowForLocation, getRowForPath, getRowHeight, getScrollableBlockIncrement, getScrollableTracksViewportHeight, getScrollableTracksViewportWidth, getScrollableUnitIncrement, getScrollsOnExpand, getSelectionCount, getSelectionModel, getSelectionPath, getShowsRootHandles, getToggleClickCount, getToolTipText, getTreeExpansionListeners, getTreeSelectionListeners, getTreeWillExpandListeners, getUI, getUIClassID, getVisibleRowCount, hasBeenExpanded, isCollapsed, isCollapsed, isEditable, isEditing, isExpanded, isExpanded, isFixedRowHeight, isLargeModel, isPathEditable, isPathSelected, isRootVisible, isRowSelected, isSelectionEmpty, isVisible, makeVisible, paramString, removeDescendantSelectedPaths, removeDescendantToggledPaths, removeSelectionInterval, removeSelectionPath, removeSelectionPaths, removeSelectionRow, removeSelectionRows, removeTreeExpansionListener, removeTreeSelectionListener, removeTreeWillExpandListener, scrollPathToVisible, scrollRowToVisible, setAnchorSelectionPath, setCellEditor, setDragEnabled, setDropMode, setEditable, setExpandedState, setExpandsSelectedPaths, setInvokesStopCellEditing, setLargeModel, setLeadSelectionPath, setRootVisible, setRowHeight, setScrollsOnExpand, setSelectionInterval, setSelectionModel, setSelectionPath, setSelectionPaths, setSelectionRow, setSelectionRows, setShowsRootHandles, setToggleClickCount, setUI, setVisibleRowCount, stopEditing, treeDidChange |
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, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, 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, 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, addMouseListener, 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, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, 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, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected FilterPipeline filters
protected CompoundHighlighter compoundHighlighter
protected ComponentAdapter dataAdapter
Constructor Detail |
---|
public JXTree()
JXTree
with a sample model. The default model
used by this tree defines a leaf node as any node without children.
public JXTree(java.lang.Object[] value)
JXTree
with each element of the specified array
as the child of a new root node which is not displayed. By default, this
tree defines a leaf node as any node without children.
This version of the constructor simply invokes the super class version
with the same arguments.
value
- an array of objects that are children of the root.public JXTree(java.util.Vector value)
JXTree
with each element of the specified
Vector as the child of a new root node which is not displayed.
By default, this tree defines a leaf node as any node without children.
This version of the constructor simply invokes the super class version
with the same arguments.
value
- an Vector of objects that are children of the root.public JXTree(java.util.Hashtable value)
JXTree
created from a Hashtable which does not
display with root. Each value-half of the key/value pairs in the HashTable
becomes a child of the new root node. By default, the tree defines a leaf
node as any node without children.
This version of the constructor simply invokes the super class version
with the same arguments.
value
- a Hashtable containing objects that are children of the root.public JXTree(javax.swing.tree.TreeNode root)
JXTree
with the specified TreeNode as its root,
which displays the root node. By default, the tree defines a leaf node as
any node without children.
This version of the constructor simply invokes the super class version
with the same arguments.
root
- root node of this treepublic JXTree(javax.swing.tree.TreeNode root, boolean asksAllowsChildren)
JXTree
with the specified TreeNode as its root,
which displays the root node and which decides whether a node is a leaf
node in the specified manner.
This version of the constructor simply invokes the super class version
with the same arguments.
root
- root node of this treeasksAllowsChildren
- if true, only nodes that do not allow children
are leaf nodes; otherwise, any node without children is a leaf node;DefaultTreeModel.asksAllowsChildren
public JXTree(javax.swing.tree.TreeModel newModel)
JXTree
which displays the root
node -- the tree is created using the specified data model.
This version of the constructor simply invokes the super class version
with the same arguments.
newModel
- the TreeModel
to use as the data modelMethod Detail |
---|
public void setModel(javax.swing.tree.TreeModel newModel)
setModel
in class javax.swing.JTree
protected java.lang.reflect.Method getValueConversionMethod(javax.swing.tree.TreeModel model)
String convertValueToText(Object);
PENDING JW: check - does this work with restricted permissions?
JW: widened access for testing - do test!
model
- the model to detect the method
Method
or null if the model has no method with
the expected signaturepublic java.lang.String convertValueToText(java.lang.Object value, boolean selected, boolean expanded, boolean leaf, int row, boolean hasFocus)
convertValueToText
in class javax.swing.JTree
protected javax.swing.event.TreeModelListener createTreeModelListener()
createTreeModelListener
in class javax.swing.JTree
protected void doFind()
public Searchable getSearchable()
public void setSearchable(Searchable searchable)
searchable
- public void collapseAll()
public void expandAll()
public int[] getSelectionRows()
getSelectionRows
in class javax.swing.JTree
public javax.swing.tree.TreePath[] getSelectionPaths()
getSelectionPaths
in class javax.swing.JTree
public void setHighlighters(Highlighter... highlighters)
Highlighter
s to the table, replacing any old settings.
None of the given Highlighters must be null.This is a bound property.
Note: as of version #1.257 the null constraint is enforced strictly. To remove all highlighters use this method without param.
highlighters
- zero or more not null highlighters to use for renderer decoration.
java.lang.NullPointerException
- if array is null or array contains null values.getHighlighters()
,
addHighlighter(Highlighter)
,
removeHighlighter(Highlighter)
public Highlighter[] getHighlighters()
Highlighter
s used by this table.
Maybe empty, but guarantees to be never null.
setHighlighters(Highlighter[])
public void addHighlighter(Highlighter highlighter)
Highlighter
to the end of the list of used
Highlighter
s. The argument must not be null.
highlighter
- the Highlighter
to add, must not be null.
java.lang.NullPointerException
- if Highlighter
is null.removeHighlighter(Highlighter)
,
setHighlighters(Highlighter[])
public void removeHighlighter(Highlighter highlighter)
Does nothing if the Highlighter is not contained.
highlighter
- the Highlighter to remove.addHighlighter(Highlighter)
,
setHighlighters(Highlighter...)
protected CompoundHighlighter getCompoundHighlighter()
#setCompoundHighlighter(CompoundHighlighter)
protected javax.swing.event.ChangeListener getHighlighterChangeListener()
ChangeListener
to use with highlighters. Lazily
creates the listener.
not-null
protected javax.swing.event.ChangeListener createHighlighterChangeListener()
Here: repaints the table on receiving a stateChanged.
public void setRolloverEnabled(boolean rolloverEnabled)
rolloverEnabled
- protected TreeRolloverController<JXTree> getLinkController()
protected TreeRolloverController<JXTree> createLinkController()
protected RolloverProducer createRolloverProducer()
RolloverProducer
to use with this treepublic boolean isRolloverEnabled()
public java.awt.Color getSelectionBackground()
Color
used for the background of
selected list itemssetSelectionBackground(java.awt.Color)
,
setSelectionForeground(java.awt.Color)
public java.awt.Color getSelectionForeground()
Color
object for the foreground propertysetSelectionForeground(java.awt.Color)
,
setSelectionBackground(java.awt.Color)
public void setSelectionForeground(java.awt.Color selectionForeground)
The default value of this property is defined by the look and feel implementation.
This is a JavaBeans bound property.
selectionForeground
- the Color
to use in the foreground
for selected list itemsgetSelectionForeground()
,
setSelectionBackground(java.awt.Color)
,
JComponent.setForeground(java.awt.Color)
,
JComponent.setBackground(java.awt.Color)
,
JComponent.setFont(java.awt.Font)
public void setSelectionBackground(java.awt.Color selectionBackground)
The default value of this property is defined by the look and feel implementation.
This is a JavaBeans bound property.
selectionBackground
- the Color
to use for the
background of selected cellsgetSelectionBackground()
,
setSelectionForeground(java.awt.Color)
,
JComponent.setForeground(java.awt.Color)
,
JComponent.setBackground(java.awt.Color)
,
JComponent.setFont(java.awt.Font)
public void updateUI()
Overridden to update selection background/foreground. Mimicking behaviour of ui-delegates for JTable, JList.
updateUI
in class javax.swing.JTree
protected void updateHighlighterUI()
updateUI
changes.
UIDependent
public java.lang.String getStringAt(int row)
row
- the row index of the cell in view coordinates
public java.lang.String getStringAt(javax.swing.tree.TreePath path)
path
- the TreePath representing the node.
public void setExpandedIcon(javax.swing.Icon expandedIcon)
Note: this will only succeed if the current ui delegate is a BasicTreeUI otherwise it will do nothing.
PENDING JW: incomplete api (no getter) and not a bound property.
expandedIcon
- the Icon to use for the handle of an expanded node.public void setCollapsedIcon(javax.swing.Icon collapsedIcon)
collapsedIcon
- the Icon to use for the handle of a collapsed node.public void setLeafIcon(javax.swing.Icon leafIcon)
Note: this will only succeed if current renderer is a DefaultTreeCellRenderer.
PENDING JW: this (all setXXIcon) is old api pulled up from the JXTreeTable. Need to review if we really want it - problematic if sharing the same renderer instance across different trees. PENDING JW: incomplete api (no getter) and not a bound property.
leafIcon
- the Icon to use for a leaf node.public void setOpenIcon(javax.swing.Icon openIcon)
openIcon
- the Icon to use for an open folder node.public void setClosedIcon(javax.swing.Icon closedIcon)
closedIcon
- the Icon to use for a closed folder node.public void setOverwriteRendererIcons(boolean overwrite)
The default value is false. PENDING: should update the current renderer's icons when setting to true?
overwrite
- a boolean to indicate if the per-tree Icons should
be copied to the new renderer on setCellRenderer.isOverwriteRendererIcons()
,
setLeafIcon(Icon)
,
setOpenIcon(Icon)
,
setClosedIcon(Icon)
public boolean isOverwriteRendererIcons()
setOverwriteRendererIcons(boolean)
,
setLeafIcon(Icon)
,
setOpenIcon(Icon)
,
setClosedIcon(Icon)
protected javax.swing.tree.TreeCellRenderer createDefaultCellRenderer()
DefaultTreeCellRenderer
.
Note: this implementation will be changed to return DefaultTreeRenderer
, once
WrappingProvider is reasonably stable.
public javax.swing.tree.TreeCellRenderer getCellRenderer()
Overridden to return the delegating renderer which is wrapped around the original to support highlighting. The returned renderer is of type DelegatingRenderer and guaranteed to not-null
getCellRenderer
in class javax.swing.JTree
setCellRenderer(TreeCellRenderer)
,
JXTree.DelegatingRenderer
public javax.swing.tree.TreeCellRenderer getWrappedCellRenderer()
setCellRenderer(TreeCellRenderer)
public void setCellRenderer(javax.swing.tree.TreeCellRenderer renderer)
Overridden to wrap the given renderer in a DelegatingRenderer to support highlighting.
Note: the wrapping implies that the renderer returned from the getCellRenderer
is not the renderer as given here, but the wrapper. To access the original,
use getWrappedCellRenderer
.
setCellRenderer
in class javax.swing.JTree
getWrappedCellRenderer()
,
getCellRenderer()
public void startEditingAtPath(javax.swing.tree.TreePath path)
Overridden to fix focus issues with editors. This method installs and updates the internal CellEditorRemover which to terminates ongoing edits if appropriate. Additionally, it registers a CellEditorListener with the cell editor to grab the focus back to tree, if appropriate.
startEditingAtPath
in class javax.swing.JTree
updateEditorRemover()
protected void analyseFocus()
public void removeNotify()
removeNotify
in class javax.swing.JComponent
protected ComponentAdapter getComponentAdapter()
protected ComponentAdapter getComponentAdapter(int index)
index
- the row index in view coordinates, must be valid.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |