public class NumberEditorExt extends DefaultCellEditor
DefaultCellEditor.EditorDelegateclickCountToStart, delegate, editorComponentchangeEvent, listenerList| Constructor and Description |
|---|
NumberEditorExt()
Instantiates an editor with default NumberFormat and default NumberFormatter.
|
NumberEditorExt(boolean useStrictFormatter)
Instantiates an editor with default NumberFormat and NumberFormatter depending
on useStrictFormatter.
|
NumberEditorExt(NumberFormat format)
Instantiates an editor with the given NumberFormat and default NumberFormatter.
|
NumberEditorExt(NumberFormat format,
boolean useStrictFormatter)
Instantiates an editor with the given NumberFormat and NumberFormatter depending on
useStrictFormatter.
|
| Modifier and Type | Method and Description |
|---|---|
Number |
getCellEditorValue() |
JFormattedTextField |
getComponent() |
protected Number |
getNumber()
Returns the editor value as number.
|
Component |
getTableCellEditorComponent(JTable table,
Object value,
boolean isSelected,
int row,
int column)
Override and set the border back to normal in case there was an error previously
|
protected boolean |
hasStrictFormatter() |
protected boolean |
isValid()
Returns a boolean indicating whether the current text is valid for
instantiating the expected Number type.
|
boolean |
stopCellEditing() |
cancelCellEditing, getClickCountToStart, getTreeCellEditorComponent, isCellEditable, setClickCountToStart, shouldSelectCelladdCellEditorListener, fireEditingCanceled, fireEditingStopped, getCellEditorListeners, removeCellEditorListenerclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddCellEditorListener, removeCellEditorListenerpublic NumberEditorExt()
public NumberEditorExt(NumberFormat format)
format - the NumberFormat to use for conversion, may be null to indicate
usage of default NumberFormat.public NumberEditorExt(boolean useStrictFormatter)
useStrictFormatter - if true, uses a StrictNumberFormatter, else uses
default NumberFormatterpublic NumberEditorExt(NumberFormat format, boolean useStrictFormatter)
format - the NumberFormat to use for conversion, may be null to indicate
usage of default NumberFormatuseStrictFormatter - if true, uses a StrictNumberFormatter, else uses
default NumberFormatterpublic boolean stopCellEditing()
stopCellEditing in interface CellEditorstopCellEditing in class DefaultCellEditorprotected boolean isValid()
protected Number getNumber() throws Exception
Exception - if creation of the expected type fails in some way.protected boolean hasStrictFormatter()
public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column)
getTableCellEditorComponent in interface TableCellEditorgetTableCellEditorComponent in class DefaultCellEditorpublic Number getCellEditorValue() throws IllegalStateException
Overridden to instantiate a Number of the expected type. Note that this may throw a IllegalStateException if invoked without querying for a valid value with stopCellEditing. This should not happen during normal usage.
getCellEditorValue in interface CellEditorgetCellEditorValue in class DefaultCellEditorIllegalStateException - if current value invalidpublic JFormattedTextField getComponent()
Convenience override with type cast.
getComponent in class DefaultCellEditorCopyright © 2017. All Rights Reserved.