guk.editIM
Class EditorWarper

java.lang.Object
  |
  +--javax.swing.AbstractCellEditor
        |
        +--javax.swing.DefaultCellEditor
              |
              +--guk.editIM.EditorWarper
All Implemented Interfaces:
javax.swing.CellEditor, java.io.Serializable, javax.swing.table.TableCellEditor, javax.swing.tree.TreeCellEditor

public class EditorWarper
extends javax.swing.DefaultCellEditor

Copies over the colors and font from the corresponding RENDERER when asked for a table cell EDITOR.

See Also:
DefaultCellEditor, Serialized Form

Inner classes inherited from class javax.swing.DefaultCellEditor
javax.swing.DefaultCellEditor.EditorDelegate
 
Fields inherited from class javax.swing.DefaultCellEditor
clickCountToStart, delegate, editorComponent
 
Fields inherited from class javax.swing.AbstractCellEditor
changeEvent, listenerList
 
Constructor Summary
EditorWarper(javax.swing.JTextField field)
           
 
Method Summary
 java.awt.Component getTableCellEditorComponent(javax.swing.JTable table, java.lang.Object value, boolean isSelected, int row, int column)
          Overridden so that we can copy the design from the RENDERER of the cell over to the editor (copying over foreground and background color, tool tip and font).
 
Methods inherited from class javax.swing.DefaultCellEditor
cancelCellEditing, getCellEditorValue, getClickCountToStart, getComponent, getTreeCellEditorComponent, isCellEditable, setClickCountToStart, shouldSelectCell, stopCellEditing
 
Methods inherited from class javax.swing.AbstractCellEditor
addCellEditorListener, fireEditingCanceled, fireEditingStopped, removeCellEditorListener
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 
Methods inherited from interface javax.swing.CellEditor
addCellEditorListener, removeCellEditorListener
 

Constructor Detail

EditorWarper

public EditorWarper(javax.swing.JTextField field)
Method Detail

getTableCellEditorComponent

public java.awt.Component getTableCellEditorComponent(javax.swing.JTable table,
                                                      java.lang.Object value,
                                                      boolean isSelected,
                                                      int row,
                                                      int column)
Overridden so that we can copy the design from the RENDERER of the cell over to the editor (copying over foreground and background color, tool tip and font). This can only happen when table is not null and both rendering and editing components are JComponents. In other cases, EditorWarper works like DefaultCellEditor.
Overrides:
getTableCellEditorComponent in class javax.swing.DefaultCellEditor
See Also:
DefaultCellEditor, TableCellRenderer