com.isti.util.propertyeditor
Class NumberPropertyEditor

java.lang.Object
  extended by java.beans.PropertyEditorSupport
      extended by com.isti.util.propertyeditor.AbstractPropertyEditor
          extended by com.isti.util.propertyeditor.NumberPropertyEditor
All Implemented Interfaces:
java.beans.PropertyEditor

public class NumberPropertyEditor
extends AbstractPropertyEditor

A PropertyEditor for a number.


Field Summary
protected  java.lang.Object[] initargs
           
protected  FilteredJTextField textField
          The GUI component of this editor.
 
Constructor Summary
NumberPropertyEditor()
          Creates A PropertyEditor for a number.
NumberPropertyEditor(java.lang.Object valueObj)
          Creates A PropertyEditor for a number.
NumberPropertyEditor(java.lang.Object valueObj, boolean isUnsignedFlag, java.lang.Comparable maxValue)
          Creates A PropertyEditor for a number.
 
Method Summary
 void addActionListener(java.awt.event.ActionListener l)
          Adds an ActionListener to the button.
 java.lang.String getAsText()
          Returns value as a String.
 java.awt.Component getCustomEditor()
          Returns the editor GUI.
 java.lang.Object getValue()
          Returns value.
 void removeActionListener(java.awt.event.ActionListener l)
          Removes an ActionListener from the button.
 void setAsText(java.lang.String text)
          Sets value as text.
 void setValue(java.lang.Object someObj)
          Sets value.
 boolean supportsCustomEditor()
          Determines whether the propertyeditor can provide a custom editor.
 
Methods inherited from class java.beans.PropertyEditorSupport
addPropertyChangeListener, firePropertyChange, getJavaInitializationString, getSource, getTags, isPaintable, paintValue, removePropertyChangeListener, setSource
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

textField

protected final FilteredJTextField textField
The GUI component of this editor.


initargs

protected final java.lang.Object[] initargs
Constructor Detail

NumberPropertyEditor

public NumberPropertyEditor()
Creates A PropertyEditor for a number.


NumberPropertyEditor

public NumberPropertyEditor(java.lang.Object valueObj)
Creates A PropertyEditor for a number.

Parameters:
valueObj - the value of the item.

NumberPropertyEditor

public NumberPropertyEditor(java.lang.Object valueObj,
                            boolean isUnsignedFlag,
                            java.lang.Comparable maxValue)
Creates A PropertyEditor for a number.

Parameters:
valueObj - the value of the item.
isUnsignedFlag - true if unsigned number.
maxValue - the maximum value for the item or null if not needed.
See Also:
FilteredJTextField
Method Detail

supportsCustomEditor

public boolean supportsCustomEditor()
Determines whether the propertyeditor can provide a custom editor.

Specified by:
supportsCustomEditor in interface java.beans.PropertyEditor
Overrides:
supportsCustomEditor in class java.beans.PropertyEditorSupport
Returns:
true

getCustomEditor

public java.awt.Component getCustomEditor()
Returns the editor GUI.

Specified by:
getCustomEditor in interface java.beans.PropertyEditor
Overrides:
getCustomEditor in class java.beans.PropertyEditorSupport
Returns:
component for editor.

setValue

public void setValue(java.lang.Object someObj)
Sets value.

Specified by:
setValue in interface java.beans.PropertyEditor
Overrides:
setValue in class java.beans.PropertyEditorSupport
Parameters:
someObj - value

setAsText

public void setAsText(java.lang.String text)
Sets value as text.

Specified by:
setAsText in interface java.beans.PropertyEditor
Overrides:
setAsText in class java.beans.PropertyEditorSupport
Parameters:
text - value

getValue

public java.lang.Object getValue()
Returns value.

Specified by:
getValue in interface java.beans.PropertyEditor
Overrides:
getValue in class java.beans.PropertyEditorSupport
Returns:
the value

getAsText

public java.lang.String getAsText()
Returns value as a String.

Specified by:
getAsText in interface java.beans.PropertyEditor
Overrides:
getAsText in class java.beans.PropertyEditorSupport
Returns:
the value as a string

addActionListener

public void addActionListener(java.awt.event.ActionListener l)
Adds an ActionListener to the button.

Specified by:
addActionListener in class AbstractPropertyEditor
Parameters:
l - the ActionListener to be added

removeActionListener

public void removeActionListener(java.awt.event.ActionListener l)
Removes an ActionListener from the button. If the listener is the currently set Action for the button, then the Action is set to null.

Specified by:
removeActionListener in class AbstractPropertyEditor
Parameters:
l - the listener to be removed