|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.eclipse.jface.preference.FieldEditor
net.sourceforge.java.util.gui.jface.preference.SpinnerFieldEditor
Allows editing of a numeric value in a Spinner component.
| Field Summary | |
private int |
digits
|
private int |
oldValue
|
private Spinner |
spinnerCtrl
|
| Fields inherited from class org.eclipse.jface.preference.FieldEditor |
HORIZONTAL_GAP, IS_VALID, VALUE |
| Constructor Summary | |
SpinnerFieldEditor(String name,
String labelText,
Composite parent)
Creates a new SpinnerFieldEditor instance.
|
|
SpinnerFieldEditor(String name,
String labelText,
Composite parent,
int digits)
Creates a new SpinnerFieldEditor instance.
|
|
| Method Summary | |
protected void |
adjustForNumColumns(int numColumns)
Adjusts the horizontal span of this SpinnerFieldEditor's basic controls. |
protected void |
doFillIntoGrid(Composite parent,
int numColumns)
Fills this SpinnerFieldEditor's basic controls
into the given parent.
|
protected void |
doLoad()
Initializes this SpinnerFieldEditor with the
preference value from the preference store.
|
protected void |
doLoadDefault()
Initializes this SpinnerFieldEditor with the
default preference value from the preference store.
|
protected void |
doStore()
Stores the preference value from this SpinnerFieldEditor into the preference store.
|
int |
getIncrement()
Gets the amount that this SpinnerFieldEditor's
value will be modified by when the up/down arrows are pressed to the
argument.
|
int |
getIntValue()
Returns this SpinnerFieldEditor's current value as
an integer.
|
int |
getMaximum()
Gets the maximum value that this this SpinnerFieldEditor allows.
|
int |
getMinimum()
Gets the minimum value that this this SpinnerFieldEditor allows.
|
int |
getNumberOfControls()
Returns the number of controls in this SpinnerFieldEditor. |
int |
getPageIncrement()
Gets the amount that this SpinnerFieldEditor's
value will be modified by when the page up/down arrows are pressed to the
argument.
|
void |
setEnabled(boolean enabled,
Composite parent)
Sets the enabled status of this SpinnerFieldEditor.
|
void |
setIncrement(int increment)
Sets the amount that this SpinnerFieldEditor's
value will be modified by when the up/down arrows are pressed to the
argument, which must be at least one.
|
void |
setMaximum(int maximum)
Sets the maximum value that this this SpinnerFieldEditor will allow. |
void |
setMinimum(int minimum)
Sets the minimum value that this SpinnerFieldEditor
will allow. |
void |
setPageIncrement(int increment)
Sets the amount that this SpinnerFieldEditor's
position will be modified by when the page up/down keys are pressed to
the argument, which must be at least one.
|
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 |
private Spinner spinnerCtrl
private int digits
private int oldValue
| Constructor Detail |
public SpinnerFieldEditor(String name,
String labelText,
Composite parent)
Creates a new SpinnerFieldEditor instance.
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
public SpinnerFieldEditor(String name,
String labelText,
Composite parent,
int digits)
Creates a new SpinnerFieldEditor instance.
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 controldigits - the number of decimal places; The digit setting is used to
allow for floating point values in the receiver.| Method Detail |
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 value is
initialized (or reset to the default value) from the preference store.
protected void adjustForNumColumns(int numColumns)
Adjusts the horizontal span of this
SpinnerFieldEditor's basic controls. The number of
columns will always be equal to or greater than the value returned by
this editor's getNumberOfControls method.
numColumns - the number of columnsFieldEditor.adjustForNumColumns(int)
protected void doFillIntoGrid(Composite parent,
int numColumns)
Fills this SpinnerFieldEditor's basic controls
into the given parent.
parent - the composite used as a parent for the basic controls; the
parent's layout must be a GridLayoutnumColumns - the number of columnsFieldEditor.doFillIntoGrid(org.eclipse.swt.widgets.Composite,
int)protected void doLoad()
Initializes this SpinnerFieldEditor with the
preference value from the preference store.
FieldEditor.doLoad()protected void doLoadDefault()
Initializes this SpinnerFieldEditor with the
default preference value from the preference store.
FieldEditor.doLoadDefault()protected void doStore()
Stores the preference value from this
SpinnerFieldEditor into the preference store.
FieldEditor.doStore()public int getNumberOfControls()
SpinnerFieldEditor. Returns 1 as the
Spinner is the only control.
1FieldEditor.getNumberOfControls()public void setIncrement(int increment)
Sets the amount that this SpinnerFieldEditor's
value will be modified by when the up/down arrows are pressed to the
argument, which must be at least one.
increment - the new increment (must be greater than zero)public int getIncrement()
Gets the amount that this SpinnerFieldEditor's
value will be modified by when the up/down arrows are pressed to the
argument.
public void setPageIncrement(int increment)
Sets the amount that this SpinnerFieldEditor's
position will be modified by when the page up/down keys are pressed to
the argument, which must be at least one.
increment - the new page increment (must be greater than zero)public int getPageIncrement()
Gets the amount that this SpinnerFieldEditor's
value will be modified by when the page up/down arrows are pressed to the
argument.
public void setMaximum(int maximum)
Sets the maximum value that this this
SpinnerFieldEditor will allow. This new value will
be ignored if it is not greater than this
SpinnerFieldEditor's current minimum value. If the
new maximum is applied then this this
SpinnerFieldEditor's selection value will be
adjusted if necessary to fall within its new range.
maximum - the new maximum, which must be greater than the current
minimumpublic int getMaximum()
Gets the maximum value that this this
SpinnerFieldEditor allows.
public void setMinimum(int minimum)
Sets the minimum value that this SpinnerFieldEditor
will allow. This new value will be ignored if it is negative or is not
less than this SpinnerFieldEditor's current
maximum value. If the new minimum is applied then this
SpinnerFieldEditor's selection value will be
adjusted if necessary to fall within its new range.
minimum - the new minimum, which must be nonnegative and less than
the current maximumpublic int getMinimum()
Gets the minimum value that this this
SpinnerFieldEditor allows.
public int getIntValue()
Returns this SpinnerFieldEditor's current value as
an integer.
public void setEnabled(boolean enabled,
Composite parent)
Sets the enabled status of this SpinnerFieldEditor.
enabled - true to enable, false to disable
this SpinnerFieldEditorparent - the parent CompositeFieldEditor.setEnabled(boolean, Composite)
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||