class ClosureCellEditor
extends AbstractCellEditor
implements TableCellEditor, TreeCellEditor
Cell editor implementation backed by builder closures for tables and trees.
| Type | Name and description |
|---|---|
Map<String, Closure> |
callbacksOptional callback closures invoked by invokeMethod(String, Object). |
List |
childrenChild components made available to editor closures. |
int |
columnTable column currently being edited, or -1 for tree editing. |
boolean |
defaultEditorIndicates whether the default Swing editor should be used as the backing child component. |
Closure |
editorValueClosure used to extract the current editor value. |
boolean |
expandedWhether the edited tree node is expanded. |
boolean |
leafWhether the edited tree node is a leaf. |
Closure |
prepareEditorClosure used to create or customize the editor component. |
int |
rowRow currently being edited. |
boolean |
selectedWhether the edited row is selected. |
JTable |
tableTable currently being edited, or null for tree editing. |
JTree |
treeTree currently being edited, or null for table editing. |
Object |
valueValue currently being edited. |
| Constructor and description |
|---|
ClosureCellEditor(Closure c, Map<String, Closure> callbacks)Creates a closure-backed cell editor. |
| Type Params | Return Type | Name and description |
|---|---|---|
|
Object |
getCellEditorValue()Returns the value supplied by the configured editor value closure. |
|
Component |
getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column)Prepares the editor context for table editing and returns the editor component. |
|
Component |
getTreeCellEditorComponent(JTree tree, Object value, boolean isSelected, boolean expanded, boolean leaf, int row)Prepares the editor context for tree editing and returns the editor component. |
|
Object |
invokeMethod(String name, Object args)Dispatches method invocations to registered callbacks before falling back to the normal meta-class lookup. |
|
void |
setEditorValue(Closure editorValue)Sets the closure used to extract the editor value. |
|
void |
setPrepareEditor(Closure prepareEditor)Sets the closure used to prepare the editor component. |
| Methods inherited from class | Name |
|---|---|
class AbstractCellEditor |
addCellEditorListener, cancelCellEditing, equals, getCellEditorListeners, getCellEditorValue, getClass, hashCode, isCellEditable, notify, notifyAll, removeCellEditorListener, shouldSelectCell, stopCellEditing, toString, wait, wait, wait |
Optional callback closures invoked by invokeMethod(String, Object).
Child components made available to editor closures.
Table column currently being edited, or -1 for tree editing.
Indicates whether the default Swing editor should be used as the backing child component.
Closure used to extract the current editor value.
Whether the edited tree node is expanded.
Whether the edited tree node is a leaf.
Closure used to create or customize the editor component.
Row currently being edited.
Whether the edited row is selected.
Table currently being edited, or null for tree editing.
Tree currently being edited, or null for table editing.
Value currently being edited.
Returns the value supplied by the configured editor value closure.
Prepares the editor context for table editing and returns the editor component.
table - the table requesting the editorvalue - the cell value being editedisSelected - whether the row is selectedrow - the view row indexcolumn - the view column indexPrepares the editor context for tree editing and returns the editor component.
tree - the tree requesting the editorvalue - the node value being editedisSelected - whether the node is selectedexpanded - whether the node is expandedleaf - whether the node is a leafrow - the visible row indexDispatches method invocations to registered callbacks before falling back to the normal meta-class lookup.
name - the invoked method nameargs - the invocation argumentsSets the closure used to extract the editor value.
The closure delegates to this editor with Closure.DELEGATE_FIRST resolution.
editorValue - the value-producing closureSets the closure used to prepare the editor component.
The closure delegates to this editor with Closure.DELEGATE_FIRST resolution.
prepareEditor - the preparation closureCopyright © 2003-2026 The Apache Software Foundation. All rights reserved.