public class NumericCellEditor extends DefaultCellEditor
FormatConstants
,
LocaleManager
,
NumericField
,
NumericTableCellRenderer
,
DomainObjectFieldAdapter
,
Serialized FormDefaultCellEditor.EditorDelegate
Modifier and Type | Field and Description |
---|---|
private NumericField |
field |
clickCountToStart, delegate, editorComponent
changeEvent, listenerList
Constructor and Description |
---|
NumericCellEditor(int type)
Construct a new
NumericCellEditor of the specified type. |
NumericCellEditor(int type,
int decimals)
Construct a new
NumericCellEditor of the specified type and
number of decimals displayed. |
Modifier and Type | Method and Description |
---|---|
private Component |
_prepareEditor(Object value) |
Object |
getCellEditorValue()
Get the value currently in the cell editor.
|
int |
getDecimals()
Get the number of decimal places being displayed by this cell editor.
|
Component |
getTableCellEditorComponent(JTable table,
Object value,
boolean isSelected,
int row,
int column)
Get an editor for a JTable.
|
Component |
getTreeCellEditorComponent(JTree tree,
Object value,
boolean isSelected,
boolean expanded,
boolean leaf,
int row)
Get an editor for a JTree.
|
int |
getType()
Get the formatting type.
|
void |
setDecimals(int decimals)
Set the number of decimal places to display for non-integer values.
|
void |
setType(int type)
Set the formatting type.
|
boolean |
stopCellEditing()
Stop cell editing.
|
private boolean |
validate() |
cancelCellEditing, getClickCountToStart, getComponent, isCellEditable, setClickCountToStart, shouldSelectCell
addCellEditorListener, fireEditingCanceled, fireEditingStopped, getCellEditorListeners, removeCellEditorListener
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addCellEditorListener, removeCellEditorListener
private NumericField field
public NumericCellEditor(int type)
NumericCellEditor
of the specified type.type
- The data type to be edited by this field; one of the
constants CURRENCY_FORMAT
, DECIMAL_FORMAT
,
INTEGER_FORMAT
PERCENTAGE_FORMAT, defined in
kiwi.text.FormatConstants
.public NumericCellEditor(int type, int decimals)
NumericCellEditor
of the specified type and
number of decimals displayed.type
- The data type to be edited by this field; one of the
constants CURRENCY_FORMAT
, DECIMAL_FORMAT
,
INTEGER_FORMAT
PERCENTAGE_FORMAT, defined in
kiwi.text.FormatConstants
.decimals
- The number of decimal places to be displayed (for
non-integer values only).public final boolean stopCellEditing()
stopCellEditing
in interface CellEditor
stopCellEditing
in class DefaultCellEditor
true
if cell editing may stop, and false
otherwise.private boolean validate()
public Object getCellEditorValue()
getCellEditorValue
in interface CellEditor
getCellEditorValue
in class DefaultCellEditor
Double
.public void setType(int type)
type
- The data type to be edited by this cell editor. See the
constructor for more information.public int getType()
public void setDecimals(int decimals)
decimals
- The number of decimal places.IllegalArgumentException
- If decimals
is less than 0.public int getDecimals()
private Component _prepareEditor(Object value)
public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column)
getTableCellEditorComponent
in interface TableCellEditor
getTableCellEditorComponent
in class DefaultCellEditor
public Component getTreeCellEditorComponent(JTree tree, Object value, boolean isSelected, boolean expanded, boolean leaf, int row)
getTreeCellEditorComponent
in interface TreeCellEditor
getTreeCellEditorComponent
in class DefaultCellEditor
WebARTS Library Licensed Under the GNU - General Public License. Other Libraries licensed under their respective Open Source Licenses