Top Description Fields Constructors Methods
org.eclipse.swt.widgets

public Class Spinner

extends Composite
Class Inheritance
Imports
org.eclipse.swt.*, org.eclipse.swt.events.*, org.eclipse.swt.graphics.*, org.eclipse.swt.internal.*, org.eclipse.swt.internal.gtk.*, org.eclipse.swt.internal.gtk3.*, org.eclipse.swt.internal.gtk4.*

Instances of this class are selectable user interface objects that allow the user to enter and modify numeric values.

Note that although this class is a subclass of Composite, it does not make sense to add children to it, or set a layout on it.

Styles:
READ_ONLY, WRAP
Events:
Selection, Modify, Verify

Important Note

This class is not intended to be subclassed.

Since
3.1
See Also
Spinner snippets, SWT Example: ControlExample, Sample code and further information

Field Summary

Modifier and TypeField and Description
pack-priv GdkRGBA
pack-priv double
pack-priv long
pack-priv int
pack-priv int
pack-priv long
pack-priv long
pack-priv int
public static final int
LIMIT

the operating system limit for the number of characters that the text field in an instance of this class can hold

pack-priv static final int
Inherited from org.eclipse.swt.widgets.Composite:
backgroundModechildrenLoweredembeddedHandlefixClipHandlefixClipMapimHandlelayoutlayoutCountNO_INPUT_METHODnoChildDrawingpopupChildsocketHandletabList

Constructor Summary

AccessConstructor and Description
public
Spinner(Composite
a composite control which will be the parent of the new instance (cannot be null)
parent
,
int
the style of control to construct
style
)

Constructs a new instance of this class given its parent and a style value describing its behavior and appearance.

Method Summary

Modifier and TypeMethod and Description
public void
addModifyListener(ModifyListener
the listener which should be notified
listener
)

Adds the listener to the collection of listeners who will be notified when the receiver's text is modified, by sending it one of the messages defined in the ModifyListener interface.

public void
addSelectionListener(SelectionListener
the listener which should be notified when the control is selected by the user
listener
)

Adds the listener to the collection of listeners who will be notified when the control is selected by the user, by sending it one of the messages defined in the SelectionListener interface.

pack-priv void
addVerifyListener(VerifyListener
the listener which should be notified
listener
)

Adds the listener to the collection of listeners who will be notified when the receiver's text is verified, by sending it one of the messages defined in the VerifyListener interface.

pack-priv static int
protected void
checkSubclass()

Overrides org.eclipse.swt.widgets.Composite.checkSubclass.

Checks that this class can be subclassed.
pack-priv boolean
pack-priv Point
computeSizeInPixels(int wHint, int hHint, boolean changed)

Overrides org.eclipse.swt.widgets.Composite.computeSizeInPixels.

pack-priv Rectangle
computeTrimInPixels(int x, int y, int width, int height)

Overrides org.eclipse.swt.widgets.Scrollable.computeTrimInPixels.

public void
copy()

Copies the selected text.

pack-priv void
public void
cut()

Cuts the selected text.

pack-priv GdkRGBA
pack-priv void
pack-priv long
pack-priv long
pack-priv long
pack-priv boolean
pack-priv void
pack-priv int
pack-priv GdkRGBA
pack-priv String
public int

Returns:

the digits
getDigits
()

Returns the number of decimal places used by the receiver.

public int

Returns:

the increment
getIncrement
()

Returns the amount that the receiver's value will be modified by when the up/down arrows are pressed.

public int

Returns:

the maximum
getMaximum
()

Returns the maximum value which the receiver will allow.

public int

Returns:

the minimum
getMinimum
()

Returns the minimum value which the receiver will allow.

public int

Returns:

the page increment
getPageIncrement
()

Returns the amount that the receiver's position will be modified by when the page up/down keys are pressed.

public int

Returns:

the selection
getSelection
()

Returns the selection, which is the receiver's position.

public String

Returns:

the receiver's text
getText
()

Returns a string containing a copy of the contents of the receiver's text field, or an empty string if there are no contents.

public int

Returns:

the text limit
getTextLimit
()

Returns the maximum number of characters that the receiver's text field is capable of holding.

pack-priv long
pack-priv long
pack-priv long
gtk_commit(long imContext, long text)

Overrides org.eclipse.swt.widgets.Control.gtk_commit.

pack-priv long
gtk_delete_text(long widget, long start_pos, long end_pos)

Overrides org.eclipse.swt.widgets.Widget.gtk_delete_text.

