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

public Class ScrollBar

extends Widget
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 represent a range of positive, numeric values.

At any given moment, a given scroll bar will have a single 'selection' that is considered to be its value, which is constrained to be within the range of values the scroll bar represents (that is, between its minimum and maximum values).

Typically, scroll bars will be made up of five areas:

  1. an arrow button for decrementing the value
  2. a page decrement area for decrementing the value by a larger amount
  3. a thumb for modifying the value by mouse dragging
  4. a page increment area for incrementing the value by a larger amount
  5. an arrow button for incrementing the value

Based on their style, scroll bars are either HORIZONTAL (which have a left facing button for decrementing the value and a right facing button for incrementing it) or VERTICAL (which have an upward facing button for decrementing the value and a downward facing buttons for incrementing it).

On some platforms, the size of the scroll bar's thumb can be varied relative to the magnitude of the range of values it represents (that is, relative to the difference between its maximum and minimum values). Typically, this is used to indicate some proportional value such as the ratio of the visible area of a document to the total amount of space that it would take to display it. SWT supports setting the thumb size even if the underlying platform does not, but in this case the appearance of the scroll bar will not change.

Scroll bars are created by specifying either H_SCROLL, V_SCROLL or both when creating a Scrollable. They are accessed from the Scrollable using getHorizontalBar and getVerticalBar.

Note

Scroll bars are not Controls. On some platforms, scroll bars that appear as part of some standard controls such as a text or list have no operating system resources and are not children of the control. For this reason, scroll bars are treated specially. To create a control that looks like a scroll bar but has operating system resources, use Slider.

Styles:
HORIZONTAL, VERTICAL
Events:
Selection

Note

Only one of the styles HORIZONTAL and VERTICAL may be specified.

Important Note

This class is not intended to be subclassed.

See Also
Slider, Scrollable, Scrollable#getHorizontalBar, Scrollable#getVerticalBar, SWT Example: ControlExample, Sample code and further information

Field Summary

Modifier and TypeField and Description
pack-priv long
pack-priv int
pack-priv boolean
pack-priv Scrollable
Inherited from org.eclipse.swt.widgets.Widget:
ACTIVATEACTIVATE_INVERSEAUTO_TEXT_DIRECTIONBACKGROUNDBACKSPACEBACKSPACE_INVERSEBUTTON_PRESS_EVENTBUTTON_PRESS_EVENT_INVERSEBUTTON_RELEASE_EVENTBUTTON_RELEASE_EVENT_INVERSECANVASCHANGE_VALUECHANGEDCHECK_SUBWINDOWCLICKEDCLOSE_REQUESTCOMMITCOMPUTE_SIZECONFIGURE_EVENTCOPY_CLIPBOARDCOPY_CLIPBOARD_INVERSECREATE_MENU_PROXYCUT_CLIPBOARDCUT_CLIPBOARD_INVERSEdataDAY_SELECTEDDAY_SELECTED_DOUBLE_CLICKDECELERATEDEFAULT_HEIGHTDEFAULT_WIDTHDELETE_EVENTDELETE_FROM_CURSORDELETE_FROM_CURSOR_INVERSEDELETE_RANGEDELETE_TEXTDIRECTION_CHANGEDDISABLEDdisplayDISPOSE_SENTDISPOSEDDPI_CHANGEDDRAG_DETECTDRAWENTERENTER_NOTIFY_EVENTEVENTEVENT_AFTEReventTableEXPAND_COLLAPSE_CURSOR_ROWEXPOSE_EVENTEXPOSE_EVENT_INVERSEFOCUSFOCUS_INFOCUS_IN_EVENTFOCUS_OUTFOCUS_OUT_EVENTFONTFOREGROUNDFOREIGN_HANDLEgdkSeatGrabPrepareFuncGESTURE_PRESSEDGESTURE_RELEASEDGRAB_FOCUShandleHANDLEHAS_AUTO_DIRECTIONHIDDENHIDEICON_RELEASEIM_UPDATEINPUTINSERT_TEXTIS_ACTIVEKEY_CHECK_SUBWINDOWKEY_GTK_CSSKEY_PRESS_EVENTKEY_PRESSEDKEY_RELEASE_EVENTKEY_RELEASEDKEYED_DATALAST_SIGNALLAYOUT_CHANGEDLAYOUT_CHILDLAYOUT_NEEDEDLEAVELEAVE_NOTIFY_EVENTMAPMAP_EVENTMENUMNEMONIC_ACTIVATEMONTH_CHANGEDMOTIONMOTION_INVERSEMOTION_NOTIFY_EVENTMOTION_NOTIFY_EVENT_INVERSEMOVE_CURSORMOVE_CURSOR_INVERSEMOVE_FOCUSMOVEDNOTIFY_DEFAULT_HEIGHTNOTIFY_DEFAULT_WIDTHNOTIFY_MAXIMIZEDNOTIFY_STATEOBSCUREDOUTPUTPARENT_BACKGROUNDPASTE_CLIPBOARDPASTE_CLIPBOARD_INVERSEPOPPED_UPPOPULATE_POPUPPOPUP_MENUPREEDIT_CHANGEDREALIZERELEASEDRESIZEDROW_ACTIVATEDROW_DELETEDROW_HAS_CHILD_TOGGLEDROW_INSERTEDSCROLLSCROLL_BEGINSCROLL_CHILDSCROLL_ENDSCROLL_EVENTSELECTSELECTION_DONESHOWSHOW_HELPSIZE_ALLOCATESIZE_ALLOCATE_GTK4SKIN_NEEDEDSTART_INTERACTIVE_SEARCHstateSTATUS_ICON_POPUP_MENUstyleSTYLE_UPDATEDSWITCH_PAGETEST_COLLAPSE_ROWTEST_EXPAND_ROWTEXT_BUFFER_INSERT_TEXTTHEME_BACKGROUNDTOGGLEDUNMAPUNMAP_EVENTUNREALIZEVALUE_CHANGEDWINDOW_STATE_EVENTZERO_HEIGHTZERO_WIDTH

