|
Holger's Java API |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjavax.swing.AbstractCellEditor
com.antelmann.util.table.AbstractSpecialCellEditor
com.antelmann.util.table.FormattedCellEditor
public class FormattedCellEditor
edits cells flexibly while the return value is the actual Type, not a String (like it is with a DefaultCellEditor). In addition, this class allows to easily customize further validation checking including displaying an appropriate message to the user. By default, this editor allows null values to be entered by providing an empty String to the field.
DefaultCellEditor,
Serialized Form| Field Summary |
|---|
| Fields inherited from class javax.swing.AbstractCellEditor |
|---|
changeEvent, listenerList |
| Constructor Summary | |
|---|---|
FormattedCellEditor(Filter<? super String> stringFilter)
uses FormattedCellRenderer.ToStringFormat |
|
FormattedCellEditor(Format format)
calls this(format, true) |
|
FormattedCellEditor(Format format,
boolean selectAllOnFocus)
|
|
| Method Summary | |
|---|---|
Object |
getCellEditorValue()
|
JFormattedTextField |
getComponent()
|
Format |
getFormat()
|
boolean |
getSelectAllOnFocus()
|
Filter<? super String> |
getStringFilter()
|
Component |
getTableCellEditorComponent(JTable table,
Object value,
boolean isSelected,
int row,
int column)
|
Component |
getTreeCellEditorComponent(JTree tree,
Object value,
boolean isSelected,
boolean expanded,
boolean leaf,
int row)
|
protected Object |
getValidationString(String value)
called when the isValid(String) method returns false; if anything but null is returned, a dialog pops up displaying the returned Object (allowing a custom message to be displayed). |
boolean |
isCellEditable(EventObject ev)
checks for MouseEvent instances and there reacts according to the AbstractSpecialCellEditor.getClickCountToStart() value |
protected boolean |
isValid(String value)
checks the input String of the field before the Format parses it. |
void |
setDoNotAllowNullFilter(String messageIfValueIsEmpty)
sets a special filter that does NOT allow NULL as a value |
FormattedCellEditor |
setHorizonalAligment(int alignment)
shortcut |
void |
setSelectAllOnFocus(boolean flag)
|
void |
setStringFilter(Filter<? super String> stringFilter)
VerboseFilter are honored |
boolean |
stopCellEditing()
|
| Methods inherited from class com.antelmann.util.table.AbstractSpecialCellEditor |
|---|
getClickCountToStart, setClickCountToStart |
| Methods inherited from class javax.swing.AbstractCellEditor |
|---|
addCellEditorListener, cancelCellEditing, fireEditingCanceled, fireEditingStopped, getCellEditorListeners, removeCellEditorListener, shouldSelectCell |
| 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, cancelCellEditing, removeCellEditorListener, shouldSelectCell |
| Constructor Detail |
|---|
public FormattedCellEditor(Filter<? super String> stringFilter)
FormattedCellRenderer.ToStringFormat
public FormattedCellEditor(Format format)
public FormattedCellEditor(Format format,
boolean selectAllOnFocus)
| Method Detail |
|---|
public FormattedCellEditor setHorizonalAligment(int alignment)
public JFormattedTextField getComponent()
public Format getFormat()
public boolean getSelectAllOnFocus()
public void setSelectAllOnFocus(boolean flag)
public Object getCellEditorValue()
getCellEditorValue in interface CellEditor
public Component getTableCellEditorComponent(JTable table,
Object value,
boolean isSelected,
int row,
int column)
getTableCellEditorComponent in interface TableCellEditor
public Component getTreeCellEditorComponent(JTree tree,
Object value,
boolean isSelected,
boolean expanded,
boolean leaf,
int row)
getTreeCellEditorComponent in interface TreeCellEditorprotected boolean isValid(String value)
getStringFilter() .
public Filter<? super String> getStringFilter()
setStringFilter(Filter)public void setStringFilter(Filter<? super String> stringFilter)
VerboseFilter are honored
protected Object getValidationString(String value)
VerboseFilter - uses the given message of that filter.
public void setDoNotAllowNullFilter(String messageIfValueIsEmpty)
setStringFilter(Filter)public boolean stopCellEditing()
stopCellEditing in interface CellEditorstopCellEditing in class AbstractCellEditorpublic boolean isCellEditable(EventObject ev)
AbstractSpecialCellEditorAbstractSpecialCellEditor.getClickCountToStart() value
isCellEditable in interface CellEditorisCellEditable in class AbstractSpecialCellEditor
|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||