pack-priv long
pack-priv long
pack-priv long
gtk_insert_text(long widget, long new_text, long new_text_length, long position)

Overrides org.eclipse.swt.widgets.Widget.gtk_insert_text.

pack-priv long
pack-priv long
pack-priv long
pack-priv void
pack-priv long
pack-priv long
pack-priv long
public void
paste()

Pastes text from clipboard.

pack-priv void
pack-priv void
public void
removeModifyListener(ModifyListener
the listener which should no longer be notified
listener
)

Removes the listener from the collection of listeners who will be notified when the receiver's text is modified.

public void
removeSelectionListener(SelectionListener
the listener which should no longer be notified
listener
)

Removes the listener from the collection of listeners who will be notified when the control is selected by the user.

pack-priv void
removeVerifyListener(VerifyListener
the listener which should be notified
listener
)

Removes the listener from the collection of listeners who will be notified when the control is verified.

pack-priv void
pack-priv void
public void
setDigits(int
the new digits (must be greater than or equal to zero)
value
)

Sets the number of decimal places used by the receiver.

public void
setIncrement(int
the new increment (must be greater than zero)
value
)

Sets the amount that the receiver's value will be modified by when the up/down arrows are pressed to the argument, which must be at least one.

public void
setMaximum(int
the new maximum, which must be greater than or equal to the current minimum
value
)

Sets the maximum value that the receiver will allow.

public void
setMinimum(int
the new minimum, which must be less than or equal to the current maximum
value
)

Sets the minimum value that the receiver will allow.

public void
setPageIncrement(int
the page increment (must be greater than zero)
value
)

Sets the amount that the receiver's position will be modified by when the page up/down keys are pressed to the argument, which must be at least one.

public void
setSelection(int
the new selection (must be zero or greater)
value
)

Sets the selection, which is the receiver's position, to the argument.

public void
setTextLimit(int
new text limit
limit
)

Sets the maximum number of characters that the receiver's text field is capable of holding to be the argument.

public void
setValues(int
the new selection value
selection
,
int
the new minimum value
minimum
,
int
the new maximum value
maximum
,
int
the new digits value
digits
,
int
the new increment value
increment
,
int
the new pageIncrement value
pageIncrement
)

Sets the receiver's selection, minimum value, maximum value, digits, increment and page increment all at once.

pack-priv boolean
pack-priv String
verifyText(String string, int start, int end)

Inherited from org.eclipse.swt.widgets.Composite:
_getChildren_getTabListadjustChildClippingapplyThemeBackgroundchangedcheckBufferedcomputeTabListconnectFixedHandleDrawcreateHandledrawBackgrounddrawBackgroundInPixelsenableWidgetfindDeferredControlfindMenusfixChildrenfixClippingsfixModalfixParentGdkResourcefixStylefixTabListfixZOrderfocusHandleforceFocusgetBackgroundModegetChildrengetChildrenCountgetClientAreaInPixelsgetLayoutgetLayoutDeferredgetTabListgtk4_key_press_eventgtk_button_press_eventgtk_drawgtk_focusgtk_focus_in_eventgtk_mapgtk_realizegtk_scroll_childgtk_style_updatedhasBorderhooksKeysimHandleisLayoutDeferredisTabGrouplayoutlayoutlayoutlayoutlayoutmarkLayoutminimumSizemoveAbovemoveBelowmoveChildrenmustBeVisibleOnInitBoundsparentingHandleprintWidgetpropagateDrawredrawChildrenreleaseChildrenreleaseHandleremoveControlresizeHandlereskinChildrensetBackgroundModesetBoundssetFocussetLayoutsetLayoutDeferredsetOrientationsetScrollBarVisiblesetTabGroupFocussetTabItemFocussetTabListshowWidgettoStringtranslateMnemonictraversalCodeupdateBackgroundModeupdateLayout

Field Detail

backgroundback to summary
pack-priv GdkRGBA background
climbRateback to summary
pack-priv double climbRate
entryHandleback to summary
pack-priv long entryHandle
fixEndback to summary
pack-priv int fixEnd
fixStartback to summary
pack-priv int fixStart
gdkEventKeyback to summary
pack-priv long gdkEventKey
imContextback to summary
pack-priv long imContext
lastEventTimeback to summary
pack-priv int lastEventTime
LIMITback to summary
public static final int LIMIT

the operating system limit for the number of characters that the text field in an instance of this class can hold

