net.sf.jga.swing.spreadsheet
Class ComponentEditor

java.lang.Object
  extended by javax.swing.AbstractCellEditor
      extended by net.sf.jga.swing.spreadsheet.ComponentEditor
All Implemented Interfaces:
java.io.Serializable, javax.swing.CellEditor, javax.swing.table.TableCellEditor

public class ComponentEditor
extends javax.swing.AbstractCellEditor
implements javax.swing.table.TableCellEditor

TableCellEditor used when the contents of the cell are a JComponent. The component itself will be used as the editor

Copyright © 2005 David A. Hall

See Also:
Serialized Form

Field Summary
 
Fields inherited from class javax.swing.AbstractCellEditor
changeEvent, listenerList
 
Constructor Summary
ComponentEditor()
           
 
Method Summary
 java.lang.Object getCellEditorValue()
          Returns the value of the cell once the editing is complete.
static ComponentEditor getInstance()
          Returns a sharable ComponentEditor instance.
 java.awt.Component getTableCellEditorComponent(javax.swing.JTable table, java.lang.Object object, boolean isSelected, int row, int col)
          Returns the Component stored in the table at the given cell (expecting that the component is being passed as the 'object' parm), so that it may be temporarily made available to the user for interaction.
 boolean stopCellEditing()
          Overrides stopCellEditing to remove the focus from the component stored in the currently active cell.
 
Methods inherited from class javax.swing.AbstractCellEditor
addCellEditorListener, cancelCellEditing, fireEditingCanceled, fireEditingStopped, getCellEditorListeners, isCellEditable, removeCellEditorListener, shouldSelectCell
 
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, cancelCellEditing, isCellEditable, removeCellEditorListener, shouldSelectCell
 

Constructor Detail

ComponentEditor

public ComponentEditor()
Method Detail

getInstance

public static ComponentEditor getInstance()
Returns a sharable ComponentEditor instance.


getCellEditorValue

public java.lang.Object getCellEditorValue()
Returns the value of the cell once the editing is complete. The value is the same component that was stored in the cell, but it's state may have been changed in some way.

Specified by:
getCellEditorValue in interface javax.swing.CellEditor

getTableCellEditorComponent

public java.awt.Component getTableCellEditorComponent(javax.swing.JTable table,
                                                      java.lang.Object object,
                                                      boolean isSelected,
                                                      int row,
                                                      int col)
Returns the Component stored in the table at the given cell (expecting that the component is being passed as the 'object' parm), so that it may be temporarily made available to the user for interaction.

Specified by:
getTableCellEditorComponent in interface javax.swing.table.TableCellEditor

stopCellEditing

public boolean stopCellEditing()
Overrides stopCellEditing to remove the focus from the component stored in the currently active cell.

Specified by:
stopCellEditing in interface javax.swing.CellEditor
Overrides:
stopCellEditing in class javax.swing.AbstractCellEditor


Copyright © 2002-2006 David A. Hall. All Rights Reserved.