dsto.dfc.swing.forms
Class FormToCellEditorAdapter

java.lang.Object
  extended by javax.swing.AbstractCellEditor
      extended by dsto.dfc.swing.forms.FormToCellEditorAdapter
All Implemented Interfaces:
FormEditorListener, Serializable, EventListener, CellEditor, TableCellEditor, TreeCellEditor

public class FormToCellEditorAdapter
extends AbstractCellEditor
implements FormEditorListener, TableCellEditor, TreeCellEditor

Allows any FormEditor to a be used in a JTable or JTree by adapting it to the tree/table cell editor interfaces.

Version:
$Revision$
Author:
Matthew Phillips
See Also:
Serialized Form

Field Summary
protected  FormEditor editor
           
 
Fields inherited from class javax.swing.AbstractCellEditor
changeEvent, listenerList
 
Constructor Summary
FormToCellEditorAdapter(FormEditor editor)
           
 
Method Summary
 void editCommitRequested(ChangeEvent e)
          Signals that the editor is ready to commit a value into the model.
 void editCommitted(ChangeEvent e)
          Signals that an edit has been committed into the model.
 Object getCellEditorValue()
           
 Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column)
           
 Component getTreeCellEditorComponent(JTree tree, Object value, boolean isSelected, boolean expanded, boolean leaf, int row)
           
 
Methods inherited from class javax.swing.AbstractCellEditor
addCellEditorListener, cancelCellEditing, fireEditingCanceled, fireEditingStopped, getCellEditorListeners, isCellEditable, removeCellEditorListener, shouldSelectCell, stopCellEditing
 
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, stopCellEditing
 

Field Detail

editor

protected FormEditor editor
Constructor Detail

FormToCellEditorAdapter

public FormToCellEditorAdapter(FormEditor editor)
Method Detail

getCellEditorValue

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

editCommitted

public void editCommitted(ChangeEvent e)
Description copied from interface: FormEditorListener
Signals that an edit has been committed into the model.

Specified by:
editCommitted in interface FormEditorListener

editCommitRequested

public void editCommitRequested(ChangeEvent e)
Description copied from interface: FormEditorListener
Signals that the editor is ready to commit a value into the model. Parent editors monitor will invoke commitEdits () on the the requesting editor if appropriate.

Specified by:
editCommitRequested in interface FormEditorListener

getTableCellEditorComponent

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

getTreeCellEditorComponent

public Component getTreeCellEditorComponent(JTree tree,
                                            Object value,
                                            boolean isSelected,
                                            boolean expanded,
                                            boolean leaf,
                                            int row)
Specified by:
getTreeCellEditorComponent in interface TreeCellEditor


Copyright © 2008 Commonwealth of Australia