net.luniks.swing
Class TextValidatorCellEditor
java.lang.Object
javax.swing.AbstractCellEditor
javax.swing.DefaultCellEditor
net.luniks.swing.TextValidatorCellEditor
- All Implemented Interfaces:
- javax.swing.CellEditor, java.io.Serializable, javax.swing.table.TableCellEditor, javax.swing.tree.TreeCellEditor
- Direct Known Subclasses:
- DateCellEditor
- public class TextValidatorCellEditor
- extends javax.swing.DefaultCellEditor
Class to provide a CellEditor for text. It calls the method
validate in the interface Validator at the moment when the user
has finished editing the cell. The value the user has entered is
given as argument to validate(), it can then be validated
and depending on the result a boolean returned. If the return
value is false, editing is not stopped and the user has to enter
a valid value or cancel editing, for example by pressing ESC.
If the returned boolean is true, editing is stopped and the
edited value is accepted.
- See Also:
- Serialized Form
| Nested classes inherited from class javax.swing.DefaultCellEditor |
javax.swing.DefaultCellEditor.EditorDelegate |
| Fields inherited from class javax.swing.DefaultCellEditor |
clickCountToStart, delegate, editorComponent |
| Fields inherited from class javax.swing.AbstractCellEditor |
changeEvent, listenerList |
| Methods inherited from class javax.swing.DefaultCellEditor |
cancelCellEditing, getCellEditorValue, getClickCountToStart, getComponent, getTableCellEditorComponent, getTreeCellEditorComponent, isCellEditable, setClickCountToStart, shouldSelectCell |
| Methods inherited from class javax.swing.AbstractCellEditor |
addCellEditorListener, fireEditingCanceled, fireEditingStopped, getCellEditorListeners, removeCellEditorListener |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface javax.swing.CellEditor |
addCellEditorListener, removeCellEditorListener |
validator
private TextValidatorCellEditor.Validator validator
textField
private javax.swing.JTextField textField
TextValidatorCellEditor
public TextValidatorCellEditor(TextValidatorCellEditor.Validator validator)
- Constructs a TextValidatorCellEditor
- Parameters:
validator - implementation of the interface Validator
stopCellEditing
public boolean stopCellEditing()
getTextField
public javax.swing.JTextField getTextField()
Copyright (c) 2004, 2005 Torsten Römer, dode@luniks.net