Since
3.4
MIN_ARROW_WIDTHback to summary
pack-priv static final int MIN_ARROW_WIDTH

Constructor Detail

Spinnerback to summary
public Spinner(Composite parent, int style)

Constructs a new instance of this class given its parent and a style value describing its behavior and appearance.

The style value is either one of the style constants defined in class SWT which is applicable to instances of this class, or must be built by bitwise OR'ing together (that is, using the int "|" operator) two or more of those SWT style constants. The class description lists the style constants that are applicable to the class. Style bits are also inherited from superclasses.

Parameters
parent:Composite

a composite control which will be the parent of the new instance (cannot be null)

style:int

the style of control to construct

Exceptions
IllegalArgumentException:
  • ERROR_NULL_ARGUMENT - if the parent is null
SWTException:
  • ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent
  • ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass
See Also
SWT#READ_ONLY, SWT#WRAP, Widget#checkSubclass, Widget#getStyle

Method Detail

addModifyListenerback to summary
public void addModifyListener(ModifyListener listener)

Adds the listener to the collection of listeners who will be notified when the receiver's text is modified, by sending it one of the messages defined in the ModifyListener interface.

Parameters
listener:ModifyListener

the listener which should be notified

Exceptions
IllegalArgumentException:
  • ERROR_NULL_ARGUMENT - if the listener is null
SWTException:
  • ERROR_WIDGET_DISPOSED - if the receiver has been disposed
  • ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
See Also
ModifyListener, removeModifyListener
addSelectionListenerback to summary
public void addSelectionListener(SelectionListener listener)

Adds the listener to the collection of listeners who will be notified when the control is selected by the user, by sending it one of the messages defined in the SelectionListener interface.

widgetSelected is not called for texts. widgetDefaultSelected is typically called when ENTER is pressed in a single-line text.

Parameters
listener:SelectionListener

the listener which should be notified when the control is selected by the user

Exceptions
IllegalArgumentException:
  • ERROR_NULL_ARGUMENT - if the listener is null
SWTException:
  • ERROR_WIDGET_DISPOSED - if the receiver has been disposed
  • ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
See Also
SelectionListener, removeSelectionListener, SelectionEvent
addVerifyListenerback to summary
pack-priv void addVerifyListener(VerifyListener listener)

Adds the listener to the collection of listeners who will be notified when the receiver's text is verified, by sending it one of the messages defined in the VerifyListener interface.

Parameters
listener:VerifyListener

the listener which should be notified

Exceptions
IllegalArgumentException:
  • ERROR_NULL_ARGUMENT - if the listener is null
SWTException:
  • ERROR_WIDGET_DISPOSED - if the receiver has been disposed
  • ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
See Also
VerifyListener, removeVerifyListener
checkStyleback to summary
pack-priv static int checkStyle(int style)

Hides org.eclipse.swt.widgets.Composite.checkStyle.

checkSubclassback to summary
protected void checkSubclass()

Overrides org.eclipse.swt.widgets.Composite.checkSubclass.

Doc from org.eclipse.swt.widgets.Widget.checkSubclass.

Checks that this class can be subclassed.

The SWT class library is intended to be subclassed only at specific, controlled points (most notably, Composite and Canvas when implementing new widgets). This method enforces this rule unless it is overridden.

Important Note

By providing an implementation of this method that allows a subclass of a class which does not normally allow subclassing to be created, the implementer agrees to be fully responsible for the fact that any such subclass will likely fail between SWT releases and will be strongly platform specific. No support is provided for user-written classes which are implemented in this fashion.

The ability to subclass outside of the allowed SWT classes is intended purely to enable those not on the SWT development team to implement patches in order to get around specific limitations in advance of when those limitations can be addressed by the team. Subclassing should not be attempted without an intimate and detailed understanding of the hierarchy.

Annotations
@Override
checkSubwindowback to summary
pack-priv boolean checkSubwindow()

Overrides org.eclipse.swt.widgets.Composite.checkSubwindow.

Annotations
@Override
computeSizeInPixelsback to summary
pack-priv Point computeSizeInPixels(int wHint, int hHint, boolean changed)

Overrides org.eclipse.swt.widgets.Composite.computeSizeInPixels.

Annotations
@Override
computeTrimInPixelsback to summary
pack-priv Rectangle computeTrimInPixels(int x, int y, int width, int height)

Overrides org.eclipse.swt.widgets.Scrollable.computeTrimInPixels.

Annotations
@Override
copyback to summary
public void copy()

Copies the selected text.

