public class JTreeTable.TreeTableCellEditor
extends javax.swing.DefaultCellEditor
reshape method in the JTextField component to nudge the textfield to the location tree would place it. Since JTreeTable will paint the tree behind the editor everything should just work. So, that is what we are doing here. Determining of the icon position will only work if the TreeCellRenderer is an instance of DefaultTreeCellRenderer. If you need custom TreeCellRenderers, that don't descend from DefaultTreeCellRenderer, and you want to support editing in JTreeTable, you will have to do something similiar.
Constructor and Description |
---|
TreeTableCellEditor() |
Modifier and Type | Method and Description |
---|---|
java.awt.Component |
getTableCellEditorComponent(javax.swing.JTable table,
java.lang.Object value,
boolean isSelected,
int r,
int c)
Overridden to determine an offset that tree would place the
editor at.
|
boolean |
isCellEditable(java.util.EventObject e)
This is overridden to forward the event to the tree.
|
cancelCellEditing, getCellEditorValue, getClickCountToStart, getComponent, getTreeCellEditorComponent, setClickCountToStart, shouldSelectCell, stopCellEditing
addCellEditorListener, fireEditingCanceled, fireEditingStopped, getCellEditorListeners, removeCellEditorListener
public java.awt.Component getTableCellEditorComponent(javax.swing.JTable table, java.lang.Object value, boolean isSelected, int r, int c)
getRowBounds
JTree method, and additionally
from the icon DefaultTreeCellRenderer will use.
getTableCellEditorComponent
in interface javax.swing.table.TableCellEditor
getTableCellEditorComponent
in class javax.swing.DefaultCellEditor
public boolean isCellEditable(java.util.EventObject e)
isCellEditable
in interface javax.swing.CellEditor
isCellEditable
in class javax.swing.DefaultCellEditor