net.sf.doolin.gui.field.table.editor
Class ComboTableCellEditor<V,E>

java.lang.Object
  extended by javax.swing.AbstractCellEditor
      extended by net.sf.doolin.gui.field.table.editor.ComboTableCellEditor<V,E>
Type Parameters:
V - Type of bean for the view
E - Type of bean for the rows
All Implemented Interfaces:
Serializable, CellEditor, TableCellEditor

public class ComboTableCellEditor<V,E>
extends AbstractCellEditor
implements TableCellEditor

Table cell editor based on a JComboBox.

Author:
Damien Coraboeuf
See Also:
Serialized Form

Field Summary
 
Fields inherited from class javax.swing.AbstractCellEditor
changeEvent, listenerList
 
Constructor Summary
ComboTableCellEditor()
           
 
Method Summary
 Object getCellEditorValue()
           
 FieldCombo<V,E> getFieldCombo()
          Gets the field definition for the combo box
 Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column)
           
protected  void init(JTable table)
          Initialises the combo box
 void setFieldCombo(FieldCombo<V,E> fieldCombo)
          Sets the field definition for the combo box
 
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
 

Constructor Detail

ComboTableCellEditor

public ComboTableCellEditor()
Method Detail

getCellEditorValue

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

getFieldCombo

public FieldCombo<V,E> getFieldCombo()
Gets the field definition for the combo box

Returns:
Field definition

getTableCellEditorComponent

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

init

protected void init(JTable table)
Initialises the combo box

Parameters:
table - Hosting table (must be a GUITable).

setFieldCombo

public void setFieldCombo(FieldCombo<V,E> fieldCombo)
Sets the field definition for the combo box

Parameters:
fieldCombo - Field definition


Copyright © 2011. All Rights Reserved.