Constructor Summary

AccessConstructor and Description
pack-priv
pack-priv
ScrollBar(Scrollable parent, int style)

Creates a new instance of the widget.

Method Summary

Modifier and TypeMethod and Description
public void
addSelectionListener(SelectionListener
the listener which should be notified when the user changes the receiver's value
listener
)

Adds the listener to the collection of listeners who will be notified when the user changes the receiver's value, by sending it one of the messages defined in the SelectionListener interface.

pack-priv static int
checkStyle(int style)

pack-priv void
pack-priv void
public boolean

Returns:

the receiver's enabled state
getEnabled
()

Returns true if the receiver is enabled, and false otherwise.

public int

Returns:

the increment
getIncrement
()

Returns the amount that the receiver's value will be modified by when the up/down (or right/left) 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 value will be modified by when the page increment/decrement areas are selected.

public Scrollable

Returns:

the receiver's parent
getParent
()

Returns the receiver's parent, which must be a Scrollable.

public int

Returns:

the selection
getSelection
()

Returns the single 'selection' that is the receiver's value.

public Point

Returns:

the receiver's size
getSize
()

Returns a point describing the receiver's size.

pack-priv Point
public int

Returns:

the thumb value
getThumb
()

Returns the receiver's thumb value.

public Rectangle

Returns:

the thumb bounds, relative to the parent
getThumbBounds
()

Returns a rectangle describing the size and location of the receiver's thumb relative to its parent.

pack-priv Rectangle
public Rectangle

Returns:

the thumb track bounds, relative to the parent
getThumbTrackBounds
()

Returns a rectangle describing the size and location of the receiver's thumb track relative to its parent.

pack-priv Rectangle
public boolean

Returns:

the receiver's visibility state
getVisible
()

Returns true if the receiver is visible, and false otherwise.

pack-priv long
pack-priv boolean
gtk_change_value(long widget, int scroll, double value, long user_data)

Overrides org.eclipse.swt.widgets.Widget.gtk_change_value.

pack-priv long
pack-priv long
pack-priv void
public boolean

Returns:

the receiver's enabled state
isEnabled
()

Returns true if the receiver is enabled and all of the receiver's ancestors are enabled, and false otherwise.

public boolean

Returns:

