public class IntegerFieldEditor extends StringFieldEditor
UNLIMITED, VALIDATE_ON_FOCUS_LOST, VALIDATE_ON_KEY_STROKEHORIZONTAL_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, valueChangedapplyFont, 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, storeprotected 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()
StringFieldEditorcheckState in class StringFieldEditortrue if the field value is valid,
and false if invalidprotected void doLoad()
FieldEditorSubclasses must implement this method to properly initialize the field editor.
doLoad in class StringFieldEditorprotected void doLoadDefault()
FieldEditorSubclasses must implement this method to properly initialize the field editor.
doLoadDefault in class StringFieldEditorprotected void doStore()
FieldEditorSubclasses must implement this method to save the entered value into the preference store.
doStore in class StringFieldEditorpublic int getIntValue()
throws NumberFormatException
NumberFormatException - if the String does not
contain a parsable integerGuidelines for using Eclipse APIs. Copyright (c) IBM Corp. and others 2000, 2006. All rights reserved.