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

public abstract Class Scrollable

extends Control
Class Inheritance
Known Direct Subclasses
org.eclipse.swt.widgets.Text, org.eclipse.swt.widgets.Composite, org.eclipse.swt.widgets.List
Imports
org.eclipse.swt.*, org.eclipse.swt.graphics.*, org.eclipse.swt.internal.*, org.eclipse.swt.internal.gtk.*, org.eclipse.swt.internal.gtk3.*, org.eclipse.swt.internal.gtk4.*

This class is the abstract superclass of all classes which represent controls that have standard scroll bars.
Styles:
H_SCROLL, V_SCROLL
Events:
(none)

Important Note

This class is intended to be subclassed only within the SWT implementation.

See Also
Sample code and further information

Field Summary

Modifier and TypeField and Description
pack-priv ScrollBar
pack-priv static final boolean
pack-priv long
pack-priv ScrollBar
Inherited from org.eclipse.swt.widgets.Control:
accessibleautoScalebackgroundAlphabackgroundImagecachedNoBackgroundcheckScaleFactorcssBackgroundcssForegroundcursorDISABLE_EMOJIdragDetectionQueuedragGesturedrawCountdrawRegionenableWindoweventRegionfirstFixedHandlefixedHandlefontgestureBegingestureEndgestureRotationgestureSwipegestureZoomkeyControllerlabelRelationlastInputlayoutDatamenumouseDownpanGestureparentproviderredrawWindowregionregionHandlerotateGesturetoolTipTextzoomGesture

Constructor Summary

AccessConstructor and Description
pack-priv
Scrollable()

Prevents uninitialized instances from being created outside the package.

