com.jidesoft.grid
Class FormattedTextFieldCellEditor
java.lang.Object
javax.swing.AbstractCellEditor
com.jidesoft.grid.AbstractJideCellEditor
com.jidesoft.grid.ContextSensitiveCellEditor
com.jidesoft.grid.FormattedTextFieldCellEditor
- All Implemented Interfaces:
- ConverterContextSupport, EditorContextSupport, JideCellEditor, FocusListener, Serializable, EventListener, CellEditor, TableCellEditor
public class FormattedTextFieldCellEditor
- extends ContextSensitiveCellEditor
- implements FocusListener
This is a CellEditor which will assume userObject of a converter context as JFormattedTextField.AbstractFormatter and
use it on a FormattedTextField.
- See Also:
- Serialized Form
| Methods inherited from class com.jidesoft.grid.AbstractJideCellEditor |
addValidationListener, getClickCountToStart, getDefaultErrorBehavior, getValidationListeners, isAutoStopCellEditing, isCellEditable, isPassEnterKeyToTable, removeValidationListener, setAutoStopCellEditing, setClickCountToStart, setDefaultErrorBehavior, setPassEnterKeyToTable, validate |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
_textField
protected JFormattedTextField _textField
FormattedTextFieldCellEditor
public FormattedTextFieldCellEditor()
- Creates a FormattedTextFieldCellEditor with no format and String as default class. The format can be set by
following setConverterContext().
FormattedTextFieldCellEditor
public FormattedTextFieldCellEditor(Class<?> clazz)
- Creates a FormattedTextFieldCellEditor with no format and specified class. The format can be set by following
setConverterContext().
- Parameters:
clazz - the type.
FormattedTextFieldCellEditor
public FormattedTextFieldCellEditor(Class<?> clazz,
Format format)
- Creates a FormattedTextFieldCellEditor with specified class and format.
- Parameters:
clazz - the type.format - Format used to look up an AbstractFormatter
FormattedTextFieldCellEditor
public FormattedTextFieldCellEditor(Class<?> clazz,
JFormattedTextField.AbstractFormatter formatter)
- Creates a FormattedTextFieldCellEditor with specified class and formatter.
- Parameters:
clazz - the type.formatter - AbstractFormatter to use for formatting.
createFormattedTextField
protected JFormattedTextField createFormattedTextField(Format format)
- Creates the formatted text field used by this cell editor.
- Parameters:
format - Format used to look up an AbstractFormatter
- Returns:
- a JFormattedTextField.
createFormattedTextField
protected JFormattedTextField createFormattedTextField(JFormattedTextField.AbstractFormatter formatter)
- Creates the formatted text field used by this cell editor.
- Parameters:
formatter - AbstractFormatter to use for formatting.
- Returns:
- a JFormattedTextField.
customizeTextField
protected void customizeTextField()
setupTextField
protected void setupTextField()
setConverterContext
public void setConverterContext(ConverterContext context)
- Description copied from class:
ContextSensitiveCellEditor
- Set the converter context for the cell editor.
By default, this context is null so that the converter context of the cell editor will be the same as the converter
context of the cell in the ContextSensitiveTable. You could set this context to a non-null value so that the editor
could have different converter context with the cell itself.
While getting converter context, it will first check this method then check
ContextSensitiveCellEditor.isUseConverterContext() to decide
if the editor should use the cell's converter context or use null always.
- Specified by:
setConverterContext in interface ConverterContextSupport- Overrides:
setConverterContext in class ContextSensitiveCellEditor
- Parameters:
context - the converter context- See Also:
ContextSensitiveCellEditor.getConverterContext()
getCellEditorValue
public Object getCellEditorValue()
- Specified by:
getCellEditorValue in interface CellEditor
setCellEditorValue
public void setCellEditorValue(Object value)
getTableCellEditorComponent
public Component getTableCellEditorComponent(JTable table,
Object value,
boolean isSelected,
int row,
int column)
- Specified by:
getTableCellEditorComponent in interface TableCellEditor
focusLost
public void focusLost(FocusEvent e)
- Specified by:
focusLost in interface FocusListener
focusGained
public void focusGained(FocusEvent e)
- Specified by:
focusGained in interface FocusListener
getFormatFactory
protected JFormattedTextField.AbstractFormatterFactory getFormatFactory()