The current selection is copied to the clipboard.

Exceptions
SWTException:
  • ERROR_WIDGET_DISPOSED - if the receiver has been disposed
  • ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
createHandleback to summary
pack-priv void createHandle(int index)

Overrides org.eclipse.swt.widgets.Composite.createHandle.

Annotations
@Override
cutback to summary
public void cut()

Cuts the selected text.

The current selection is first copied to the clipboard and then deleted from the widget.

Exceptions
SWTException:
  • ERROR_WIDGET_DISPOSED - if the receiver has been disposed
  • ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
defaultBackgroundback to summary
pack-priv GdkRGBA defaultBackground()

Overrides org.eclipse.swt.widgets.Control.defaultBackground.

Annotations
@Override
deregisterback to summary
pack-priv void deregister()

Overrides org.eclipse.swt.widgets.Composite.deregister.

Annotations
@Override
enterExitHandleback to summary
pack-priv long enterExitHandle()

Overrides org.eclipse.swt.widgets.Control.enterExitHandle.

Annotations
@Override
eventSurfaceback to summary
pack-priv long eventSurface()

Overrides org.eclipse.swt.widgets.Control.eventSurface.

Annotations
@Override
eventWindowback to summary
pack-priv long eventWindow()

Overrides org.eclipse.swt.widgets.Control.eventWindow.

Annotations
@Override
filterKeyback to summary
pack-priv boolean filterKey(long event)

Overrides org.eclipse.swt.widgets.Control.filterKey.

Annotations
@Override
fixIMback to summary
pack-priv void fixIM()
getBorderWidthInPixelsback to summary
pack-priv int getBorderWidthInPixels()

Overrides org.eclipse.swt.widgets.Scrollable.getBorderWidthInPixels.

Annotations
@Override
getContextBackgroundGdkRGBAback to summary
pack-priv GdkRGBA getContextBackgroundGdkRGBA()

Overrides org.eclipse.swt.widgets.Control.getContextBackgroundGdkRGBA.

Annotations
@Override
getDecimalSeparatorback to summary
pack-priv String getDecimalSeparator()
getDigitsback to summary
public int getDigits()

Returns the number of decimal places used by the receiver.

Returns:int

the digits

Exceptions
SWTException:
  • ERROR_WIDGET_DISPOSED - if the receiver has been disposed
  • ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
getIncrementback to summary
public int getIncrement()

Returns the amount that the receiver's value will be modified by when the up/down arrows are pressed.

Returns:int

the increment

Exceptions
SWTException:
  • ERROR_WIDGET_DISPOSED - if the receiver has been disposed
  • ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
getMaximumback to summary
public int getMaximum()

Returns the maximum value which the receiver will allow.

Returns:int

the maximum

Exceptions
SWTException:
  • ERROR_WIDGET_DISPOSED - if the receiver has been disposed
  • ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
getMinimumback to summary
public int getMinimum()

Returns the minimum value which the receiver will allow.

Returns:int

the minimum

Exceptions
SWTException:
  • ERROR_WIDGET_DISPOSED - if the receiver has been disposed
  • ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
getPageIncrementback to summary
public int getPageIncrement()

Returns the amount that the receiver's position will be modified by when the page up/down keys are pressed.

Returns:int

the page increment

Exceptions
SWTException:
  • ERROR_WIDGET_DISPOSED - if the receiver has been disposed
  • ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
getSelectionback to summary
public int getSelection()

Returns the selection, which is the receiver's position.

Returns:int

the selection

Exceptions
SWTException:
  • ERROR_WIDGET_DISPOSED - if the receiver has been disposed
  • ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
getTextback to summary
public String getText()

Returns a string containing a copy of the contents of the receiver's text field, or an empty string if there are no contents.

Returns:String

the receiver's text

Exceptions
SWTException:
  • ERROR_WIDGET_DISPOSED - if the receiver has been disposed
  • ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
Since
3.4
getTextLimitback to summary
public int getTextLimit()

Returns the maximum number of characters that the receiver's text field is capable of holding. If this has not been changed by setTextLimit(), it will be the constant Spinner.LIMIT.

Returns:int

the text limit

Exceptions
SWTException:
  • ERROR_WIDGET_DISPOSED - if the receiver has been disposed
  • ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
Since
3.4
See Also
LIMIT
gtk_activateback to summary
pack-priv long gtk_activate(long widget)

Overrides org.eclipse.swt.widgets.Widget.gtk_activate.

