javax.swing
Class DefaultCellEditor.EditorDelegate
protected
class
DefaultCellEditor.EditorDelegate
extends Object
implements ActionListener, ItemListener, Serializable
This changeable module access the editor component in the component
specific way. For instance, to set the value for JTextField, we need to
call setText(String), and for JCheckBox we need to call
setSelected(boolean). Each default editor has the component specific
derivative of this class. These derivatives are private inner classes of
the DefaultCellEditor.
The editor delegate is also set for the editor component as the action
listener. It listens for the events that indicate that editing has stopped.
Field Summary |
protected Object | value
The object value (updated when getting and setting the value). |
Method Summary |
void | actionPerformed(ActionEvent event)
This event is fired by the editor component (for instance, by pressing
ENTER in the JTextField. |
void | cancelCellEditing()
Cancel the cell editing session. |
Object | getCellEditorValue()
Get the value for the editor component. |
boolean | isCellEditable(EventObject event)
The default method returns true for the MouseEvent and false
for any other events.
|
void | itemStateChanged(ItemEvent event)
This event is fired by the editor component.The default method delegates
call to the EditorDelegate, finishing the editing session.
|
void | setValue(Object aValue)
Set the value for the editor component. |
boolean | shouldSelectCell(EventObject event)
Returns true to indicate that the editing cell can be selected.
|
boolean | startCellEditing(EventObject event)
Start editing session and returns true to indicate the editing has begun.
|
boolean | stopCellEditing()
Finish the cell editing session. |
protected Object value
The object value (updated when getting and setting the value).
protected EditorDelegate()
Constructor EditorDelegate
public void actionPerformed(ActionEvent event)
This event is fired by the editor component (for instance, by pressing
ENTER in the
JTextField. The default method delegates call to
the
EditorDelegate, finishing the editing session.
Parameters: event unused in default method
public void cancelCellEditing()
Cancel the cell editing session. This method notifies the registered
cell editor listeners (including the table) that the editing has been
canceled.
public Object getCellEditorValue()
Get the value for the editor component. This method is normally
overridden to obtain the value in the way, specific for the text
component, check box or combo box.
Returns: value the value of the component (String, Boolean or Number).
public boolean isCellEditable(EventObject event)
The default method returns true for the MouseEvent and false
for any other events.
Parameters: event the event to check
Returns: true if the passed event is the mouse event and false otherwise.
public void itemStateChanged(ItemEvent event)
This event is fired by the editor component.The default method delegates
call to the
EditorDelegate, finishing the editing session.
Parameters: event unused in default method
public void setValue(Object aValue)
Set the value for the editor component. This method is normally
overridden to set the value in the way, specific for the text
component, check box or combo box.
Parameters: aValue the value to set (String, Boolean or Number).
public boolean shouldSelectCell(EventObject event)
Returns true to indicate that the editing cell can be selected.
The default method returns true without action but may be overridden
in derived classes for more specific behavior.
Parameters: event unused in default method
Returns: true always
public boolean startCellEditing(EventObject event)
Start editing session and returns true to indicate the editing has begun.
The default method returns true without action but may be overridden
in derived classes for more specific behavior.
Parameters: event the event.
Returns: true, always
public boolean stopCellEditing()
Finish the cell editing session. This method notifies the registered
cell editor listeners (including the table) that the editing has been
stopped.
Returns: boolean