|
Eclipse Platform Release 3.0 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.jface.preference.FieldEditor
org.eclipse.jface.preference.ScaleFieldEditor
A field editor for an integer type preference. This class may be used as is, or subclassed as required.
Field Summary | |
protected Scale |
scale
The scale, or null if none. |
Fields inherited from class org.eclipse.jface.preference.FieldEditor |
HORIZONTAL_GAP, IS_VALID, VALUE |
Constructor Summary | |
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. |
Method Summary | |
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.
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected Scale scale
null
if none.
Constructor Detail |
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).Method Detail |
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.
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.
|
Eclipse Platform Release 3.0 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Guidelines for using Eclipse APIs.
Copyright (c) IBM Corp. and others 2000, 2004. All rights reserved.