Annotations
@Override
gtk_changedback to summary
pack-priv long gtk_changed(long widget)

Overrides org.eclipse.swt.widgets.Widget.gtk_changed.

Annotations
@Override
gtk_commitback to summary
pack-priv long gtk_commit(long imContext, long text)

Overrides org.eclipse.swt.widgets.Control.gtk_commit.

Annotations
@Override
gtk_delete_textback to summary
pack-priv long gtk_delete_text(long widget, long start_pos, long end_pos)

Overrides org.eclipse.swt.widgets.Widget.gtk_delete_text.

Annotations
@Override
gtk_event_afterback to summary
pack-priv long gtk_event_after(long widget, long gdkEvent)

Overrides org.eclipse.swt.widgets.Control.gtk_event_after.

Annotations
@Override
gtk_focus_out_eventback to summary
pack-priv long gtk_focus_out_event(long widget, long event)

Overrides org.eclipse.swt.widgets.Composite.gtk_focus_out_event.

Annotations
@Override
gtk_insert_textback to summary
pack-priv long gtk_insert_text(long widget, long new_text, long new_text_length, long position)

Overrides org.eclipse.swt.widgets.Widget.gtk_insert_text.

Annotations
@Override
gtk_key_press_eventback to summary
pack-priv long gtk_key_press_event(long widget, long event)

Overrides org.eclipse.swt.widgets.Composite.gtk_key_press_event.

Annotations
@Override
gtk_populate_popupback to summary
pack-priv long gtk_populate_popup(long widget, long menu)

Overrides org.eclipse.swt.widgets.Widget.gtk_populate_popup.

Annotations
@Override
gtk_value_changedback to summary
pack-priv long gtk_value_changed(long range)

Overrides org.eclipse.swt.widgets.Widget.gtk_value_changed.

Annotations
@Override
hookEventsback to summary
pack-priv void hookEvents()

Overrides org.eclipse.swt.widgets.Composite.hookEvents.

Annotations
@Override
imContextback to summary
pack-priv long imContext()
paintSurfaceback to summary
pack-priv long paintSurface()

Overrides org.eclipse.swt.widgets.Control.paintSurface.

Annotations
@Override
paintWindowback to summary
pack-priv long paintWindow()

Overrides org.eclipse.swt.widgets.Control.paintWindow.

Annotations
@Override
pasteback to summary
public void paste()

Pastes text from clipboard.

The selected text is deleted from the widget and new text inserted from the clipboard.

Exceptions
SWTException:
  • ERROR_WIDGET_DISPOSED - if the receiver has been disposed
  • ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
registerback to summary
pack-priv void register()

Overrides org.eclipse.swt.widgets.Composite.register.

Annotations
@Override
releaseWidgetback to summary
pack-priv void releaseWidget()

Overrides org.eclipse.swt.widgets.Composite.releaseWidget.

Annotations
@Override
removeModifyListenerback to summary
public void removeModifyListener(ModifyListener listener)

Removes the listener from the collection of listeners who will be notified when the receiver's text is modified.

Parameters
listener:ModifyListener

the listener which should no longer be notified

Exceptions
IllegalArgumentException:
  • ERROR_NULL_ARGUMENT - if the listener is null
SWTException:
  • ERROR_WIDGET_DISPOSED - if the receiver has been disposed
  • ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
See Also
ModifyListener, addModifyListener
removeSelectionListenerback to summary
public void removeSelectionListener(SelectionListener listener)

Removes the listener from the collection of listeners who will be notified when the control is selected by the user.

Parameters
listener:SelectionListener

the listener which should no longer be notified

Exceptions
IllegalArgumentException:
  • ERROR_NULL_ARGUMENT - if the listener is null
SWTException:
  • ERROR_WIDGET_DISPOSED - if the receiver has been disposed
  • ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
See Also
SelectionListener, addSelectionListener
removeVerifyListenerback to summary
pack-priv void removeVerifyListener(VerifyListener listener)

Removes the listener from the collection of listeners who will be notified when the control is verified.

Parameters
listener:VerifyListener

the listener which should be notified

Exceptions
IllegalArgumentException:
  • ERROR_NULL_ARGUMENT - if the listener is null
SWTException:
  • ERROR_WIDGET_DISPOSED - if the receiver has been disposed
  • ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
See Also
VerifyListener, addVerifyListener
setBackgroundGdkRGBAback to summary
pack-priv void setBackgroundGdkRGBA(long context, long handle, GdkRGBA rgba)

