de.cau.cs.kieler.core.ui.util
Class FloatFieldEditor

java.lang.Object
  extended by org.eclipse.jface.preference.FieldEditor
      extended by org.eclipse.jface.preference.StringFieldEditor
          extended by de.cau.cs.kieler.core.ui.util.FloatFieldEditor

public class FloatFieldEditor
extends StringFieldEditor

Field editor for input of float values.

Rating proposed yellow
(2009-12-11) msp

Field Summary
 
Fields inherited from class org.eclipse.jface.preference.StringFieldEditor
oldValue, UNLIMITED, VALIDATE_ON_FOCUS_LOST, VALIDATE_ON_KEY_STROKE
 
Fields inherited from class org.eclipse.jface.preference.FieldEditor
HORIZONTAL_GAP, IS_VALID, VALUE
 
Constructor Summary
FloatFieldEditor(String name, String labelText, Composite parent)
          Creates a new float field editor.
 
Method Summary
protected  boolean checkState()
          
protected  void doLoad()
          
protected  void doLoadDefault()
          
protected  void doStore()
          
 float getFloatValue()
          Parses the input string as a float value.
 void setValidRange(float min, float max)
          Sets the range of valid float values for this field editor.
 
Methods inherited from class org.eclipse.jface.preference.StringFieldEditor
adjustForNumColumns, doCheckState, doFillIntoGrid, getErrorMessage, getNumberOfControls, getStringValue, getTextControl, getTextControl, isEmptyStringAllowed, isValid, refreshValidState, setEmptyStringAllowed, setEnabled, setErrorMessage, setFocus, setStringValue, setTextLimit, setValidateStrategy, showErrorMessage, valueChanged
 
Methods inherited from class org.eclipse.jface.preference.FieldEditor
applyFont, checkParent, clearErrorMessage, clearMessage, convertHorizontalDLUsToPixels, convertVerticalDLUsToPixels, createControl, dispose, fillIntoGrid, fireStateChanged, fireValueChanged, getFieldEditorFontName, getLabelControl, getLabelControl, getLabelText, getPage, getPreferenceName, getPreferencePage, getPreferenceStore, init, load, loadDefault, presentsDefaultValue, setButtonLayoutData, setLabelText, setPage, setPreferenceName, setPreferencePage, setPreferenceStore, setPresentsDefaultValue, setPropertyChangeListener, showErrorMessage, showMessage, store
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FloatFieldEditor

public FloatFieldEditor(String name,
                        String labelText,
                        Composite parent)
Creates a new float field editor.

Parameters:
name - the name of the preference this field editor works on
labelText - the label text of the field editor
parent - the parent of the field editor's control
Method Detail

checkState

protected boolean checkState()

Overrides:
checkState in class StringFieldEditor

doLoad

protected void doLoad()

Overrides:
doLoad in class StringFieldEditor

doLoadDefault

protected void doLoadDefault()

Overrides:
doLoadDefault in class StringFieldEditor

doStore

protected void doStore()

Overrides:
doStore in class StringFieldEditor

setValidRange

public void setValidRange(float min,
                          float max)
Sets the range of valid float values for this field editor. The default is to accept all float values except NaN and infinity.

Parameters:
min - lower bound for float values
max - upper bound for float values

getFloatValue

public float getFloatValue()
Parses the input string as a float value.

Returns:
float value