the receiver's visibility state
isVisible
()

Returns true if the receiver is visible and all of the receiver's ancestors are visible and false otherwise.

pack-priv void
pack-priv void
pack-priv void
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 user changes the receiver's value.

public void
setEnabled(boolean
the new enabled state
enabled
)

Enables the receiver if the argument is true, and disables it otherwise.

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 (or right/left) arrows are pressed to the argument, which must be at least one.

public void
setMaximum(int
the new maximum
value
)

Sets the maximum.

public void
setMinimum(int
the new minimum
value
)

Sets the minimum value.

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

Sets the amount that the receiver's value will be modified by when the page increment/decrement areas are selected to the argument, which must be at least one.

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

Sets the single selection that is the receiver's value to the argument which must be greater than or equal to zero.

public void
setThumb(int
the new thumb value, which must be at least one and not larger than the size of the current range
value
)

Sets the thumb value.

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

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

public void
setVisible(boolean
the new visibility state
visible
)

Marks the receiver as visible if the argument is true, and marks it invisible otherwise.

Inherited from org.eclipse.swt.widgets.Widget:
_addListeneraddDisposeListeneraddListenercellDataProccheckBitscheckOpencheckOrientationcheckParentcheckSubclasscheckWidgetconvertPangoFontDescriptionToCsscreateHandlecreateWidgetcssHandledisposedpiChangedenterMotionProcerrorfilterProcfiltersfixMnemonicfixMnemonicfixMnemonicfocusProcfontHeightgdk_event_freegdk_event_get_stategdk_event_get_surface_or_windowgdk_pointer_grabgdk_pointer_ungrabgdk_surface_get_sizegdk_window_get_sizeGdkSeatGrabPrepareFuncgesturePressReleaseProcgetDatagetDatagetDisplaygetListenersgetNamegetNameTextgetStylegtk3_show_helpgtk4_drawgtk4_enter_eventgtk4_focus_enter_eventgtk4_focus_leave_eventgtk4_focus_window_eventgtk4_key_press_eventgtk4_key_release_eventgtk4_leave_eventgtk4_motion_eventgtk4_scroll_eventgtk_activategtk_adjustment_getgtk_box_newgtk_box_pack_endgtk_box_set_child_packinggtk_button_release_eventgtk_cell_renderer_get_preferred_sizegtk_changedgtk_clickedgtk_close_requestgtk_commitgtk_configure_eventgtk_container_get_border_width_or_margingtk_container_set_border_widthgtk_create_menu_proxygtk_day_selectedgtk_day_selected_double_clickgtk_delete_eventgtk_delete_rangegtk_delete_textgtk_drawgtk_enter_notify_eventgtk_expand_collapse_cursor_rowgtk_focusgtk_focus_in_eventgtk_focus_out_eventgtk_gesture_press_eventgtk_gesture_release_eventgtk_grab_focusgtk_hidegtk_icon_releasegtk_inputgtk_insert_textgtk_key_press_eventgtk_key_release_eventgtk_leave_notify_eventgtk_mapgtk_map_eventgtk_menu_popped_upgtk_mnemonic_activategtk_month_changedgtk_motion_notify_eventgtk_move_focusgtk_outputgtk_populate_popupgtk_popup_menugtk_preedit_changedgtk_realizegtk_row_activatedgtk_row_has_child_toggledgtk_scroll_childgtk_scroll_eventgtk_selectgtk_selection_donegtk_showgtk_size_allocategtk_start_interactive_searchgtk_status_icon_popup_menugtk_style_updatedgtk_switch_pagegtk_test_collapse_rowgtk_test_expand_rowgtk_text_buffer_insert_textgtk_timergtk_toggledgtk_tree_view_column_cell_get_positiongtk_unmapgtk_unmap_eventgtk_unrealizegtk_widget_get_preferred_sizegtk_widget_get_surfacegtk_widget_get_windowgtk_widget_size_allocategtk_window_state_eventhookshoverProcisActiveisAutoDirectionisDisposedisListeningisValidSubclassisValidThreadkeyPressReleaseProcleaveProcmnemonicHitmnemonicMatchnotifyCreationTrackernotifyDisposalTrackernotifyListenersnotifyProcnotifyStatepaintSurfacepaintWindowpostEventpostEventreleasereleaseChildrenreleaseWidgetremoveDisposeListenerremoveListenerremoveListenerrendererGetPreferredWidthProcrendererRenderProcrendererSnapshotProcreskinreskinChildrenreskinWidgetscrollProcsendEventsendEventsendEventsendEventsendIMKeyEventsendKeyEventsendSelectionEventsendSelectionEventsetButtonStatesetDatasetDatasetFontDescriptionsetInputStatesetKeyStatesetLocationStatesetTabGroupFocussetTabItemFocussetToolTipTextshellMapProcsizeAllocateProcsizeRequestProcsnapshotToDrawtimerProctopHandletoStringtranslateTraversalwindowActiveProcwindowProcwindowProcwindowProcwindowProcwindowProc

