Class ScaleFieldEditor
- Since:
- 3.0
-
Field Summary
Fields inherited from class org.eclipse.jface.preference.FieldEditor
HORIZONTAL_GAP, IS_VALID, VALUE
-
Constructor Summary
ConstructorDescriptionScaleFieldEditor
(String name, String labelText, Composite parent) Creates a scale field editor.ScaleFieldEditor
(String name, String labelText, Composite parent, int min, int max, int increment, int pageIncrement) Creates a scale field editor with particular scale values. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
adjustForNumColumns
(int numColumns) Adjusts the horizontal span of this field editor's basic controls.protected void
doFillIntoGrid
(Composite parent, int numColumns) Fills this field editor's basic controls into the given parent.protected void
doLoad()
Initializes this field editor with the preference value from the preference store.protected void
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
Returns the value that will be used for Scale.setIncrement(int).int
Returns the value that will be used for Scale.setMaximum(int).int
Returns the value that will be used for Scale.setMinimum(int).int
Returns the number of basic controls this field editor consists of.int
Returns the value that will be used for Scale.setPageIncrement(int).Returns this field editor's scale control.void
setEnabled
(boolean enabled, Composite parent) Bug 470866 fixvoid
setFocus()
Sets the focus to this field editor.void
setIncrement
(int increment) Set the value to be used for Scale.setIncrement(int) and update the scale.void
setMaximum
(int max) Set the value to be used for Scale.setMaximum(int) and update the scale.void
setMinimum
(int min) Set the value to be used for Scale.setMinumum(int) and update the scale.void
setPageIncrement
(int pageIncrement) Set the value to be used for Scale.setPageIncrement(int) and update the scale.protected void
Informs this field editor's listener, if it has one, about a change to the value (VALUE
property) provided that the old and new values are different.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, isValid, load, loadDefault, presentsDefaultValue, refreshValidState, setButtonLayoutData, setLabelText, setPage, setPreferenceName, setPreferencePage, setPreferenceStore, setPresentsDefaultValue, setPropertyChangeListener, showErrorMessage, showMessage, store
-
Field Details
-
scale
The scale, ornull
if none.
-
-
Constructor Details
-
ScaleFieldEditor
Creates a scale field editor.- Parameters:
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 control
-
ScaleFieldEditor
public ScaleFieldEditor(String name, String labelText, Composite parent, int min, int max, int increment, int pageIncrement) Creates a scale field editor with particular scale values.- Parameters:
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 controlmin
- the value used for Scale.setMinimum(int).max
- the value used for Scale.setMaximum(int).increment
- the value used for Scale.setIncrement(int).pageIncrement
- the value used for Scale.setPageIncrement(int).
-
-
Method Details
-
adjustForNumColumns
protected void adjustForNumColumns(int numColumns) Description copied from class:FieldEditor
Adjusts the horizontal span of this field editor's basic controls.Subclasses must implement this method to adjust the horizontal span of controls so they appear correct in the given number of columns.
The number of columns will always be equal to or greater than the value returned by this editor's
getNumberOfControls
method.- Specified by:
adjustForNumColumns
in classFieldEditor
- Parameters:
numColumns
- the number of columns
-
doFillIntoGrid
Description copied from class:FieldEditor
Fills this field editor's basic controls into the given parent.Subclasses must implement this method to create the controls for this field editor.
Note this method may be called by the constructor, so it must not access fields on the receiver object because they will not be fully initialized.
- Specified by:
doFillIntoGrid
in classFieldEditor
- Parameters:
parent
- the composite used as a parent for the basic controls; the parent's layout must be aGridLayout
numColumns
- the number of columns
-
doLoad
protected void doLoad()Description copied from class:FieldEditor
Initializes this field editor with the preference value from the preference store.Subclasses must implement this method to properly initialize the field editor.
- Specified by:
doLoad
in classFieldEditor
-
doLoadDefault
protected void doLoadDefault()Description copied from class:FieldEditor
Initializes this field editor with the default preference value from the preference store.Subclasses must implement this method to properly initialize the field editor.
- Specified by:
doLoadDefault
in classFieldEditor
-
doStore
protected void doStore()Description copied from class:FieldEditor
Stores 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.
- Specified by:
doStore
in classFieldEditor
-
getIncrement
public int getIncrement()Returns the value that will be used for Scale.setIncrement(int).- Returns:
- the value.
- See Also:
-
getMaximum
public int getMaximum()Returns the value that will be used for Scale.setMaximum(int).- Returns:
- the value.
- See Also:
-
getMinimum
public int getMinimum()Returns the value that will be used for Scale.setMinimum(int).- Returns:
- the value.
- See Also:
-
getNumberOfControls
public int getNumberOfControls()Description copied from class:FieldEditor
Returns the number of basic controls this field editor consists of.- Specified by:
getNumberOfControls
in classFieldEditor
- Returns:
- the number of controls
-
getPageIncrement
public int getPageIncrement()Returns the value that will be used for Scale.setPageIncrement(int).- Returns:
- the value.
- See Also:
-
getScaleControl
Returns this field editor's scale control.- Returns:
- the scale control, or
null
if no scale field is created yet
-
setFocus
public void setFocus()Description copied from class:FieldEditor
Sets the focus to this field editor.The default implementation of this framework method does nothing. Subclasses may reimplement.
- Overrides:
setFocus
in classFieldEditor
-
setIncrement
public void setIncrement(int increment) Set the value to be used for Scale.setIncrement(int) and update the scale.- Parameters:
increment
- a value greater than 0.- See Also:
-
setMaximum
public void setMaximum(int max) Set the value to be used for Scale.setMaximum(int) and update the scale.- Parameters:
max
- a value greater than 0.- See Also:
-
setMinimum
public void setMinimum(int min) Set the value to be used for Scale.setMinumum(int) and update the scale.- Parameters:
min
- a value greater than 0.- See Also:
-
setPageIncrement
public void setPageIncrement(int pageIncrement) Set the value to be used for Scale.setPageIncrement(int) and update the scale.- Parameters:
pageIncrement
- a value greater than 0.- See Also:
-
valueChanged
protected void valueChanged()Informs this field editor's listener, if it has one, about a change to the value (VALUE
property) provided that the old and new values are different.This hook is not called when the scale is initialized (or reset to the default value) from the preference store.
-
setEnabled
Bug 470866 fix- Overrides:
setEnabled
in classFieldEditor
- Parameters:
enabled
- The enabled state.parent
- The parent of the controls in the group. Used to create the controls if required.
-