org.scopemvc.view.swing
Class STextCellEditor

java.lang.Object
  |
  +--javax.swing.AbstractCellEditor
        |
        +--org.scopemvc.view.swing.STextCellEditor
All Implemented Interfaces:
javax.swing.CellEditor, java.io.Serializable
Direct Known Subclasses:
STableTextCellEditor

public abstract class STextCellEditor
extends javax.swing.AbstractCellEditor

Base class for cell editors based on Swing's JTextComponent. It is validating editor - it means, that stopCellEditing can return false.

Difference between a Swing's and this cell editor is that Swing always returns String value, whereas STextCellEditor uses StringConvertor to return object of desired type.

Note: This editor fixes in unbelievable simple way Sun's editor unpleasant bug - when You start cell editing with keyboard, not mouse, the text field has no cursor (in 1.3.1 and 1.4 beta)

Version:
$Revision: 1.6 $ $Date: 2002/09/05 15:41:49 $
Author:
Daniel Michalik
See Also:
Serialized Form

Field Summary
protected  javax.swing.text.JTextComponent component
          TODO: describe of the Field
 
Fields inherited from class javax.swing.AbstractCellEditor
changeEvent, listenerList
 
Constructor Summary
STextCellEditor(StringConvertor inConvertor)
          Creates new SDefaultCellRenderer
 
Method Summary
 void cancelCellEditing()
          TODO: document the method
protected  javax.swing.text.JTextComponent createTextComponent()
          TODO: document the method
 java.lang.Object getCellEditorValue()
          Gets the cell editor value
 int getClickCountToStart()
          ClickCountToStart controls the number of clicks required to start editing.
 StringConvertor getStringConvertor()
          Gets the string convertor
 boolean isCellEditable(java.util.EventObject anEvent)
          Editable for mause click events if click count is equals or greater then getClickCountToStart().
protected  boolean isValidating()
          Returns true.
 void setClickCountToStart(int count)
          Specifies the number of clicks needed to start editing.
protected  void setValue(java.lang.Object inValue)
          Sets value for editing.
 boolean stopCellEditing()
          TODO: document the method
 
Methods inherited from class javax.swing.AbstractCellEditor
addCellEditorListener, fireEditingCanceled, fireEditingStopped, getCellEditorListeners, removeCellEditorListener, shouldSelectCell
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

component

protected javax.swing.text.JTextComponent component
TODO: describe of the Field

Constructor Detail

STextCellEditor

public STextCellEditor(StringConvertor inConvertor)
                throws java.lang.IllegalArgumentException
Creates new SDefaultCellRenderer

Parameters:
inConvertor - TODO: Describe the Parameter
Throws:
java.lang.IllegalArgumentException - TODO: Describe the Exception
Method Detail

getStringConvertor

public final StringConvertor getStringConvertor()
Gets the string convertor

Returns:
The stringConvertor value

getCellEditorValue

public final java.lang.Object getCellEditorValue()
Gets the cell editor value

Returns:
The cellEditorValue value

getClickCountToStart

public final int getClickCountToStart()
ClickCountToStart controls the number of clicks required to start editing. Default value is 2.

Returns:
The clickCountToStart value

isCellEditable

public boolean isCellEditable(java.util.EventObject anEvent)
Editable for mause click events if click count is equals or greater then getClickCountToStart(). For all other event types returns true.

Specified by:
isCellEditable in interface javax.swing.CellEditor
Overrides:
isCellEditable in class javax.swing.AbstractCellEditor
Parameters:
anEvent - TODO: Describe the Parameter
Returns:
The cellEditable value

setClickCountToStart

public final void setClickCountToStart(int count)
Specifies the number of clicks needed to start editing.

Parameters:
count - an int specifying the number of clicks needed to start editing
See Also:
getClickCountToStart()

cancelCellEditing

public final void cancelCellEditing()
TODO: document the method

Specified by:
cancelCellEditing in interface javax.swing.CellEditor
Overrides:
cancelCellEditing in class javax.swing.AbstractCellEditor

stopCellEditing

public final boolean stopCellEditing()
TODO: document the method

Specified by:
stopCellEditing in interface javax.swing.CellEditor
Overrides:
stopCellEditing in class javax.swing.AbstractCellEditor
Returns:
TODO: Describe the Return Value

isValidating

protected boolean isValidating()
Returns true.

Returns:
The validating value

setValue

protected final void setValue(java.lang.Object inValue)
                       throws java.lang.IllegalArgumentException
Sets value for editing. Value is converted into String with StringConvertor . For use in inherited classes.

Parameters:
inValue - The new value value
Throws:
java.lang.IllegalArgumentException - if converted cannot convert passed value.

createTextComponent

protected javax.swing.text.JTextComponent createTextComponent()
TODO: document the method

Returns:
TODO: Describe the Return Value


Copyright © 2000-2002 The Scope Team. All Rights Reserved.