Field Detail

adjustmentHandleback to summary
pack-priv long adjustmentHandle
detailback to summary
pack-priv int detail
dragSentback to summary
pack-priv boolean dragSent
parentback to summary
pack-priv Scrollable parent

Constructor Detail

ScrollBarback to summary
pack-priv ScrollBar()
ScrollBarback to summary
pack-priv ScrollBar(Scrollable parent, int style)

Creates a new instance of the widget.

Method Detail

addSelectionListenerback to summary
public void addSelectionListener(SelectionListener listener)

Adds the listener to the collection of listeners who will be notified when the user changes the receiver's value, by sending it one of the messages defined in the SelectionListener interface.

When widgetSelected is called, the event object detail field contains one of the following values: SWT.NONE - for the end of a drag. SWT.DRAG. SWT.HOME. SWT.END. SWT.ARROW_DOWN. SWT.ARROW_UP. SWT.PAGE_DOWN. SWT.PAGE_UP. widgetDefaultSelected is not called.

Parameters
listener:SelectionListener

the listener which should be notified when the user changes the receiver's value

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
checkStyleback to summary
pack-priv static int checkStyle(int style)
deregisterback to summary
pack-priv void deregister()

Overrides org.eclipse.swt.widgets.Widget.deregister.

Annotations
@Override
destroyWidgetback to summary
pack-priv void destroyWidget()

Overrides org.eclipse.swt.widgets.Widget.destroyWidget.

Annotations
@Override
getEnabledback to summary
public boolean getEnabled()

Returns true if the receiver is enabled, and false otherwise. A disabled control is typically not selectable from the user interface and draws with an inactive or "grayed" look.

Returns:boolean

the receiver's enabled state

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
See Also
isEnabled
getIncrementback to summary
public int getIncrement()

Returns the amount that the receiver's value will be modified by when the up/down (or right/left) 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 value will be modified by when the page increment/decrement areas are selected.

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
getParentback to summary
public Scrollable getParent()

Returns the receiver's parent, which must be a Scrollable.

Returns:Scrollable

the receiver's parent

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 single 'selection' that is the receiver's value.

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
getSizeback to summary
public Point getSize()

Returns a point describing the receiver's size. The x coordinate of the result is the width of the receiver. The y coordinate of the result is the height of the receiver.

Returns:Point

the receiver's size

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
getSizeInPixelsback to summary
pack-priv Point getSizeInPixels()
getThumbback to summary
public int getThumb()

Returns the receiver's thumb value.

Returns:int

the thumb 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
See Also
ScrollBar
getThumbBoundsback to summary
public Rectangle getThumbBounds()

Returns a rectangle describing the size and location of the receiver's thumb relative to its parent.

Returns:Rectangle

the thumb bounds, relative to the parent

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.6
getThumbBoundsInPixelsback to summary
pack-priv Rectangle getThumbBoundsInPixels()
getThumbTrackBoundsback to summary
public Rectangle getThumbTrackBounds()

Returns a rectangle describing the size and location of the receiver's thumb track relative to its parent. This rectangle comprises the areas 2, 3, and 4 as described in ScrollBar.

Returns:Rectangle

the thumb track bounds, relative to the parent

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.6
getThumbTrackBoundsInPixelsback to summary
pack-priv Rectangle getThumbTrackBoundsInPixels()
getVisibleback to summary
public boolean getVisible()

