public class ScaleFieldEditor extends FieldEditor
Modifier and Type | Field and Description |
---|---|
protected Scale |
scale
The scale, or
null if none. |
HORIZONTAL_GAP, IS_VALID, VALUE
Constructor and Description |
---|
ScaleFieldEditor(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.
|
Modifier and Type | Method and Description |
---|---|
protected 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 |
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 |
getIncrement()
Returns the value that will be used for Scale.setIncrement(int).
|
int |
getMaximum()
Returns the value that will be used for Scale.setMaximum(int).
|
int |
getMinimum()
Returns the value that will be used for Scale.setMinimum(int).
|
int |
getNumberOfControls()
Returns the number of basic controls this field editor consists of.
|
int |
getPageIncrement()
Returns the value that will be used for Scale.setPageIncrement(int).
|
Scale |
getScaleControl()
Returns this field editor's scale control.
|
void |
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 |
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. |
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, setEnabled, setLabelText, setPage, setPreferenceName, setPreferencePage, setPreferenceStore, setPresentsDefaultValue, setPropertyChangeListener, showErrorMessage, showMessage, store
protected Scale scale
null
if none.public ScaleFieldEditor(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 ScaleFieldEditor(String name, String labelText, Composite parent, int min, int max, int increment, int pageIncrement)
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).protected void adjustForNumColumns(int numColumns)
FieldEditor
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.
adjustForNumColumns
in class FieldEditor
numColumns
- the number of columnsprotected void doFillIntoGrid(Composite parent, int numColumns)
FieldEditor
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.
doFillIntoGrid
in class FieldEditor
parent
- the composite used as a parent for the basic controls;
the parent's layout must be a GridLayout
numColumns
- the number of columnsprotected void doLoad()
FieldEditor
Subclasses must implement this method to properly initialize the field editor.
doLoad
in class FieldEditor
protected void doLoadDefault()
FieldEditor
Subclasses must implement this method to properly initialize the field editor.
doLoadDefault
in class FieldEditor
protected void doStore()
FieldEditor
Subclasses must implement this method to save the entered value into the preference store.
doStore
in class FieldEditor
public int getIncrement()
Scale.setIncrement(int)
public int getMaximum()
Scale.setMaximum(int)
public int getMinimum()
Scale.setMinimum(int)
public int getNumberOfControls()
FieldEditor
getNumberOfControls
in class FieldEditor
public int getPageIncrement()
Scale.setPageIncrement(int)
public Scale getScaleControl()
null
if no scale field is
created yetpublic void setFocus()
FieldEditor
The default implementation of this framework method does nothing. Subclasses may reimplement.
setFocus
in class FieldEditor
public void setIncrement(int increment)
increment
- a value greater than 0.Scale.setIncrement(int)
public void setMaximum(int max)
max
- a value greater than 0.Scale.setMaximum(int)
public void setMinimum(int min)
min
- a value greater than 0.Scale.setMinimum(int)
public void setPageIncrement(int pageIncrement)
pageIncrement
- a value greater than 0.Scale.setPageIncrement(int)
protected void valueChanged()
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.
Copyright (c) 2000, 2014 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.