fri.gui.swing.polytreetable
Class PolyTreeTableCellEditor

java.lang.Object
  |
  +--javax.swing.AbstractCellEditor
        |
        +--javax.swing.DefaultCellEditor
              |
              +--fri.gui.swing.polytreetable.PolyTreeTableCellEditor
All Implemented Interfaces:
javax.swing.CellEditor, java.io.Serializable, javax.swing.table.TableCellEditor, javax.swing.tree.TreeCellEditor

public class PolyTreeTableCellEditor
extends javax.swing.DefaultCellEditor

CellEditor for the PolyTreeTable. Two clicks in the same cell start editing. It is left aligned if it is a parent node (above) or right aligned if it is a child node.

Author:
Ritzberger Fritz
See Also:
PolyTreeTableCellRenderer, Serialized Form

Field Summary
protected  javax.swing.JLabel icon
          The folder or leaf icon.
protected  javax.swing.JLabel icon2
          The second icon if it is the root node.
protected  javax.swing.JPanel panel
          The panel the editor lies in.
 
Fields inherited from class javax.swing.DefaultCellEditor
clickCountToStart, delegate, editorComponent
 
Fields inherited from class javax.swing.AbstractCellEditor
changeEvent, listenerList
 
Constructor Summary
PolyTreeTableCellEditor()
          Creates a CellEditor with a JTextField.
PolyTreeTableCellEditor(javax.swing.JCheckBox checkBox)
           
PolyTreeTableCellEditor(javax.swing.JComboBox comboBox)
           
PolyTreeTableCellEditor(javax.swing.JTextField textfield)
           
 
Method Summary
 java.awt.Component getTableCellEditorComponent(javax.swing.JTable table, java.lang.Object value, boolean selected, int row, int col)
          Prepares a panel by retrieving the icon from renderer and sets the original Component into it.
 boolean isCellEditable(java.util.EventObject anEvent)
          Overridden to start editing when clicked to text label two times, slowly.
 
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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.swing.CellEditor
addCellEditorListener, removeCellEditorListener
 

Field Detail

panel

protected javax.swing.JPanel panel
The panel the editor lies in.


icon

protected javax.swing.JLabel icon
The folder or leaf icon.


icon2

protected javax.swing.JLabel icon2
The second icon if it is the root node.

Constructor Detail

PolyTreeTableCellEditor

public PolyTreeTableCellEditor()
Creates a CellEditor with a JTextField.


PolyTreeTableCellEditor

public PolyTreeTableCellEditor(javax.swing.JTextField textfield)

PolyTreeTableCellEditor

public PolyTreeTableCellEditor(javax.swing.JComboBox comboBox)

PolyTreeTableCellEditor

public PolyTreeTableCellEditor(javax.swing.JCheckBox checkBox)
Method Detail

getTableCellEditorComponent

public java.awt.Component getTableCellEditorComponent(javax.swing.JTable table,
                                                      java.lang.Object value,
                                                      boolean selected,
                                                      int row,
                                                      int col)
Prepares a panel by retrieving the icon from renderer and sets the original Component into it.

Specified by:
getTableCellEditorComponent in interface javax.swing.table.TableCellEditor
Overrides:
getTableCellEditorComponent in class javax.swing.DefaultCellEditor

isCellEditable

public boolean isCellEditable(java.util.EventObject anEvent)
Overridden to start editing when clicked to text label two times, slowly. This method gets invoked each time the cell is focused.

Specified by:
isCellEditable in interface javax.swing.CellEditor
Overrides:
isCellEditable in class javax.swing.DefaultCellEditor