Returns true if the receiver is visible, and false otherwise.

If one of the receiver's ancestors is not visible or some other condition makes the receiver not visible, this method may still indicate that it is considered visible even though it may not actually be showing.

Returns:boolean

the receiver's visibility state

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
gtk_button_press_eventback to summary
pack-priv long gtk_button_press_event(long widget, long eventPtr)

Overrides org.eclipse.swt.widgets.Widget.gtk_button_press_event.

Annotations
@Override
gtk_change_valueback to summary
pack-priv boolean gtk_change_value(long widget, int scroll, double value, long user_data)

Overrides org.eclipse.swt.widgets.Widget.gtk_change_value.

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

Overrides org.eclipse.swt.widgets.Widget.gtk_event_after.

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.Widget.hookEvents.

Annotations
@Override
isEnabledback to summary
public boolean isEnabled()

Returns true if the receiver is enabled and all of the receiver's ancestors are enabled, and false otherwise. A disabled control is typically not selectable from the user interface and draws with an inactive or "grayed" look.

Returns:boolean

the receiver's enabled state

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
See Also
getEnabled
isVisibleback to summary
public boolean isVisible()

Returns true if the receiver is visible and all of the receiver's ancestors are visible and false otherwise.

Returns:boolean

the receiver's visibility state

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
See Also
getVisible
registerback to summary
pack-priv void register()

Overrides org.eclipse.swt.widgets.Widget.register.

Annotations
@Override
releaseHandleback to summary
pack-priv void releaseHandle()

Overrides org.eclipse.swt.widgets.Widget.releaseHandle.

Annotations
@Override
releaseParentback to summary
pack-priv void releaseParent()

Overrides org.eclipse.swt.widgets.Widget.releaseParent.

Annotations
@Override
removeSelectionListenerback to summary
public void removeSelectionListener(SelectionListener listener)

Removes the listener from the collection of listeners who will be notified when the user changes the receiver's value.

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
setEnabledback to summary
public void setEnabled(boolean enabled)

Enables the receiver if the argument is true, and disables it otherwise. A disabled control is typically not selectable from the user interface and draws with an inactive or "grayed" look.

Parameters
enabled:boolean

the new enabled state

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
setIncrementback to summary
public void setIncrement(int value)

Sets the amount that the receiver's value will be modified by when the up/down (or right/left) 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. If this value is negative or less than or equal to the minimum, the value is ignored. If necessary, first the thumb and then the selection are adjusted to fit within the new range.

Parameters
value:int

the new 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
setMinimumback to summary
public void setMinimum(int value)

Sets the minimum value. If this value is negative or greater than or equal to the maximum, the value is ignored. If necessary, first the thumb and then the selection are adjusted to fit within the new range.

Parameters
value:int

the new 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
setOrientationback to summary
pack-priv void setOrientation(boolean create)

Overrides org.eclipse.swt.widgets.Widget.setOrientation.

Annotations
@Override
setPageIncrementback to summary
public void setPageIncrement(int value)

Sets the amount that the receiver's value will be modified by when the page increment/decrement areas are selected 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 selection)

Sets the single selection that is the receiver's value to the argument which must be greater than or equal to zero.

Parameters
selection: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
setThumbback to summary
public void setThumb(int value)

Sets the thumb value. The thumb value should be used to represent the size of the visual portion of the current range. This value is usually the same as the page increment value.

This new value will be ignored if it is less than one, and will be clamped if it exceeds the receiver's current range.

Parameters
value:int

the new thumb value, which must be at least one and not larger than the size of the current range

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
setValuesback to summary
public void setValues(int selection, int minimum, int maximum, int thumb, int increment, int pageIncrement)

Sets the receiver's selection, minimum value, maximum value, thumb, 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

thumb:int

the new thumb 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
setVisibleback to summary
public void setVisible(boolean visible)

Marks the receiver as visible if the argument is true, and marks it invisible otherwise.

If one of the receiver's ancestors is not visible or some other condition makes the receiver not visible, marking it visible may not actually cause it to be displayed.

Parameters
visible:boolean

the new visibility state

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