public class SpinnerContribution
extends org.eclipse.jface.action.ControlContribution
ControlContribution
for an SWT
Spinner
. As such, an instance of a SpinnerContribution
can be
added to JFace ToolBarManager
s, or really any JFace
IContributionManager
.Constructor and Description |
---|
SpinnerContribution(java.lang.String id)
The default constructor.
|
SpinnerContribution(java.lang.String id,
int style)
The full constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addSelectionListener(org.eclipse.swt.events.SelectionListener listener)
Adds a
SelectionListener to the spinner . |
org.eclipse.swt.widgets.Spinner |
getSpinner()
Gets the underlying SWT
Spinner widget. |
void |
setIncrement(int increment)
Sets the [initial] increment for the spinner.
|
void |
setMaximum(int maximum)
Sets the [initial] maximum value for the spinner.
|
void |
setMinimum(int minimum)
Sets the [initial] minimum value for the spinner.
|
void |
setSelection(int selection)
Sets the [initial] selection for the spinner.
|
public SpinnerContribution(java.lang.String id)
id
- The ID of the contribution item.public SpinnerContribution(java.lang.String id, int style)
id
- The ID of the contribution item.style
- The style to use for the spinner
.public void addSelectionListener(org.eclipse.swt.events.SelectionListener listener)
SelectionListener
to the spinner
. If the widget
has not yet been created, the listener will be added when the widget is
created.listener
- The listener to add.public org.eclipse.swt.widgets.Spinner getSpinner()
Spinner
widget.Spinner
, or null
if it has not yet been
created.public void setIncrement(int increment)
increment
- The spinner increment.public void setMaximum(int maximum)
maximum
- The spinner maximum.public void setMinimum(int minimum)
minimum
- The spinner minimum.public void setSelection(int selection)
selection
- The spinner value.