APIdia Launch Partner
Top Description Methods
javax.swing.tree

public Interface TreeCellEditor

extends CellEditor
Known Direct Implementers
javax.swing.DefaultCellEditor, javax.swing.tree.DefaultTreeCellEditor
Imports
java.awt.Component, javax.swing.CellEditor, .JTree

Adds to CellEditor the extensions necessary to configure an editor in a tree.
Author
Scott Violet
See Also
javax.swing.JTree

Method Summary

Modifier and TypeMethod and Description
public Component

Returns:

the component for editing
getTreeCellEditorComponent
(JTree
the JTree that is asking the editor to edit; this parameter can be null
tree
,
Object
the value of the cell to be edited
value
,
boolean
true if the cell is to be rendered with selection highlighting
isSelected
,
boolean
true if the node is expanded
expanded
,
boolean
true if the node is a leaf node
leaf
,
int
the row index of the node being edited
row
)

Sets an initial value for the editor.

Inherited from javax.swing.CellEditor:
addCellEditorListenercancelCellEditinggetCellEditorValueisCellEditableremoveCellEditorListenershouldSelectCellstopCellEditing

Method Detail

getTreeCellEditorComponentback to summary
public Component getTreeCellEditorComponent(JTree tree, Object value, boolean isSelected, boolean expanded, boolean leaf, int row)

Sets an initial value for the editor. This will cause the editor to stopEditing and lose any partially edited value if the editor is editing when this method is called.

Returns the component that should be added to the client's Component hierarchy. Once installed in the client's hierarchy this component will then be able to draw and receive user input.

Parameters
tree:JTree

the JTree that is asking the editor to edit; this parameter can be null

value:Object

the value of the cell to be edited

isSelected:boolean

true if the cell is to be rendered with selection highlighting

expanded:boolean

true if the node is expanded

leaf:boolean

true if the node is a leaf node

row:int

the row index of the node being edited

Returns:Component

the component for editing