public class IntegerFieldEditor extends StringFieldEditor
oldValue, UNLIMITED, VALIDATE_ON_FOCUS_LOST, VALIDATE_ON_KEY_STROKE
HORIZONTAL_GAP, IS_VALID, VALUE
Modifier | Constructor and Description |
---|---|
protected |
IntegerFieldEditor()
Creates a new integer field editor
|
|
IntegerFieldEditor(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.
|
Modifier and Type | Method and Description |
---|---|
protected boolean |
checkState()
Checks whether the text input field contains a valid value or not.
|
protected void |
doLoad()
Initializes this field editor with the preference value from
the preference store.
|
protected void |
doLoadDefault()
Initializes this field editor with the default preference value from
the preference store.
|
protected void |
doStore()
Stores the preference value from this field editor into
the preference store.
|
int |
getIntValue()
Returns this field editor's current value as an integer.
|
void |
setValidRange(int min,
int max)
Sets the range of valid values for this field.
|
adjustForNumColumns, doCheckState, doFillIntoGrid, getErrorMessage, getNumberOfControls, getStringValue, getTextControl, getTextControl, isEmptyStringAllowed, isValid, refreshValidState, setEmptyStringAllowed, setEnabled, setErrorMessage, setFocus, setStringValue, setTextLimit, setValidateStrategy, showErrorMessage, valueChanged
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
protected IntegerFieldEditor()
public IntegerFieldEditor(String name, String labelText, Composite parent)
name
- the name of the preference this field editor works onlabelText
- the label text of the field editorparent
- the parent of the field editor's controlpublic IntegerFieldEditor(String name, String labelText, Composite parent, int textLimit)
name
- the name of the preference this field editor works onlabelText
- the label text of the field editorparent
- the parent of the field editor's controltextLimit
- the maximum number of characters in the text.public void setValidRange(int min, int max)
min
- the minimum allowed value (inclusive)max
- the maximum allowed value (inclusive)protected boolean checkState()
StringFieldEditor
checkState
in class StringFieldEditor
true
if the field value is valid,
and false
if invalidprotected void doLoad()
FieldEditor
Subclasses must implement this method to properly initialize the field editor.
doLoad
in class StringFieldEditor
protected void doLoadDefault()
FieldEditor
Subclasses must implement this method to properly initialize the field editor.
doLoadDefault
in class StringFieldEditor
protected void doStore()
FieldEditor
Subclasses must implement this method to save the entered value into the preference store.
doStore
in class StringFieldEditor
public int getIntValue() throws NumberFormatException
NumberFormatException
- if the String
does not
contain a parsable integer
Copyright (c) 2000, 2015 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.