Class ScaleFieldEditor
- Since:
- 3.0
-
Field Summary
FieldsFields inherited from class org.eclipse.jface.preference.FieldEditor
HORIZONTAL_GAP, IS_VALID, VALUE -
Constructor Summary
ConstructorsConstructorDescriptionScaleFieldEditor(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 voidadjustForNumColumns(int numColumns) Adjusts the horizontal span of this field editor's basic controls.protected voiddoFillIntoGrid(Composite parent, int numColumns) Fills this field editor's basic controls into the given parent.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 the value that will be used for Scale.setIncrement(int).intReturns the value that will be used for Scale.setMaximum(int).intReturns the value that will be used for Scale.setMinimum(int).intReturns the number of basic controls this field editor consists of.intReturns the value that will be used for Scale.setPageIncrement(int).Returns this field editor's scale control.voidsetEnabled(boolean enabled, Composite parent) Bug 470866 fixvoidsetFocus()Sets the focus to this field editor.voidsetIncrement(int increment) Set the value to be used for Scale.setIncrement(int) and update the scale.voidsetMaximum(int max) Set the value to be used for Scale.setMaximum(int) and update the scale.voidsetMinimum(int min) Set the value to be used for Scale.setMinumum(int) and update the scale.voidsetPageIncrement(int pageIncrement) Set the value to be used for Scale.setPageIncrement(int) and update the scale.protected voidInforms this field editor's listener, if it has one, about a change to the value (VALUEproperty) 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, ornullif 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:FieldEditorAdjusts 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
getNumberOfControlsmethod.- Specified by:
adjustForNumColumnsin classFieldEditor- Parameters:
numColumns- the number of columns
-
doFillIntoGrid
Description copied from class:FieldEditorFills 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:
doFillIntoGridin classFieldEditor- Parameters:
parent- the composite used as a parent for the basic controls; the parent's layout must be aGridLayoutnumColumns- the number of columns
-
doLoad
protected 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.
- Specified by:
doLoadin classFieldEditor
-
doLoadDefault
protected 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.
- Specified by:
doLoadDefaultin classFieldEditor
-
doStore
protected 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.
- Specified by:
doStorein 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:FieldEditorReturns the number of basic controls this field editor consists of.- Specified by:
getNumberOfControlsin 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
nullif no scale field is created yet
-
setFocus
public void setFocus()Description copied from class:FieldEditorSets the focus to this field editor.The default implementation of this framework method does nothing. Subclasses may reimplement.
- Overrides:
setFocusin 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 (VALUEproperty) 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:
setEnabledin classFieldEditor- Parameters:
enabled- The enabled state.parent- The parent of the controls in the group. Used to create the controls if required.
-