org.jdesktop.swingx.table
Class NumberEditorExt
- java.lang.Object
-
- javax.swing.AbstractCellEditor
-
- javax.swing.DefaultCellEditor
-
- org.jdesktop.swingx.table.NumberEditorExt
-
- All Implemented Interfaces:
- java.io.Serializable, javax.swing.CellEditor, javax.swing.table.TableCellEditor, javax.swing.tree.TreeCellEditor
public class NumberEditorExt extends javax.swing.DefaultCellEditorIssue #393-swingx: localized NumberEditor. Added feature to use StrictNumberFormatter.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors 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(java.text.NumberFormat format)Instantiates an editor with the given NumberFormat and default NumberFormatter.NumberEditorExt(java.text.NumberFormat format, boolean useStrictFormatter)Instantiates an editor with the given NumberFormat and NumberFormatter depending on useStrictFormatter.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description java.lang.NumbergetCellEditorValue()javax.swing.JFormattedTextFieldgetComponent()java.awt.ComponentgetTableCellEditorComponent(javax.swing.JTable table, java.lang.Object value, boolean isSelected, int row, int column)Override and set the border back to normal in case there was an error previouslybooleanstopCellEditing()-
Methods inherited from class javax.swing.DefaultCellEditor
cancelCellEditing, getClickCountToStart, getTreeCellEditorComponent, isCellEditable, setClickCountToStart, shouldSelectCell
-
Methods inherited from class javax.swing.AbstractCellEditor
addCellEditorListener, getCellEditorListeners, removeCellEditorListener
-
-
-
-
Constructor Detail
-
NumberEditorExt
public NumberEditorExt()
Instantiates an editor with default NumberFormat and default NumberFormatter.
-
NumberEditorExt
public NumberEditorExt(java.text.NumberFormat format)
Instantiates an editor with the given NumberFormat and default NumberFormatter.- Parameters:
format- the NumberFormat to use for conversion, may be null to indicate usage of default NumberFormat.
-
NumberEditorExt
public NumberEditorExt(boolean useStrictFormatter)
Instantiates an editor with default NumberFormat and NumberFormatter depending on useStrictFormatter.- Parameters:
useStrictFormatter- if true, uses a StrictNumberFormatter, else uses default NumberFormatter
-
NumberEditorExt
public NumberEditorExt(java.text.NumberFormat format, boolean useStrictFormatter)Instantiates an editor with the given NumberFormat and NumberFormatter depending on useStrictFormatter.- Parameters:
format- the NumberFormat to use for conversion, may be null to indicate usage of default NumberFormatuseStrictFormatter- if true, uses a StrictNumberFormatter, else uses default NumberFormatter
-
-
Method Detail
-
stopCellEditing
public boolean stopCellEditing()
- Specified by:
stopCellEditingin interfacejavax.swing.CellEditor- Overrides:
stopCellEditingin classjavax.swing.DefaultCellEditor
-
getTableCellEditorComponent
public java.awt.Component getTableCellEditorComponent(javax.swing.JTable table, java.lang.Object value, boolean isSelected, int row, int column)Override and set the border back to normal in case there was an error previously- Specified by:
getTableCellEditorComponentin interfacejavax.swing.table.TableCellEditor- Overrides:
getTableCellEditorComponentin classjavax.swing.DefaultCellEditor
-
getCellEditorValue
public java.lang.Number getCellEditorValue() throws java.lang.IllegalStateExceptionOverridden 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.
- Specified by:
getCellEditorValuein interfacejavax.swing.CellEditor- Overrides:
getCellEditorValuein classjavax.swing.DefaultCellEditor- Throws:
java.lang.IllegalStateException- if current value invalid
-
getComponent
public javax.swing.JFormattedTextField getComponent()
Convenience override with type cast.
- Overrides:
getComponentin classjavax.swing.DefaultCellEditor
-
-
DataMelt 3.0 © DataMelt by jWork.ORG