Package org.eclipse.jface.preference
Class IntegerFieldEditor
java.lang.Object
org.eclipse.jface.preference.FieldEditor
org.eclipse.jface.preference.StringFieldEditor
org.eclipse.jface.preference.IntegerFieldEditor
A field editor for an integer type preference.
- 
Field SummaryFields inherited from class org.eclipse.jface.preference.StringFieldEditoroldValue, UNLIMITED, VALIDATE_ON_FOCUS_LOST, VALIDATE_ON_KEY_STROKEFields inherited from class org.eclipse.jface.preference.FieldEditorHORIZONTAL_GAP, IS_VALID, VALUE
- 
Constructor SummaryConstructorsModifierConstructorDescriptionprotectedCreates a new integer field editorIntegerFieldEditor(String name, String labelText, Composite parent) Creates an integer field editor.IntegerFieldEditor(String name, String labelText, Composite parent, int textLimit) Creates an integer field editor.
- 
Method SummaryModifier and TypeMethodDescriptionprotected booleanChecks whether the text input field contains a valid value or not.protected voiddoLoad()Initializes this field editor with the preference value from the preference store.protected voidInitializes this field editor with the default preference value from the preference store.protected voiddoStore()Stores the preference value from this field editor into the preference store.intReturns this field editor's current value as an integer.voidsetValidRange(int min, int max) Sets the range of valid values for this field.Methods inherited from class org.eclipse.jface.preference.StringFieldEditoradjustForNumColumns, createTextWidget, doCheckState, doFillIntoGrid, getErrorMessage, getNumberOfControls, getStringValue, getTextControl, getTextControl, isEmptyStringAllowed, isValid, refreshValidState, setEmptyStringAllowed, setEnabled, setErrorMessage, setFocus, setStringValue, setTextLimit, setValidateStrategy, showErrorMessage, valueChangedMethods inherited from class org.eclipse.jface.preference.FieldEditorapplyFont, 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
- 
Constructor Details- 
IntegerFieldEditorprotected IntegerFieldEditor()Creates a new integer field editor
- 
IntegerFieldEditorCreates an integer 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
 
- 
IntegerFieldEditorCreates an integer 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
- textLimit- the maximum number of characters in the text.
 
 
- 
- 
Method Details- 
setValidRangepublic void setValidRange(int min, int max) Sets the range of valid values for this field.- Parameters:
- min- the minimum allowed value (inclusive)
- max- the maximum allowed value (inclusive)
 
- 
checkStateprotected boolean checkState()Description copied from class:StringFieldEditorChecks whether the text input field contains a valid value or not.- Overrides:
- checkStatein class- StringFieldEditor
- Returns:
- trueif the field value is valid, and- falseif invalid
 
- 
doLoadprotected void doLoad()Description copied from class:FieldEditorInitializes this field editor with the preference value from the preference store.Subclasses must implement this method to properly initialize the field editor. - Overrides:
- doLoadin class- StringFieldEditor
 
- 
doLoadDefaultprotected void doLoadDefault()Description copied from class:FieldEditorInitializes this field editor with the default preference value from the preference store.Subclasses must implement this method to properly initialize the field editor. - Overrides:
- doLoadDefaultin class- StringFieldEditor
 
- 
doStoreprotected void doStore()Description copied from class:FieldEditorStores the preference value from this field editor into the preference store.Subclasses must implement this method to save the entered value into the preference store. - Overrides:
- doStorein class- StringFieldEditor
 
- 
getIntValueReturns this field editor's current value as an integer.- Returns:
- the value
- Throws:
- NumberFormatException- if the- Stringdoes not contain a parsable integer
 
 
-