|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.eclipse.jface.preference.FieldEditor
org.mailster.gui.prefs.widgets.SpinnerFieldEditor
public class SpinnerFieldEditor
Allows editing of a numeric value in a Spinner component.
| Field Summary | |
|---|---|
private int |
digits
The number of digit places (default is 0) |
private int |
oldValue
The cached old editor value |
private org.eclipse.swt.widgets.Spinner |
spinnerCtrl
The Spinner control to edit the numeric value |
| Fields inherited from class org.eclipse.jface.preference.FieldEditor |
|---|
HORIZONTAL_GAP, IS_VALID, VALUE |
| Constructor Summary | |
|---|---|
SpinnerFieldEditor(java.lang.String name,
java.lang.String labelText,
org.eclipse.swt.widgets.Composite parent)
Creates a new SpinnerFieldEditor instance. |
|
SpinnerFieldEditor(java.lang.String name,
java.lang.String labelText,
org.eclipse.swt.widgets.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(org.eclipse.swt.widgets.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,
org.eclipse.swt.widgets.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 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, setFocus, setLabelText, setPage, setPreferenceName, setPreferencePage, setPreferenceStore, setPresentsDefaultValue, setPropertyChangeListener, showErrorMessage, showMessage, store |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private org.eclipse.swt.widgets.Spinner spinnerCtrl
private int digits
private int oldValue
| Constructor Detail |
|---|
public SpinnerFieldEditor(java.lang.String name,
java.lang.String labelText,
org.eclipse.swt.widgets.Composite parent)
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(java.lang.String name,
java.lang.String labelText,
org.eclipse.swt.widgets.Composite parent,
int digits)
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()
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)
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.
adjustForNumColumns in class org.eclipse.jface.preference.FieldEditornumColumns - the number of columnsFieldEditor.adjustForNumColumns(int)
protected void doFillIntoGrid(org.eclipse.swt.widgets.Composite parent,
int numColumns)
SpinnerFieldEditor's basic controls into the
given parent.
doFillIntoGrid in class org.eclipse.jface.preference.FieldEditorparent - 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()
SpinnerFieldEditor with the preference
value from the preference store.
doLoad in class org.eclipse.jface.preference.FieldEditorFieldEditor.doLoad()protected void doLoadDefault()
SpinnerFieldEditor with the default
preference value from the preference store.
doLoadDefault in class org.eclipse.jface.preference.FieldEditorFieldEditor.doLoadDefault()protected void doStore()
SpinnerFieldEditor
into the preference store.
doStore in class org.eclipse.jface.preference.FieldEditorFieldEditor.doStore()public int getNumberOfControls()
SpinnerFieldEditor.
Returns 1 as the Spinner is the only
control.
getNumberOfControls in class org.eclipse.jface.preference.FieldEditor1FieldEditor.getNumberOfControls()public void setIncrement(int increment)
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()
SpinnerFieldEditor's value will
be modified by when the up/down arrows are pressed to the argument.
public void setPageIncrement(int increment)
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()
SpinnerFieldEditor's value will
be modified by when the page up/down arrows are pressed to the argument.
public void setMaximum(int maximum)
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()
SpinnerFieldEditor
allows.
public void setMinimum(int minimum)
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()
SpinnerFieldEditor
allows.
public int getIntValue()
SpinnerFieldEditor's current value as an
integer.
public void setEnabled(boolean enabled,
org.eclipse.swt.widgets.Composite parent)
SpinnerFieldEditor.
setEnabled in class org.eclipse.jface.preference.FieldEditorenabled - 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 | |||||||||