Documentation Archive Developer
Search
PATH  Documentation > WebObjects 4.5 > EOInterface Reference

Table of Contents

EOColumnEditor


Inherits from:
Object
Implements:
javax.swing.table.TableCellEditor
javax.swing.CellEditor (javax.swing.table.TableCellEditor)
Package:
com.apple.client.eointerface


Class Description


EOColumnEditor is an abstract class that implements generalized cell editing management for javax.swing.JTables. Swing specifies that JTable cell editing is performed by an object implementing the javax.swing.table.TableCellEditor interface. EOColumnEditor implements this interface in a generalized way, and concrete subclasses such as EOTextColumnEditor perform component-specific instantiation and event communication.


Note: This class doesn't exist in the com.apple.yellow.eointerface package.

The most important function of an EOColumnEditor instance is mediating between its Component and the EOTableColumnAssociation that's bound to the edited column. This mediation enables the validation of edited values that associations are required to perform.

Create a subclass of EOColumnEditor if you want to use a Component for JTable editing for which no EOColumnEditor is implemented.




Interfaces Implemented


javax.swing.table.TableCellEditor
addCellEditorListener (javax.swing.CellEditor)
cancelCellEditing (javax.swing.CellEditor)
getCellEditorValue
getTableCellEditorComponent
isCellEditable
removeCellEditorListener (javax.swing.CellEditor)
shouldSelectCell
stopCellEditing


Method Types


Instantiation
createEditorComponent
editingTableColumnAssociation
editorComponent
setCellEditorValue
setEditorComponent
Event handling
beginEditing
endEditing


Instance Methods



beginEditing

protected void beginEditing()

Invoked from shouldSelectCell and getTableCellEditorComponent to inform the receiver that editing has been requested and should begin (shouldSelectCell is invoked only by mouse clicks). EOColumnEditor's implementation sends associationDidBeginEditing to the EODisplayGroup of the EOTableColumnAssociation that's bound to the receiver's TableColumn; so subclasses should invoke super's implementation before activating their Component.

createEditorComponent

protected abstract java.awt.Component createEditorComponent()

Creates and returns a Component to perform the editing-a JTextField or JComboBox, for example. Invoked in EOColumnEditor's constructor, this method must be overridden by every subclass in order to create and return the Component it manages.

editingTableColumnAssociation

protected com.apple.client.eointerface.EOTableColumnAssociation editingTableColumnAssociation()

Returns the EOTableColumnAssociation that's bound to the column being edited, which is cached in EOColumnEditor's implementation of shouldSelectCell and getTableCellEditorComponent.

editorComponent

public java.awt.Component editorComponent()

Returns the receiver's Component-a user interface control that implements the editing mechanism. EOColumnEditor caches the Component in the constructor (in the method createEditorComponent, which is invoked from the constructor).

endEditing

protected void endEditing()

Invoked from cancelCellEditing and stopCellEditing to inform the receiver that it should end editing. EOColumnEditor's implementation sends associationDidEndEditing to the EODisplayGroup of the EOTableColumnAssociation that's bound to the receiver's TableColumn. Subclasses should invoke super's implementation after deactivating their Component.

getCellEditorValue

public Object getCellEditorValue()

Returns the receiver's editorComponent. EOColumnEditor's implementation simply returns null, so subclasses must override this method.

isCellEditable

public boolean isCellEditable(java.util.EventObject event)

Returns true if event is an event that should trigger editing, false otherwise. EOColumnEditor's implementation simply returns false. Subclasses must override this method.

setCellEditorValue

protected abstract void setCellEditorValue(Object initialValue)

Invoked from getTableCellEditorComponent to assign initialValue as the receiver's editorComponent. Subclasses must override this method.

setEditorComponent

public void setEditorComponent(java.awt.Component editorComponent)

Sets the receiver's editor component to editorComponent. Invoked by the constructor, where editorComponent is the Component returned from createEditorComponent.

shouldSelectCell

public boolean shouldSelectCell(java.util.EventObject event)

Returns true if event represents a legitimate selection trigger, or false otherwise. EOColumnEditor's implementation invokes beginEditing and returns true.

stopCellEditing

public boolean stopCellEditing()

Informs the receiver that it should stop editing. EOColumnEditor's implementation invokes endEditing and returns true.
Note: Validation failures aren't handled with this method. The boolean return value is ignored.




Table of Contents