org.tbee.swing.table
Class NumberEditor

java.lang.Object
  extended by javax.swing.AbstractCellEditor
      extended by javax.swing.DefaultCellEditor
          extended by org.tbee.swing.table.DefaultCellEditor
              extended by org.tbee.swing.table.NumberEditor
All Implemented Interfaces:
java.io.Serializable, javax.swing.CellEditor, javax.swing.table.TableCellEditor, javax.swing.tree.TreeCellEditor
Direct Known Subclasses:
CurrencyEditor, PercentEditor

public class NumberEditor
extends DefaultCellEditor

Number editor, also used for percent, etc. TODO: can we reapply to textfield-popup now that we use the vanilla JTextfield?

Version:
$Revision: 1.35 $
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.DefaultCellEditor
javax.swing.DefaultCellEditor.EditorDelegate
 
Field Summary
protected  java.lang.Class iClass
           
protected  java.lang.reflect.Constructor iConstructor
           
protected  javax.swing.JTextField iJTextField
           
protected  java.text.NumberFormat iNumberFormat
           
protected  java.lang.Number iValidatedObject
           
static java.lang.String SOURCECODE_VERSION
          Standard variable for determining version of a class file.
 
Fields inherited from class javax.swing.DefaultCellEditor
clickCountToStart, delegate, editorComponent
 
Fields inherited from class javax.swing.AbstractCellEditor
changeEvent, listenerList
 
Constructor Summary
NumberEditor()
          initialize the editor with defaults
NumberEditor(java.util.Locale pLocale)
          initialize the editor for the specified locale, rest with defaults
NumberEditor(java.util.Locale pLocale, int pMinFraction, int pMaxFraction)
          initialize the editor
 
Method Summary
 boolean getAllowNull()
           
 java.lang.Object getCellEditorValue()
          get the value (after validate is succesful)
 java.awt.Component getTableCellEditorComponent(javax.swing.JTable t, java.lang.Object value, boolean isSelected, int row, int col)
          get the editor
 void requestFocus()
          Set the focus on the component
 void setAllowNull(boolean value)
           
 boolean stopCellEditing()
          validate and return false if it failed
 
Methods inherited from class org.tbee.swing.table.DefaultCellEditor
useAsRenderer
 
Methods inherited from class javax.swing.DefaultCellEditor
cancelCellEditing, getClickCountToStart, getComponent, 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
 

Field Detail

SOURCECODE_VERSION

public static final java.lang.String SOURCECODE_VERSION
Standard variable for determining version of a class file.

See Also:
Constant Field Values

iJTextField

protected javax.swing.JTextField iJTextField

iConstructor

protected java.lang.reflect.Constructor iConstructor

iClass

protected java.lang.Class iClass

iValidatedObject

protected java.lang.Number iValidatedObject

iNumberFormat

protected java.text.NumberFormat iNumberFormat
Constructor Detail

NumberEditor

public NumberEditor()
initialize the editor with defaults


NumberEditor

public NumberEditor(java.util.Locale pLocale)
initialize the editor for the specified locale, rest with defaults


NumberEditor

public NumberEditor(java.util.Locale pLocale,
                    int pMinFraction,
                    int pMaxFraction)
initialize the editor

Method Detail

stopCellEditing

public boolean stopCellEditing()
validate and return false if it failed

Specified by:
stopCellEditing in interface javax.swing.CellEditor
Overrides:
stopCellEditing in class javax.swing.DefaultCellEditor

getCellEditorValue

public java.lang.Object getCellEditorValue()
get the value (after validate is succesful)

Specified by:
getCellEditorValue in interface javax.swing.CellEditor
Overrides:
getCellEditorValue in class javax.swing.DefaultCellEditor

getTableCellEditorComponent

public java.awt.Component getTableCellEditorComponent(javax.swing.JTable t,
                                                      java.lang.Object value,
                                                      boolean isSelected,
                                                      int row,
                                                      int col)
get the editor

Specified by:
getTableCellEditorComponent in interface javax.swing.table.TableCellEditor
Overrides:
getTableCellEditorComponent in class DefaultCellEditor

requestFocus

public void requestFocus()
Set the focus on the component

Overrides:
requestFocus in class DefaultCellEditor

setAllowNull

public void setAllowNull(boolean value)

getAllowNull

public boolean getAllowNull()


Copyright © 2010. All Rights Reserved.