WebObjects 5.4.2

com.webobjects.eointerface.swing
Class EOTextColumnEditor

java.lang.Object
  extended by com.webobjects.eointerface.swing.EOColumnEditor
      extended by com.webobjects.eointerface.swing.EOTextColumnEditor
All Implemented Interfaces:
ActionListener, FocusListener, EventListener, CellEditor, DocumentListener, 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()

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()

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

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

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

createEditorComponent

protected Component createEditorComponent()
Returns a new editor component, a javax.swing.JTextField with a black javax.swing.border.LineBorder.

Specified by:
createEditorComponent in class EOColumnEditor
Returns:
the text field editor component

setCellEditorValue

public void setCellEditorValue(Object value)
Sets the value of the text field editor component (the text displayed in the editor cell).

Specified by:
setCellEditorValue in class EOColumnEditor
Parameters:
value - the editor value
See Also:
EOColumnEditor.getTableCellEditorComponent(javax.swing.JTable, java.lang.Object, boolean, int, int)

getCellEditorValue

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

Specified by:
getCellEditorValue in interface CellEditor
Overrides:
getCellEditorValue in class EOColumnEditor
Returns:
value the editor value

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.

Specified by:
isCellEditable in interface CellEditor
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

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
See Also:
EOColumnEditor.shouldSelectCell(java.util.EventObject), EOColumnEditor.getTableCellEditorComponent(javax.swing.JTable, java.lang.Object, boolean, int, int)

endEditing

protected void endEditing()
Cleans out resources after editing has finished, for example removes listeners from the editor component.

Overrides:
endEditing in class EOColumnEditor
See Also:
EOColumnEditor.cancelCellEditing(), EOColumnEditor.stopCellEditing()

Last updated June 2008

Copyright © 2000-2008 Apple Inc.