javax.swing

Interface CellEditor

public interface CellEditor

Provides edit capabilities for components that display cells like {@link JTable}, {@link JList} and {@link JTree}.
Method Summary
voidaddCellEditorListener(CellEditorListener listener)
Registers a listener to receive {@link ChangeEvent} notifications from the CellEditor.
voidcancelCellEditing()
Signals to the CellEditor that it should cancel editing.
ObjectgetCellEditorValue()
Returns the current value for the CellEditor.
booleanisCellEditable(EventObject event)
Returns true if the specified event makes the editor editable, and false otherwise.
voidremoveCellEditorListener(CellEditorListener listener)
Deregisters a listener so that it no longer receives {@link ChangeEvent} notifications from the CellEditor.
booleanshouldSelectCell(EventObject event)
shouldSelectCell
booleanstopCellEditing()
Signals to the CellEditor that it should stop editing, accepting the current cell value, and returns true if the editor actually stops editing, and false otherwise.

Method Detail

addCellEditorListener

public void addCellEditorListener(CellEditorListener listener)
Registers a listener to receive {@link ChangeEvent} notifications from the CellEditor.

Parameters: listener the listener.

cancelCellEditing

public void cancelCellEditing()
Signals to the CellEditor that it should cancel editing.

getCellEditorValue

public Object getCellEditorValue()
Returns the current value for the CellEditor.

Returns: The value.

isCellEditable

public boolean isCellEditable(EventObject event)
Returns true if the specified event makes the editor editable, and false otherwise.

Parameters: event the event.

Returns: A boolean.

removeCellEditorListener

public void removeCellEditorListener(CellEditorListener listener)
Deregisters a listener so that it no longer receives {@link ChangeEvent} notifications from the CellEditor.

Parameters: listener the listener.

shouldSelectCell

public boolean shouldSelectCell(EventObject event)
shouldSelectCell

Parameters: event TODO

Returns: boolean

stopCellEditing

public boolean stopCellEditing()
Signals to the CellEditor that it should stop editing, accepting the current cell value, and returns true if the editor actually stops editing, and false otherwise.

Returns: A boolean.