uk.ac.reload.editor.gui
Class ReloadAttributeEditor.AttributeCellEditor
java.lang.Object
javax.swing.AbstractCellEditor
uk.ac.reload.editor.gui.ReloadAttributeEditor.AttributeCellEditor
- All Implemented Interfaces:
- javax.swing.CellEditor, java.util.EventListener, java.awt.event.ItemListener, java.io.Serializable, javax.swing.table.TableCellEditor
- Enclosing class:
- ReloadAttributeEditor
- protected class ReloadAttributeEditor.AttributeCellEditor
- extends javax.swing.AbstractCellEditor
- implements javax.swing.table.TableCellEditor, java.awt.event.ItemListener
A Cell Editor Wrapper that delegates to two default Cell Editors
- See Also:
- Serialized Form
Field Summary |
protected javax.swing.JComboBox |
comboBox
|
protected javax.swing.DefaultCellEditor |
comboEditor
|
protected javax.swing.DefaultCellEditor |
editor
|
protected javax.swing.DefaultCellEditor |
textEditor
|
protected javax.swing.JTextField |
textField
|
Fields inherited from class javax.swing.AbstractCellEditor |
changeEvent, listenerList |
Method Summary |
java.lang.Object |
getCellEditorValue()
Get the value contained in the editor. |
java.awt.Component |
getTableCellEditorComponent(javax.swing.JTable table,
java.lang.Object value,
boolean isSelected,
int row,
int column)
Sets an initial value for the editor. |
void |
itemStateChanged(java.awt.event.ItemEvent ie)
Invoked when a ComboBox item has been selected or deselected by the user. |
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 |
comboBox
protected javax.swing.JComboBox comboBox
textField
protected javax.swing.JTextField textField
editor
protected javax.swing.DefaultCellEditor editor
textEditor
protected javax.swing.DefaultCellEditor textEditor
comboEditor
protected javax.swing.DefaultCellEditor comboEditor
ReloadAttributeEditor.AttributeCellEditor
public ReloadAttributeEditor.AttributeCellEditor()
- Default constructor
itemStateChanged
public void itemStateChanged(java.awt.event.ItemEvent ie)
- Invoked when a ComboBox item has been selected or deselected by the user.
- Specified by:
itemStateChanged
in interface java.awt.event.ItemListener
- Parameters:
ie
- a semantic event which indicates that an item was selected or deselected
getCellEditorValue
public java.lang.Object getCellEditorValue()
- Get the value contained in the editor.
- Specified by:
getCellEditorValue
in interface javax.swing.CellEditor
- Returns:
- the value contained in the editor
getTableCellEditorComponent
public java.awt.Component getTableCellEditorComponent(javax.swing.JTable table,
java.lang.Object value,
boolean isSelected,
int row,
int column)
- Sets an initial value for the editor. This will cause the editor to stopEditing and lose
any partially edited value if the editor is editing when this method is called.
Returns the component that should be added to the client's Component hierarchy. Once
installed in the client's hierarchy this component will then be able to draw and receive user input.
- Specified by:
getTableCellEditorComponent
in interface javax.swing.table.TableCellEditor
- Parameters:
table
- the JTable that is asking the editor to edit; can be nullvalue
- the value of the cell to be edited; it is up to the specific editor to interpret and
draw the value. For example, if value is the string "true", it could be rendered as a string or it
could be rendered as a check box that is checked. null is a valid valueisSelected
- true if the cell is to be rendered with highlightingrow
- the row of the cell being editedcolumn
- the column of the cell being edited