propertyManager
Class EditableFloatProperty

java.lang.Object
  extended by propertyManager.ReadableProperty
      extended by propertyManager.EditableProperty
          extended by propertyManager.EditableFloatProperty
All Implemented Interfaces:
java.io.Serializable, INumericProperty

public class EditableFloatProperty
extends EditableProperty
implements INumericProperty

Author:
Dan Phifer The EditableFloatProperty class works with the PropertyManager class to allow Float values to be entered and validated through the properties view.
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class propertyManager.ReadableProperty
ReadableProperty.SubPropertyChangeListener
 
Field Summary
private  float maximum
           
private  float minimum
           
private static long serialVersionUID
           
 
Fields inherited from class propertyManager.EditableProperty
validator
 
Fields inherited from class propertyManager.ReadableProperty
defaultValue, value
 
Constructor Summary
EditableFloatProperty(java.lang.String id, java.lang.String name, float defaultValue)
           
 
Method Summary
private  java.lang.Float getFloat(java.lang.Object value)
           
 java.lang.Float getFloatValue()
          Ensures that the returned value is a Float object.
 java.lang.Number getNumberValue()
           
 org.eclipse.jface.viewers.ICellEditorValidator getValidator()
           
 void setDefaultValue(float defaultValue)
          Sets the default value of the property.
 void setMaximum(float maximum)
           
 void setMinimum(float minimum)
           
 void setNumberValue(java.lang.Number value)
           
 void setValue(float newValue)
           
 
Methods inherited from class propertyManager.EditableProperty
getCustomPropertyDescriptor, setUnderlyingValue, setValidator, setValue
 
Methods inherited from class propertyManager.ReadableProperty
addPropertyChangeListener, getDefaultValue, getID, getName, getPropertyDescriptor, getSubPropertyManager, getUnderlyingDefaultValue, getUnderlyingValue, getValue, hasDefaultValue, hasDynamicPropertyDescriptor, hasSubProperties, hasValue, notifyPropertyChangeListeners, removePropertyChangeListener, setCategory, setDefaultValue, setLabelProvider, setSubPropertyManager, setUnderlyingDefaultValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values

maximum

private float maximum

minimum

private float minimum
Constructor Detail

EditableFloatProperty

public EditableFloatProperty(java.lang.String id,
                             java.lang.String name,
                             float defaultValue)
Parameters:
id - The unique identifier for this property
name - The name to be displayed to the user
defaultValue - The value to be used by default
Method Detail

setMinimum

public void setMinimum(float minimum)
Parameters:
minimum - The minimum allowable value. Any values lower than minimum will be rejected by the validator and the user will be informed via the status bar

setMaximum

public void setMaximum(float maximum)
Parameters:
maximum - The maximum allowable value. Any values higher than maximum will be rejected by the validator and the user will be informed via the status bar

setDefaultValue

public void setDefaultValue(float defaultValue)
Sets the default value of the property. The default value will be used initially, and the user can revert to the default value.

Parameters:
defaultValue - The defaultValue

setValue

public void setValue(float newValue)
Parameters:
newValue - The new value of the property.

getValidator

public org.eclipse.jface.viewers.ICellEditorValidator getValidator()
Overrides:
getValidator in class EditableProperty

getFloatValue

public java.lang.Float getFloatValue()
Ensures that the returned value is a Float object. If the actual value

Returns:
an Float object.

getFloat

private java.lang.Float getFloat(java.lang.Object value)
Parameters:
value - An object (String or Float) to be interpreted as a Float.
Returns:
A Float object that is equivalent to the given value.

getNumberValue

public java.lang.Number getNumberValue()
Specified by:
getNumberValue in interface INumericProperty

setNumberValue

public void setNumberValue(java.lang.Number value)
Specified by:
setNumberValue in interface INumericProperty