Overrides org.eclipse.swt.widgets.Control.setBackgroundGdkRGBA.

Annotations
@Override
setCursorback to summary
pack-priv void setCursor(long cursor)

Overrides org.eclipse.swt.widgets.Control.setCursor.

Annotations
@Override
setDigitsback to summary
public void setDigits(int value)

Sets the number of decimal places used by the receiver.

The digit setting is used to allow for floating point values in the receiver. For example, to set the selection to a floating point value of 1.37 call setDigits() with a value of 2 and setSelection() with a value of 137. Similarly, if getDigits() has a value of 2 and getSelection() returns 137 this should be interpreted as 1.37. This applies to all numeric APIs.

Parameters
value:int

the new digits (must be greater than or equal to zero)

Exceptions
IllegalArgumentException:
  • ERROR_INVALID_ARGUMENT - if the value is less than zero
SWTException:
  • ERROR_WIDGET_DISPOSED - if the receiver has been disposed
  • ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
setIncrementback to summary
public void setIncrement(int value)

Sets the amount that the receiver's value will be modified by when the up/down arrows are pressed to the argument, which must be at least one.

Parameters
value:int

the new increment (must be greater than zero)

Exceptions
SWTException:
  • ERROR_WIDGET_DISPOSED - if the receiver has been disposed
  • ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
setMaximumback to summary
public void setMaximum(int value)

Sets the maximum value that the receiver will allow. This new value will be ignored if it is less than the receiver's current minimum value. If the new maximum is applied then the receiver's selection value will be adjusted if necessary to fall within its new range.

Parameters
value:int

the new maximum, which must be greater than or equal to the current minimum

Exceptions
SWTException:
  • ERROR_WIDGET_DISPOSED - if the receiver has been disposed
  • ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
setMinimumback to summary
public void setMinimum(int value)

Sets the minimum value that the receiver will allow. This new value will be ignored if it is greater than the receiver's current maximum value. If the new minimum is applied then the receiver's selection value will be adjusted if necessary to fall within its new range.

Parameters
value:int

the new minimum, which must be less than or equal to the current maximum

Exceptions
SWTException:
  • ERROR_WIDGET_DISPOSED - if the receiver has been disposed
  • ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
setPageIncrementback to summary
public void setPageIncrement(int value)

Sets the amount that the receiver's position will be modified by when the page up/down keys are pressed to the argument, which must be at least one.

Parameters
value:int

the page increment (must be greater than zero)

Exceptions
SWTException:
  • ERROR_WIDGET_DISPOSED - if the receiver has been disposed
  • ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
setSelectionback to summary
public void setSelection(int value)

Sets the selection, which is the receiver's position, to the argument. If the argument is not within the range specified by minimum and maximum, it will be adjusted to fall within this range.

Parameters
value:int

the new selection (must be zero or greater)

Exceptions
SWTException:
  • ERROR_WIDGET_DISPOSED - if the receiver has been disposed
  • ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
setTextLimitback to summary
public void setTextLimit(int limit)

Sets the maximum number of characters that the receiver's text field is capable of holding to be the argument.

To reset this value to the default, use setTextLimit(Spinner.LIMIT). Specifying a limit value larger than Spinner.LIMIT sets the receiver's limit to Spinner.LIMIT.

Parameters
limit:int

new text limit

Exceptions
IllegalArgumentException:
  • ERROR_CANNOT_BE_ZERO - if the limit is zero
SWTException:
  • ERROR_WIDGET_DISPOSED - if the receiver has been disposed
  • ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
Since
3.4
See Also
LIMIT
setValuesback to summary
public void setValues(int selection, int minimum, int maximum, int digits, int increment, int pageIncrement)

Sets the receiver's selection, minimum value, maximum value, digits, increment and page increment all at once.

Note

This is similar to setting the values individually using the appropriate methods, but may be implemented in a more efficient fashion on some platforms.

Parameters
selection:int

the new selection value

minimum:int

the new minimum value

maximum:int

the new maximum value

digits:int

the new digits value

increment:int

the new increment value

pageIncrement:int

the new pageIncrement value

Exceptions
SWTException:
  • ERROR_WIDGET_DISPOSED - if the receiver has been disposed
  • ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
Since
3.2
translateTraversalback to summary
pack-priv boolean translateTraversal(long event)

Overrides org.eclipse.swt.widgets.Composite.translateTraversal.

Annotations
@Override
verifyTextback to summary
pack-priv String verifyText(String string, int start, int end)