public
Scrollable(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
pack-priv int

Returns:

  • 0 to remove THEME_BACKGROUND
  • 1 to apply THEME_BACKGROUND
  • otherwise don't change THEME_BACKGROUND state
  • applyThemeBackground
    ()

    pack-priv long
    public Rectangle

    Returns:

    the required bounds to produce the given client area
    computeTrim
    (int
    the desired x coordinate of the client area
    x
    ,
    int
    the desired y coordinate of the client area
    y
    ,
    int
    the desired width of the client area
    width
    ,
    int
    the desired height of the client area
    height
    )

    Given a desired client area for the receiver (as described by the arguments), returns the bounding rectangle which would be required to produce that client area.

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

    pack-priv ScrollBar
    createScrollBar(int style)

    pack-priv void
    pack-priv void
    pack-priv void
    pack-priv int
    public Rectangle

    Returns:

    the client area
    getClientArea
    ()

    Returns a rectangle which describes the area of the receiver which is capable of displaying data (that is, not covered by the "trimmings").

    pack-priv Rectangle
    public ScrollBar

    Returns:

    the horizontal scroll bar (or null)
    getHorizontalBar
    ()

    Returns the receiver's horizontal scroll bar if it has one, and null if it does not.

    public int

    Returns:

    the mode of scrollbars
    getScrollbarsMode
    ()

    Returns the mode of the receiver's scrollbars.

    public ScrollBar

    Returns:

    the vertical scroll bar (or null)
    getVerticalBar
    ()

    Returns the receiver's vertical scroll bar if it has one, and null if it does not.

    pack-priv long
    gtk_draw(long widget, long cairo)

    Overrides org.eclipse.swt.widgets.Control.gtk_draw.

    pack-priv long
    private Point
    pack-priv int
    pack-priv void
    pack-priv void
    redrawWidget(int x, int y, int width, int height, boolean redrawAll, boolean all, boolean trim)

    Overrides org.eclipse.swt.widgets.Control.redrawWidget.

    pack-priv void
    pack-priv void
    pack-priv void
    pack-priv void
    pack-priv void
    private Point
    scrollBarSize(long scrollBarHandle)

    pack-priv boolean
    pack-priv void
    pack-priv boolean
    setScrollBarVisible(ScrollBar bar, boolean visible)

    pack-priv void
    pack-priv long
    pack-priv void
    pack-priv void
    private Point
    pack-priv int
    Inherited from org.eclipse.swt.widgets.Control:
    _getAccessible_getShelladdControlListeneraddDragDetectListeneraddFocusListeneraddGestureListeneraddHelpListeneraddKeyListeneraddMenuDetectListeneraddMouseListeneraddMouseMoveListeneraddMouseTrackListeneraddMouseWheelListeneraddPaintListeneraddRelationaddTouchListeneraddTraverseListeneradjustChildClippingcairoClipRegioncairoCopyRegioncairoDisposeRegioncheckBackgroundcheckBordercheckBufferedcheckMirroredcheckSubwindowcleanupEnableWindowcomputeNativeSizecomputeSizecomputeSizecomputeSizeInPixelscomputeSizeInPixelscomputeTabGroupcomputeTabListcomputeTabRootcontainedInRegiondefaultBackgrounddefaultFontdestroyWidgetdragDetectdragDetectdragDetectdragDetectdrawBackgrounddrawGripperdrawWidgetenableWidgetenterExitHandleeventHandleeventSurfaceeventWindowfilterKeyfindBackgroundControlfindMenusfixChildrenfixFocusfixGdkEventTypeValuesfixModalfixParentGdkResourcefixStylefixStyleflushQueueOnDndfocusHandlefontHandleforceFocusforceFocusforceResizegestureBeginProcgestureEndProcgestureHandlegetAccessiblegetBackgroundgetBackgroundGdkRGBAgetBackgroundImagegetBaseGdkRGBAgetBgGdkRGBAgetBorderWidthgetBoundsgetBoundsInPixelsgetClientWidthgetContextBackgroundGdkRGBAgetContextColorGdkRGBAgetControlgetControlOrigingetCursorgetDragDetectgetEnabledgetFontgetFontDescriptiongetForegroundgetForegroundGdkRGBAgetIMCaretPosgetLayoutDatagetLocationgetLocationInPixelsgetMenugetMonitorgetOrientationgetParentgetPathgetRegiongetShellgetSizegetSizeInPixelsgetSurfaceOrigingetTextDirectiongetThicknessgetToolTipTextgetTouchEnabledgetVisiblegetWindowOrigingtk3_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_button_press_eventgtk_button_press_eventgtk_button_release_eventgtk_commitgtk_css_provider_load_from_cssgtk_enter_notify_eventgtk_event_aftergtk_focusgtk_focus_in_eventgtk_focus_out_eventgtk_gesture_press_eventgtk_gesture_release_eventgtk_key_press_eventgtk_key_release_eventgtk_label_set_aligngtk_leave_notify_eventgtk_mnemonic_activategtk_motion_notify_eventgtk_popup_menugtk_preedit_changedgtk_realizegtk_style_context_get_bordergtk_style_context_get_paddinggtk_style_updatedgtk_unrealizegtk_widget_reparentgtk_widget_set_alignhasFocushookEventshooksPainthoverProcimHandleinternal_dispose_GCinternal_new_GCisActiveisAutoScalableisDescribedByLabelisEnabledisFocusAncestorisFocusControlisFocusHandleisReparentableisShowingisTabGroupisTabItemisVisiblemagnifyProcmarkLayoutmenuShellmnemonicHitmnemonicMatchmoveAbovemoveBelowmoveChildrenmoveHandlemustBeVisibleOnInitBoundspackpackpaintHandlepaintSurfacepaintWindowprintprintWidgetprintWindowredrawredrawredrawredrawChildrenredrawInPixelsreleasereleaseParentreleaseWidgetremoveControlListenerremoveDragDetectListenerremoveFocusListenerremoveGestureListenerremoveHelpListenerremoveKeyListenerremoveMenuDetectListenerremoveMouseListenerremoveMouseMoveListenerremoveMouseTrackListenerremoveMouseWheelListenerremovePaintListenerremoveRelationremoveTouchListenerremoveTraverseListenerrequestLayoutresizeCalculationsGTK3restackWindowrotateProcsendDragEventsendFocusEventsendGestureEventsendGestureEventsendGestureEventsendHelpEventsendMouseEventsendMouseEventsetBackgroundsetBackgroundsetBackgroundGdkRGBAsetBackgroundGdkRGBAsetBackgroundGdkRGBAsetBackgroundImagesetBackgroundSurfacesetBoundssetBoundssetBoundssetBoundsInPixelssetBoundsInPixelssetCapturesetCursorsetCursorsetDragDetectsetEnabledsetFocussetFontsetFontDescriptionsetForegroundsetForegroundGdkRGBAsetForegroundGdkRGBAsetInitialBoundssetLayoutDatasetLocationsetLocationsetLocationInPixelssetLocationInPixelssetMenusetOrientationsetParentsetParentBackgroundsetParentGdkResourcesetRadioSelectionsetRedrawsetRegionsetRelationssetSizesetSizesetSizeInPixelssetSizeInPixelssetTabItemFocussetTextDirectionsetToolTipTextsetToolTipTextsetTouchEnabledsetVisiblesetWidgetBackgroundsetZOrdersetZOrdershowMenushowMenusortswipeProctoControltoControltoDisplaytoDisplaytoDisplayInPixelstoDisplayInPixelstranslateMnemonictranslateMnemonictranslateTraversaltraversalCodetraversetraversetraversetraversetraversetraverseEscapetraverseGrouptraverseItemtraverseMnemonictraversePagetraverseReturnupdateupdateupdateLayoutwantDragDropDetectionwindowProc

    Field Detail

    horizontalBarback to summary
    pack-priv ScrollBar horizontalBar
    RESIZE_ON_GETCLIENTAREAback to summary
    pack-priv static final boolean RESIZE_ON_GETCLIENTAREA

    See bug 484682

    scrolledHandleback to summary
    pack-priv long scrolledHandle
    verticalBarback to summary
    pack-priv ScrollBar verticalBar

    Constructor Detail

    Scrollableback to summary
    pack-priv Scrollable()

    Prevents uninitialized instances from being created outside the package.

    Scrollableback to summary
    public Scrollable(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#H_SCROLL, SWT#V_SCROLL, Widget#checkSubclass, Widget#getStyle

    Method Detail

    applyThemeBackgroundback to summary
    pack-priv int applyThemeBackground()
    Returns:int

  • 0 to remove THEME_BACKGROUND
  • 1 to apply THEME_BACKGROUND
  • otherwise don't change THEME_BACKGROUND state
  • clientHandleback to summary
    pack-priv long clientHandle()
    computeTrimback to summary
    public Rectangle computeTrim(int x, int y, int width, int height)

    Given a desired client area for the receiver (as described by the arguments), returns the bounding rectangle which would be required to produce that client area.

    In other words, it returns a rectangle such that, if the receiver's bounds were set to that rectangle, the area of the receiver which is capable of displaying data (that is, not covered by the "trimmings") would be the rectangle described by the arguments (relative to the receiver's parent).

    Parameters
    x:int

    the desired x coordinate of the client area

    y:int

    the desired y coordinate of the client area

    width:int

    the desired width of the client area

    height:int

    the desired height of the client area

    Returns:Rectangle

    the required bounds to produce the given client area

    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
    getClientArea
    computeTrimInPixelsback to summary
    pack-priv Rectangle computeTrimInPixels(int x, int y, int width, int height)
    createScrollBarback to summary
    pack-priv ScrollBar createScrollBar(int style)
    createWidgetback to summary
    pack-priv void createWidget(int index)

    Overrides org.eclipse.swt.widgets.Control.createWidget.

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

    Overrides org.eclipse.swt.widgets.Control.deregister.

    Annotations
    @Override
    destroyScrollBarback to summary
    pack-priv void destroyScrollBar(ScrollBar bar)
    getBorderWidthInPixelsback to summary
    pack-priv int getBorderWidthInPixels()

    Overrides org.eclipse.swt.widgets.Control.getBorderWidthInPixels.

    Annotations
    @Override
    getClientAreaback to summary
    public Rectangle getClientArea()

    Returns a rectangle which describes the area of the receiver which is capable of displaying data (that is, not covered by the "trimmings").

    Returns:Rectangle

    the client area

    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
    computeTrim
    getClientAreaInPixelsback to summary
    pack-priv Rectangle getClientAreaInPixels()
    getHorizontalBarback to summary
    public ScrollBar getHorizontalBar()

    Returns the receiver's horizontal scroll bar if it has one, and null if it does not.

    Returns:ScrollBar

    the horizontal scroll bar (or null)

    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
    getScrollbarsModeback to summary
    public int getScrollbarsMode()

    Returns the mode of the receiver's scrollbars. This will be bitwise OR of one or more of the constants defined in class SWT.

    • SWT.SCROLLBAR_OVERLAY - if receiver uses overlay scrollbars
    • SWT.NONE - otherwise
    Returns:int

    the mode of scrollbars

    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.8
    See Also
    SWT#SCROLLBAR_OVERLAY
    getVerticalBarback to summary
    public ScrollBar getVerticalBar()

    Returns the receiver's vertical scroll bar if it has one, and null if it does not.

    Returns:ScrollBar

    the vertical scroll bar (or null)

    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_drawback to summary
    pack-priv long gtk_draw(long widget, long cairo)

    Overrides org.eclipse.swt.widgets.Control.gtk_draw.

    Annotations
    @Override
    gtk_scroll_eventback to summary
    pack-priv long gtk_scroll_event(long widget, long eventPtr)

    Overrides org.eclipse.swt.widgets.Control.gtk_scroll_event.

    Annotations
    @Override
    hScrollbarSizeback to summary
    private Point hScrollbarSize()
    hScrollBarWidthback to summary
    pack-priv int hScrollBarWidth()
    redrawBackgroundImageback to summary
    pack-priv void redrawBackgroundImage()
    redrawWidgetback to summary
    pack-priv void redrawWidget(int x, int y, int width, int height, boolean redrawAll, boolean all, boolean trim)

    Overrides org.eclipse.swt.widgets.Control.redrawWidget.

    Annotations
    @Override
    registerback to summary
    pack-priv void register()

    Overrides org.eclipse.swt.widgets.Control.register.

    Annotations
    @Override
    releaseChildrenback to summary
    pack-priv void releaseChildren(boolean destroy)

    Overrides org.eclipse.swt.widgets.Widget.releaseChildren.

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

    Overrides org.eclipse.swt.widgets.Control.releaseHandle.

    Annotations
    @Override
    resizeHandleback to summary
    pack-priv void resizeHandle(int width, int height)

    Overrides org.eclipse.swt.widgets.Control.resizeHandle.

    Annotations
    @Override
    reskinChildrenback to summary
    pack-priv void reskinChildren(int flags)

    Overrides org.eclipse.swt.widgets.Widget.reskinChildren.

    Annotations
    @Override
    scrollBarSizeback to summary
    private Point scrollBarSize(long scrollBarHandle)
    sendLeaveNotifyback to summary
    pack-priv boolean sendLeaveNotify()

    Overrides org.eclipse.swt.widgets.Control.sendLeaveNotify.

    Annotations
    @Override
    setOrientationback to summary
    pack-priv void setOrientation(boolean create)

    Overrides org.eclipse.swt.widgets.Control.setOrientation.

    Annotations
    @Override
    setScrollBarVisibleback to summary
    pack-priv boolean setScrollBarVisible(ScrollBar bar, boolean visible)
    showWidgetback to summary
    pack-priv void showWidget()

    Overrides org.eclipse.swt.widgets.Control.showWidget.

    Annotations
    @Override
    topHandleback to summary
    pack-priv long topHandle()

    Overrides org.eclipse.swt.widgets.Control.topHandle.

    Annotations
    @Override
    updateBackgroundModeback to summary
    pack-priv void updateBackgroundMode()

    Overrides org.eclipse.swt.widgets.Control.updateBackgroundMode.

    Annotations
    @Override
    updateScrollBarValueback to summary
    pack-priv void updateScrollBarValue(ScrollBar bar)
    vScrollBarSizeback to summary
    private Point vScrollBarSize()
    vScrollBarWidthback to summary
    pack-priv int vScrollBarWidth()