de.fesenmeyer.dbnormalizer.gui.util
Class JComponentCellEditor

java.lang.Object
  extended by de.fesenmeyer.dbnormalizer.gui.util.JComponentCellEditor
All Implemented Interfaces:
Serializable, CellEditor, TableCellEditor

public class JComponentCellEditor
extends Object
implements TableCellEditor, Serializable

An implementation of TableCellEditor which makes it possible to use an arbitrary JComponent as editor for a JTable. The implementation is based on the implementation of Zafir Anjum found at http://www.codeguru.com/java/articles/162.shtml.

Author:
DF
See Also:
Serialized Form

Field Summary
protected  ChangeEvent changeEvent
           
protected  JComponent editorComponent
           
protected  EventListenerList listenerList
           
 
Constructor Summary
JComponentCellEditor()
           
 
Method Summary
 void addCellEditorListener(CellEditorListener l)
           
 void cancelCellEditing()
           
protected  void fireEditingCanceled()
           
protected  void fireEditingStopped()
           
 Object getCellEditorValue()
           
 Component getComponent()
           
 Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column)
           
 boolean isCellEditable(EventObject anEvent)
           
 void removeCellEditorListener(CellEditorListener l)
           
 boolean shouldSelectCell(EventObject anEvent)
           
 boolean stopCellEditing()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

listenerList

protected EventListenerList listenerList

changeEvent

protected transient ChangeEvent changeEvent

editorComponent

protected JComponent editorComponent
Constructor Detail

JComponentCellEditor

public JComponentCellEditor()
Method Detail

getComponent

public Component getComponent()

getCellEditorValue

public Object getCellEditorValue()
Specified by:
getCellEditorValue in interface CellEditor

isCellEditable

public boolean isCellEditable(EventObject anEvent)
Specified by:
isCellEditable in interface CellEditor

shouldSelectCell

public boolean shouldSelectCell(EventObject anEvent)
Specified by:
shouldSelectCell in interface CellEditor

stopCellEditing

public boolean stopCellEditing()
Specified by:
stopCellEditing in interface CellEditor

cancelCellEditing

public void cancelCellEditing()
Specified by:
cancelCellEditing in interface CellEditor

addCellEditorListener

public void addCellEditorListener(CellEditorListener l)
Specified by:
addCellEditorListener in interface CellEditor

removeCellEditorListener

public void removeCellEditorListener(CellEditorListener l)
Specified by:
removeCellEditorListener in interface CellEditor

fireEditingStopped

protected void fireEditingStopped()

fireEditingCanceled

protected void fireEditingCanceled()

getTableCellEditorComponent

public Component getTableCellEditorComponent(JTable table,
                                             Object value,
                                             boolean isSelected,
                                             int row,
                                             int column)
Specified by:
getTableCellEditorComponent in interface TableCellEditor