Package jadex.commons.gui.jtreetable
Class JTreeTable.TreeTableCellEditor
- java.lang.Object
-
- javax.swing.AbstractCellEditor
-
- javax.swing.DefaultCellEditor
-
- jadex.commons.gui.jtreetable.JTreeTable.TreeTableCellEditor
-
- All Implemented Interfaces:
java.io.Serializable
,javax.swing.CellEditor
,javax.swing.table.TableCellEditor
,javax.swing.tree.TreeCellEditor
- Enclosing class:
- JTreeTable
public class JTreeTable.TreeTableCellEditor extends javax.swing.DefaultCellEditor
An editor that can be used to edit the tree column. This extends DefaultCellEditor and uses a JTextField (actually, TreeTableTextField) to perform the actual editing.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.
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description TreeTableCellEditor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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.-
Methods inherited from class javax.swing.DefaultCellEditor
cancelCellEditing, getCellEditorValue, getClickCountToStart, getComponent, getTreeCellEditorComponent, setClickCountToStart, shouldSelectCell, stopCellEditing
-
Methods inherited from class javax.swing.AbstractCellEditor
addCellEditorListener, fireEditingCanceled, fireEditingStopped, getCellEditorListeners, removeCellEditorListener
-
-
-
-
Method Detail
-
getTableCellEditorComponent
public 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. The offset is determined from thegetRowBounds
JTree method, and additionally from the icon DefaultTreeCellRenderer will use.- Specified by:
getTableCellEditorComponent
in interfacejavax.swing.table.TableCellEditor
- Overrides:
getTableCellEditorComponent
in classjavax.swing.DefaultCellEditor
-
isCellEditable
public boolean isCellEditable(java.util.EventObject e)
This is overridden to forward the event to the tree. This will return true if the click count >= 3, or the event is null.- Specified by:
isCellEditable
in interfacejavax.swing.CellEditor
- Overrides:
isCellEditable
in classjavax.swing.DefaultCellEditor
-
-