WebObjects 5.2

com.webobjects.eointerface.swing
Class EOTextColumnEditor

java.lang.Object
  |
  +--com.webobjects.eointerface.swing.EOColumnEditor
        |
        +--com.webobjects.eointerface.swing.EOTextColumnEditor
All Implemented Interfaces:
ActionListener, CellEditor, DocumentListener, EventListener, FocusListener, TableCellEditor

public class EOTextColumnEditor
extends EOColumnEditor
implements ActionListener, DocumentListener, FocusListener

EOTextColumnEditor is an concrete subclass of EOColumnEditor that handles text cell editing for javax.swing.JTables.

See Also:
EOColumnEditor

Constructor Summary
EOTextColumnEditor()
          Constructs a new EOTextColumnEditor.
 
Method Summary
 void actionPerformed(ActionEvent event)
          Invoked when the user leaves the edited text cell.
protected  void beginEditing()
          Prepares the editor component for use in a table, by adding the appropriate listeners and setting the right fonts.
 void changedUpdate(DocumentEvent event)
          Conformance to DocumentListener API.
protected  Component createEditorComponent()
          Returns a new editor component, a javax.swing.JTextField with a black javax.swing.border.LineBorder.
protected  void endEditing()
          Cleans out resources after editing has finished, for example removes listeners from the editor component.
 void focusGained(FocusEvent event)
          Invoked when the edited text cell gains focus.
 void focusLost(FocusEvent event)
          Invoked when the edited text cell looses focus.
 Object getCellEditorValue()
          Returns the value of the text field editor component (the text displayed in the editor cell).
 void insertUpdate(DocumentEvent event)
          Conformance to DocumentListener API.
 boolean isCellEditable(EventObject event)
          Returns whether the event event can start editing in the editor component.
 void removeUpdate(DocumentEvent event)
          Conforming to DocumentListener API.
 void setCellEditorValue(Object value)
          Sets the value of the text field editor component (the text displayed in the editor cell).
 
Methods inherited from class com.webobjects.eointerface.swing.EOColumnEditor
addCellEditorListener, cancelCellEditing, editingTableColumnAssociation, editorComponent, fireEditingCanceled, fireEditingStopped, getTableCellEditorComponent, removeCellEditorListener, setEditorComponent, shouldSelectCell, stopCellEditing
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EOTextColumnEditor

public EOTextColumnEditor()
Constructs a new EOTextColumnEditor.
Method Detail

actionPerformed

public void actionPerformed(ActionEvent event)
Invoked when the user leaves the edited text cell. Invokes EOColumnEditor.stopCellEditing.
Specified by:
actionPerformed in interface ActionListener
Parameters:
event - the user event triggering this method invocation.
See Also:
EOColumnEditor.stopCellEditing()

beginEditing

protected void beginEditing()
Prepares the editor component for use in a table, by adding the appropriate listeners and setting the right fonts.
Overrides:
beginEditing in class EOColumnEditor
Following copied from class: com.webobjects.eointerface.swing.EOColumnEditor
See Also:
EOColumnEditor.shouldSelectCell(java.util.EventObject), EOColumnEditor.getTableCellEditorComponent(javax.swing.JTable, java.lang.Object, boolean, int, int)

changedUpdate

public void changedUpdate(DocumentEvent event)
Conformance to DocumentListener API.
Specified by:
changedUpdate in interface DocumentListener
Parameters:
event - the DocumentEvent received from the AWT event dispatcher

createEditorComponent

protected Component createEditorComponent()
Returns a new editor component, a javax.swing.JTextField with a black javax.swing.border.LineBorder.
Overrides:
createEditorComponent in class EOColumnEditor
Returns:
the text field editor component

endEditing

protected void endEditing()
Cleans out resources after editing has finished, for example removes listeners from the editor component.
Overrides:
endEditing in class EOColumnEditor
Following copied from class: com.webobjects.eointerface.swing.EOColumnEditor
See Also:
EOColumnEditor.cancelCellEditing(), EOColumnEditor.stopCellEditing()

focusGained

public void focusGained(FocusEvent event)
Invoked when the edited text cell gains focus.
Specified by:
focusGained in interface FocusListener
Parameters:
event - the focus event triggering this method invocation

focusLost

public void focusLost(FocusEvent event)
Invoked when the edited text cell looses focus. Invokes EOColumnEditor.stopCellEditing.
Specified by:
focusLost in interface FocusListener
Parameters:
event - the focus event triggering this method invocation
See Also:
EOColumnEditor.stopCellEditing()

getCellEditorValue

public Object getCellEditorValue()
Returns the value of the text field editor component (the text displayed in the editor cell).
Overrides:
getCellEditorValue in class EOColumnEditor
Returns:
value the editor value

insertUpdate

public void insertUpdate(DocumentEvent event)
Conformance to DocumentListener API.
Specified by:
insertUpdate in interface DocumentListener
Parameters:
event - the DocumentEvent received from the AWT event dispatcher

isCellEditable

public boolean isCellEditable(EventObject event)
Returns whether the event event can start editing in the editor component. For EOTextColumnEditors, editing can start if event is not a mouse event or if the click count is less than 2.
Overrides:
isCellEditable in class EOColumnEditor
Parameters:
event - the event to be used by the editor to consider whether editing can start or not
Returns:
true if editing can be started

removeUpdate

public void removeUpdate(DocumentEvent event)
Conforming to DocumentListener API.
Specified by:
removeUpdate in interface DocumentListener
Parameters:
event - the DocumentEvent received from the AWT event dispatcher

setCellEditorValue

public void setCellEditorValue(Object value)
Sets the value of the text field editor component (the text displayed in the editor cell).
Overrides:
setCellEditorValue in class EOColumnEditor
Parameters:
value - the editor value

Last updated Fri Feb 21 13:15:00 PST 2003.

Copyright © 2003 Apple Computer, Inc.