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

public Class Sash

extends Control
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 the receiver represent a selectable user interface object that allows the user to drag a rubber banded outline of the sash within the parent control.
Styles:
HORIZONTAL, VERTICAL, SMOOTH
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
Sash snippets, SWT Example: ControlExample, Sample code and further information

Field Summary

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

Constructor Summary

AccessConstructor and Description
public
Sash(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
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 static int
checkStyle(int style)

pack-priv Point
computeSizeInPixels(int wHint, int hHint, boolean changed)

Overrides org.eclipse.swt.widgets.Control.computeSizeInPixels.

pack-priv void
pack-priv boolean
gtk4_key_press_event(long
the corresponding controller responsible for capturing the event
controller
,
int
the pressed key
keyval
,
int
raw code of the pressed key
keycode
,
int
the bitmask, representing the state of the modifier keys and pointer buttons
state
,
long
the GdkEvent captured
event
)

Overrides org.eclipse.swt.widgets.Control.gtk4_key_press_event.

pack-priv void
gtk4_motion_event(long
the corresponding controller responsible for capturing the event
controller
,
double
the x coordinate
x
,
double
the y coordinate
y
,
long
the GdkEvent captured
event
)

Overrides org.eclipse.swt.widgets.Control.gtk4_motion_event.

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

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

pack-priv long
pack-priv void
gtk_gesture_press_event(long
the corresponding controller responsible for capturing the event
gesture
,
int
how many touch/button presses happened with this one
n_press
,
double
the x coordinate, in widget allocation coordinates
x
,
double
the y coordinate, in widget allocation coordinates
y
,
long
the GdkEvent captured
event
)

Overrides org.eclipse.swt.widgets.Control.gtk_gesture_press_event.

Handling multi-press event on GTK4
pack-priv void
gtk_gesture_release_event(long
the corresponding controller responsible for capturing the event
gesture
,
int
how many touch/button presses happened with this one
n_press
,
double
the x coordinate, in widget allocation coordinates
x
,
double
the y coordinate, in widget allocation coordinates
y
,
long
the GdkEvent captured
event
)

Overrides org.eclipse.swt.widgets.Control.gtk_gesture_release_event.

pack-priv long
pack-priv long
pack-priv long
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 control is selected by the user.

pack-priv void
pack-priv int
Inherited from org.eclipse.swt.widgets.Control:
_getAccessible_getShelladdControlListeneraddDragDetectListeneraddFocusListeneraddGestureListeneraddHelpListeneraddKeyListeneraddMenuDetectListeneraddMouseListeneraddMouseMoveListeneraddMouseTrackListeneraddMouseWheelListeneraddPaintListeneraddRelationaddTouchListeneraddTraverseListeneradjustChildClippingcairoClipRegioncairoCopyRegioncairoDisposeRegioncheckBackgroundcheckBordercheckBufferedcheckMirroredcheckSubwindowcleanupEnableWindowcomputeNativeSizecomputeSizecomputeSizecomputeSizeInPixelscomputeTabGroupcomputeTabListcomputeTabRootcontainedInRegioncreateWidgetdefaultBackgrounddefaultFontderegisterdestroyWidgetdragDetectdragDetectdragDetectdragDetectdrawBackgrounddrawGripperdrawWidgetenableWidgetenterExitHandleeventHandleeventSurfaceeventWindowfilterKeyfindBackgroundControlfindMenusfixChildrenfixFocusfixGdkEventTypeValuesfixModalfixParentGdkResourcefixStylefixStyleflushQueueOnDndfocusHandlefontHandleforceFocusforceFocusforceResizegestureBeginProcgestureEndProcgestureHandlegetAccessiblegetBackgroundgetBackgroundGdkRGBAgetBackgroundImagegetBaseGdkRGBAgetBgGdkRGBAgetBorderWidthgetBorderWidthInPixelsgetBoundsgetBoundsInPixelsgetClientWidthgetContextBackgroundGdkRGBAgetContextColorGdkRGBAgetControlgetControlOrigingetCursorgetDragDetectgetEnabledgetFontgetFontDescriptiongetForegroundgetForegroundGdkRGBAgetIMCaretPosgetLayoutDatagetLocationgetLocationInPixelsgetMenugetMonitorgetOrientationgetParentgetPathgetRegiongetShellgetSizegetSizeInPixelsgetSurfaceOrigingetTextDirectiongetThicknessgetToolTipTextgetTouchEnabledgetVisiblegetWindowOrigingtk3_show_helpgtk4_drawgtk4_enter_eventgtk4_focus_enter_eventgtk4_focus_leave_eventgtk4_focus_window_eventgtk4_key_release_eventgtk4_leave_eventgtk4_scroll_eventgtk_button_press_eventgtk_commitgtk_css_provider_load_from_cssgtk_enter_notify_eventgtk_event_aftergtk_focusgtk_focus_out_eventgtk_key_release_eventgtk_label_set_aligngtk_leave_notify_eventgtk_mnemonic_activategtk_popup_menugtk_preedit_changedgtk_scroll_eventgtk_style_context_get_bordergtk_style_context_get_paddinggtk_style_updatedgtk_unrealizegtk_widget_reparentgtk_widget_set_alignhasFocushooksPainthoverProcimHandleinternal_dispose_GCinternal_new_GCisActiveisAutoScalableisDescribedByLabelisEnabledisFocusAncestorisFocusControlisFocusHandleisReparentableisShowingisTabGroupisTabItemisVisiblemagnifyProcmarkLayoutmenuShellmnemonicHitmnemonicMatchmoveAbovemoveBelowmoveChildrenmoveHandlemustBeVisibleOnInitBoundspackpackpaintHandlepaintSurfacepaintWindowprintprintWidgetprintWindowredrawredrawredrawredrawChildrenredrawInPixelsredrawWidgetregisterreleasereleaseHandlereleaseParentremoveControlListenerremoveDragDetectListenerremoveFocusListenerremoveGestureListenerremoveHelpListenerremoveKeyListenerremoveMenuDetectListenerremoveMouseListenerremoveMouseMoveListenerremoveMouseTrackListenerremoveMouseWheelListenerremovePaintListenerremoveRelationremoveTouchListenerremoveTraverseListenerrequestLayoutresizeCalculationsGTK3resizeHandlerestackWindowrotateProcsendDragEventsendFocusEventsendGestureEventsendGestureEventsendGestureEventsendHelpEventsendLeaveNotifysendMouseEventsendMouseEventsetBackgroundsetBackgroundsetBackgroundGdkRGBAsetBackgroundGdkRGBAsetBackgroundGdkRGBAsetBackgroundImagesetBackgroundSurfacesetBoundssetBoundssetBoundssetBoundsInPixelssetBoundsInPixelssetCapturesetCursorsetDragDetectsetEnabledsetFocussetFontsetFontDescriptionsetForegroundsetForegroundGdkRGBAsetForegroundGdkRGBAsetInitialBoundssetLayoutDatasetLocationsetLocationsetLocationInPixelssetLocationInPixelssetMenusetOrientationsetOrientationsetParentsetParentBackgroundsetParentGdkResourcesetRadioSelectionsetRedrawsetRegionsetRelationssetSizesetSizesetSizeInPixelssetSizeInPixelssetTabItemFocussetTextDirectionsetToolTipTextsetToolTipTextsetTouchEnabledsetVisiblesetWidgetBackgroundsetZOrdersetZOrdershowMenushowMenushowWidgetsortswipeProctoControltoControltoDisplaytoDisplaytoDisplayInPixelstoDisplayInPixelstopHandletranslateMnemonictranslateMnemonictranslateTraversaltraversetraversetraversetraversetraversetraverseEscapetraverseGrouptraverseItemtraverseMnemonictraversePagetraverseReturnupdateupdateupdateBackgroundModeupdateLayoutwantDragDropDetectionwindowProc

Field Detail

DEFAULT_CROSS_AXIS_SIZEback to summary
private static final int DEFAULT_CROSS_AXIS_SIZE
defaultCursorback to summary
pack-priv long defaultCursor
draggingback to summary
pack-priv boolean dragging
INCREMENTback to summary
private static final int INCREMENT
lastXback to summary
pack-priv int lastX
lastYback to summary
pack-priv int lastY
PAGE_INCREMENTback to summary
private static final int PAGE_INCREMENT
startXback to summary
pack-priv int startX
startYback to summary
pack-priv int startY

Constructor Detail

Sashback to summary
public Sash(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#HORIZONTAL, SWT#VERTICAL, SWT#SMOOTH, Widget#checkSubclass, Widget#getStyle

Method Detail

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.

When widgetSelected is called, the x, y, width, and height fields of the event object are valid. If the receiver is being dragged, the event object detail field contains the value SWT.DRAG. widgetDefaultSelected is not called.

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
checkStyleback to summary
pack-priv static int checkStyle(int style)
computeSizeInPixelsback to summary
pack-priv Point computeSizeInPixels(int wHint, int hHint, boolean changed)

Overrides org.eclipse.swt.widgets.Control.computeSizeInPixels.

Annotations
@Override
createHandleback to summary
pack-priv void createHandle(int index)

Overrides org.eclipse.swt.widgets.Widget.createHandle.

Annotations
@Override
gtk4_key_press_eventback to summary
pack-priv boolean gtk4_key_press_event(long controller, int keyval, int keycode, int state, long event)

Overrides org.eclipse.swt.widgets.Control.gtk4_key_press_event.

Parameters
controller:long

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

the corresponding controller responsible for capturing the event

keyval:int

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

the pressed key

keycode:int

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

raw code of the pressed key

state:int

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

the bitmask, representing the state of the modifier keys and pointer buttons

event:long

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

the GdkEvent captured

Returns:boolean

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

TRUE if the event has been fully/properly handled, otherwise FALSE

Annotations
@Override
gtk4_motion_eventback to summary
pack-priv void gtk4_motion_event(long controller, double x, double y, long event)

Overrides org.eclipse.swt.widgets.Control.gtk4_motion_event.

Parameters
controller:long

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

the corresponding controller responsible for capturing the event

x:double

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

the x coordinate

y:double

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

the y coordinate

event:long

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

the GdkEvent captured

Annotations
@Override
gtk_button_press_eventback to summary
pack-priv long gtk_button_press_event(long widget, long event)

Overrides org.eclipse.swt.widgets.Control.gtk_button_press_event.

Annotations
@Override
gtk_button_release_eventback to summary
pack-priv long gtk_button_release_event(long widget, long event)

Overrides org.eclipse.swt.widgets.Control.gtk_button_release_event.

Annotations
@Override
gtk_drawback to summary
pack-priv long gtk_draw(long widget, long cairo)

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

Annotations
@Override
gtk_focus_in_eventback to summary
pack-priv long gtk_focus_in_event(long widget, long event)

Overrides org.eclipse.swt.widgets.Control.gtk_focus_in_event.

Annotations
@Override
gtk_gesture_press_eventback to summary
pack-priv void gtk_gesture_press_event(long gesture, int n_press, double x, double y, long event)

Overrides org.eclipse.swt.widgets.Control.gtk_gesture_press_event.

Doc from org.eclipse.swt.widgets.Control.gtk_gesture_press_event.

Handling multi-press event on GTK4

Parameters
gesture:long

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

the corresponding controller responsible for capturing the event

n_press:int

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

how many touch/button presses happened with this one

x:double

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

the x coordinate, in widget allocation coordinates

y:double

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

the y coordinate, in widget allocation coordinates

event:long

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

the GdkEvent captured

Annotations
@Override
gtk_gesture_release_eventback to summary
pack-priv void gtk_gesture_release_event(long gesture, int n_press, double x, double y, long event)

Overrides org.eclipse.swt.widgets.Control.gtk_gesture_release_event.

Parameters
gesture:long

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

the corresponding controller responsible for capturing the event

n_press:int

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

how many touch/button presses happened with this one

x:double

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

the x coordinate, in widget allocation coordinates

y:double

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

the y coordinate, in widget allocation coordinates

event:long

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

the GdkEvent captured

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

Overrides org.eclipse.swt.widgets.Control.gtk_key_press_event.

Annotations
@Override
gtk_motion_notify_eventback to summary
pack-priv long gtk_motion_notify_event(long widget, long eventPtr)

Overrides org.eclipse.swt.widgets.Control.gtk_motion_notify_event.

Annotations
@Override
gtk_realizeback to summary
pack-priv long gtk_realize(long widget)

Overrides org.eclipse.swt.widgets.Control.gtk_realize.

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

Overrides org.eclipse.swt.widgets.Control.hookEvents.

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

Overrides org.eclipse.swt.widgets.Control.releaseWidget.

Annotations
@Override
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
setCursorback to summary
pack-priv void setCursor(long cursor)

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

Annotations
@Override
traversalCodeback to summary
pack-priv int traversalCode(int key, long event)

Overrides org.eclipse.swt.widgets.Control.traversalCode.

Annotations
@Override