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

public abstract Class Control

extends Widget
implements Drawable
Class Inheritance
All Implemented Interfaces
org.eclipse.swt.graphics.Drawable
Known Direct Subclasses
org.eclipse.swt.widgets.Label, org.eclipse.swt.widgets.ProgressBar, org.eclipse.swt.widgets.Sash, org.eclipse.swt.widgets.Scale, org.eclipse.swt.widgets.Scrollable, org.eclipse.swt.widgets.Slider, org.eclipse.swt.widgets.Link, org.eclipse.swt.widgets.Button
Imports
java.lang.reflect.*, java.util.*, org.eclipse.swt.*, org.eclipse.swt.accessibility.*, org.eclipse.swt.events.*, org.eclipse.swt.graphics.*, org.eclipse.swt.internal.*, org.eclipse.swt.internal.cairo.*, org.eclipse.swt.internal.gtk.*, org.eclipse.swt.internal.gtk3.*, org.eclipse.swt.internal.gtk4.*

Control is the abstract superclass of all windowed user interface classes.
Styles:
BORDER
LEFT_TO_RIGHT, RIGHT_TO_LEFT, FLIP_TEXT_DIRECTION
Events:
DragDetect, FocusIn, FocusOut, Help, KeyDown, KeyUp, MenuDetect, MouseDoubleClick, MouseDown, MouseEnter, MouseExit, MouseHover, MouseUp, MouseMove, MouseWheel, MouseHorizontalWheel, MouseVerticalWheel, Move, Paint, Resize, Traverse

Only one of LEFT_TO_RIGHT or RIGHT_TO_LEFT may be specified.

Important Note

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

See Also
Control snippets, SWT Example: ControlExample, Sample code and further information

Field Summary

Modifier and TypeField and Description
pack-priv Accessible
pack-priv boolean
autoScale

True if GTK has autoscaled this Control, meaning SWT does not need to do any manual scaling.

pack-priv int
pack-priv Image
pack-priv boolean
cachedNoBackground

Cache the NO_BACKGROUND flag as it gets removed automatically in Composite.

pack-priv boolean
checkScaleFactor

Flag to check the scale factor upon the first drawing of this Control.

pack-priv String
pack-priv String
pack-priv Cursor
pack-priv static final boolean
pack-priv LinkedList<Event>
pack-priv long
pack-priv int
pack-priv boolean
pack-priv long
pack-priv long
pack-priv long
pack-priv long
pack-priv Font
pack-priv static Callback
pack-priv static Callback
pack-priv static Callback
pack-priv static Callback
pack-priv static Callback
pack-priv long
pack-priv Control
pack-priv Point
lastInput

Point for storing the (x, y) coordinate of the last input (click/scroll/etc.).

pack-priv Object
pack-priv static boolean
mouseDown

Bug 541635, 515396: GTK Wayland only flag to keep track whether mouse is currently pressed or released for DND.

pack-priv long
pack-priv Composite
pack-priv long
pack-priv long
pack-priv Region
pack-priv long
regionHandle

The handle to the Region, which is neccessary in the case that region is disposed before this Control.

pack-priv long
pack-priv String
pack-priv long
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
public
Control(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 Accessible
pack-priv Shell
private void
public void
addControlListener(ControlListener
the listener which should be notified
listener
)

Adds the listener to the collection of listeners who will be notified when the control is moved or resized, by sending it one of the messages defined in the ControlListener interface.

public void
addDragDetectListener(DragDetectListener
the listener which should be notified
listener
)

Adds the listener to the collection of listeners who will be notified when a drag gesture occurs, by sending it one of the messages defined in the DragDetectListener interface.

public void
addFocusListener(FocusListener
the listener which should be notified
listener
)

Adds the listener to the collection of listeners who will be notified when the control gains or loses focus, by sending it one of the messages defined in the FocusListener interface.

public void
addGestureListener(GestureListener
the listener which should be notified
listener
)

Adds the listener to the collection of listeners who will be notified when gesture events are generated for the control, by sending it one of the messages defined in the GestureListener interface.

public void
addHelpListener(HelpListener
the listener which should be notified
listener
)

Adds the listener to the collection of listeners who will be notified when help events are generated for the control, by sending it one of the messages defined in the HelpListener interface.

public void
addKeyListener(KeyListener
the listener which should be notified
listener
)

Adds the listener to the collection of listeners who will be notified when keys are pressed and released on the system keyboard, by sending it one of the messages defined in the KeyListener interface.

public void
addMenuDetectListener(MenuDetectListener
the listener which should be notified
listener
)

Adds the listener to the collection of listeners who will be notified when the platform-specific context menu trigger has occurred, by sending it one of the messages defined in the MenuDetectListener interface.

public void
addMouseListener(MouseListener
the listener which should be notified
listener
)

Adds the listener to the collection of listeners who will be notified when mouse buttons are pressed and released, by sending it one of the messages defined in the MouseListener interface.

public void
addMouseMoveListener(MouseMoveListener
the listener which should be notified
listener
)

Adds the listener to the collection of listeners who will be notified when the mouse moves, by sending it one of the messages defined in the MouseMoveListener interface.

public void
addMouseTrackListener(MouseTrackListener
the listener which should be notified
listener
)

Adds the listener to the collection of listeners who will be notified when the mouse passes or hovers over controls, by sending it one of the messages defined in the MouseTrackListener interface.

public void
addMouseWheelListener(MouseWheelListener
the listener which should be notified
listener
)

Adds the listener to the collection of listeners who will be notified when the mouse wheel is scrolled, by sending it one of the messages defined in the MouseWheelListener interface.

public void
addPaintListener(PaintListener
the listener which should be notified
listener
)

Adds the listener to the collection of listeners who will be notified when the receiver needs to be painted, by sending it one of the messages defined in the PaintListener interface.

pack-priv void
public void
addTouchListener(TouchListener
the listener which should be notified
listener
)

Adds the listener to the collection of listeners who will be notified when touch events occur, by sending it one of the messages defined in the TouchListener interface.

public void
addTraverseListener(TraverseListener
the listener which should be notified
listener
)

Adds the listener to the collection of listeners who will be notified when traversal events occur, by sending it one of the messages defined in the TraverseListener interface.

pack-priv void
adjustChildClipping(long
the handle to the widget
widget
)

Allows Controls to adjust the clipping of themselves or their children.

pack-priv void
cairoClipRegion(long
the cairo context to apply the region to
cairo
)

Convenience method that applies a region to the Control using cairo_clip.

pack-priv void
cairoCopyRegion(Region
the Region object to copy to this Control
region
)

Copies the region at the Cairo level, as we need to re-use these resources after the Region object is disposed.

pack-priv void
pack-priv void
pack-priv void
pack-priv void
pack-priv void
pack-priv boolean
pack-priv void
pack-priv Point
computeNativeSize(long h, int wHint, int hHint, boolean changed)

public Point

Returns:

the preferred size of the control
computeSize
(int
the width hint (can be SWT.DEFAULT)
wHint
,
int
the height hint (can be SWT.DEFAULT)
hHint
)

Returns the preferred size (in points) of the receiver.

public Point

Returns:

the preferred size of the control.
computeSize
(int
the width hint (can be SWT.DEFAULT)
wHint
,
int
the height hint (can be SWT.DEFAULT)
hHint
,
boolean
true if the control's contents have changed, and false otherwise
changed
)

Returns the preferred size (in points) of the receiver.

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

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

pack-priv Widget
pack-priv Widget[]
pack-priv Control
private void
pack-priv boolean

Returns:

true if the coordinate (x, y) is in the region, false otherwise
containedInRegion
(int
an x coordinate
x
,
int
a y coordinate
y
)

Convenience method for checking whether an (x, y) coordinate is in the set region.

pack-priv void
pack-priv GdkRGBA
pack-priv Font
pack-priv void
pack-priv void
public boolean

Returns:

true if the gesture occurred, and false otherwise.
dragDetect
(Event
the mouse down event
event
)

Detects a drag and drop gesture.

public boolean

Returns:

true if the gesture occurred, and false otherwise.
dragDetect
(MouseEvent
the mouse down event
event
)

Detects a drag and drop gesture.

pack-priv boolean
dragDetect(int button, int count, int stateMask, int x, int y)

pack-priv boolean
dragDetect(int x, int y, boolean filter, boolean dragOnTimeout, boolean[] consume)

pack-priv void
drawBackground(Control control, long gdkResource, long cr, int x, int y, int width, int height)

pack-priv boolean
drawGripper(GC gc, int x, int y, int width, int height, boolean vertical)

pack-priv void
pack-priv void
enableWidget(boolean enabled)

pack-priv long
pack-priv long
pack-priv long
pack-priv long
pack-priv boolean
filterKey(long event)

pack-priv Control
pack-priv Menu[]
findMenus(Control control)

pack-priv void
fixChildren(Shell newShell, Shell oldShell, Decorations newDecorations, Decorations oldDecorations, Menu[] menus)

pack-priv void
fixFocus(Control focusControl)

pack-priv static int

Returns:

constant defined
fixGdkEventTypeValues
(int eventType)

GdkEventType constants different on GTK4 and GTK3.

pack-priv void
fixModal(long group, long modalGroup)

pack-priv void
fixParentGdkResource()

In some situations, a control has a non-standard parent GdkWindow (Note gDk, not gTk).

pack-priv void
pack-priv void
fixStyle(long handle)

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

Returns:

true if the control got focus, and false if it was unable to.
forceFocus
()

Forces the receiver to have the keyboard focus, causing all keyboard events to be delivered to it.

pack-priv boolean
forceFocus(long focusHandle)

pack-priv void
pack-priv static void
gestureBeginProc(long gesture, long sequence, long user_data)

pack-priv static void
gestureEndProc(long gesture, long sequence, long user_data)

pack-priv long
public Accessible

Returns:

the accessible object
getAccessible
()

Returns the accessible object for the receiver.

public Color

Returns:

the background color
getBackground
()

Returns the receiver's background color.

pack-priv GdkRGBA
public Image

Returns:

the background image
getBackgroundImage
()

Returns the receiver's background image.

pack-priv GdkRGBA
pack-priv GdkRGBA
public int

Returns:

the border width
getBorderWidth
()

Returns the receiver's border width in points.

pack-priv int
public Rectangle

Returns:

the receiver's bounding rectangle
getBounds
()

Returns a rectangle describing the receiver's size and location in points relative to its parent (or its display if its parent is null), unless the receiver is a shell.

pack-priv Rectangle
pack-priv int
pack-priv GdkRGBA
pack-priv GdkRGBA
pack-priv static Control
getControl(long handle)

pack-priv Point

Returns:

the origin of the Control's SWTFixed container relative to the Shell
getControlOrigin
()

GTK4 only function to replace gdk_surface_get_origin

public Cursor

Returns:

the receiver's cursor or null
getCursor
()

Returns the receiver's cursor, or null if it has not been set.

public boolean

Returns:

the receiver's drag detect state
getDragDetect
()

Returns true if the receiver is detecting drag gestures, and false otherwise.

public boolean

Returns:

the receiver's enabled state
getEnabled
()

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

public Font

Returns:

the receiver's font
getFont
()

Returns the font that the receiver will use to paint textual information.

pack-priv long

Returns:

A newly allocated PangoFontDescription*, caller must free it with OS#pango_font_description_free.
getFontDescription
()

public Color

Returns:

the receiver's foreground color
getForeground
()

Returns the foreground color that the receiver will use to draw.

pack-priv GdkRGBA
pack-priv Point
public Object

Returns:

the receiver's layout data
getLayoutData
()

Returns layout data which is associated with the receiver.

public Point

Returns:

the receiver's location
getLocation
()

Returns a point describing the receiver's location relative to its parent in points (or its display if its parent is null), unless the receiver is a shell.

pack-priv Point
public Menu

Returns:

the receiver's menu
getMenu
()

Returns the receiver's pop up menu if it has one, or null if it does not.

public Monitor

Returns:

the receiver's monitor
getMonitor
()

Returns the receiver's monitor.

public int

Returns:

the orientation style
getOrientation
()

Returns the orientation of the receiver, which will be one of the constants SWT.LEFT_TO_RIGHT or SWT.RIGHT_TO_LEFT.

public Composite

Returns:

the receiver's parent
getParent
()

Returns the receiver's parent, which must be a Composite or null when the receiver is a shell that was created with null or a display for a parent.

pack-priv Control[]
public Region

Returns:

the region that defines the shape of the shell (or null)
getRegion
()

Returns the region that defines the shape of the control, or null if the control has the default shape.

public Shell

Returns:

the receiver's shell
getShell
()

Returns the receiver's shell.

public Point

Returns:

the receiver's size
getSize
()

Returns a point describing the receiver's size in points.

pack-priv Point
pack-priv Point

Returns:

the origin
getSurfaceOrigin
()

Gets the position of the top left corner of the control in root window (display) coordinates.

public int

Returns:

the text direction style
getTextDirection
()

Returns the text direction of the receiver, which will be one of the constants SWT.LEFT_TO_RIGHT or SWT.RIGHT_TO_LEFT.

pack-priv Point
getThickness(long widget)

public String

Returns:

the receiver's tool tip text
getToolTipText
()

Returns the receiver's tool tip text, or null if it has not been set.

public boolean

Returns:

true if the control is set to send touch events, or false otherwise
getTouchEnabled
()

Returns true if this control is set to send touch events, or false if it is set to send gesture events instead.

public boolean

Returns:

the receiver's visibility state
getVisible
()

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

pack-priv Point

Returns:

the origin
getWindowOrigin
()

Gets the position of the top left corner of the control in root window (display) coordinates.

pack-priv long
gtk3_show_help(long widget, long helpType)

Overrides org.eclipse.swt.widgets.Widget.gtk3_show_help.

pack-priv void
gtk4_draw(long widget, long cairo, Rectangle bounds)

Overrides org.eclipse.swt.widgets.Widget.gtk4_draw.

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

Overrides org.eclipse.swt.widgets.Widget.gtk4_enter_event.

pack-priv void
gtk4_focus_enter_event(long
the corresponding controller responsible for capturing the event
controller
,
long
the GdkEvent captured
event
)

Overrides org.eclipse.swt.widgets.Widget.gtk4_focus_enter_event.

pack-priv void
gtk4_focus_leave_event(long
the corresponding controller responsible for capturing the event
controller
,
long
the GdkEvent captured
event
)

Overrides org.eclipse.swt.widgets.Widget.gtk4_focus_leave_event.

pack-priv void
gtk4_focus_window_event(long
the handle of the window that caused the event
handle
,
long
the type of event, should be FocusIn or FocusOut
event
)

Overrides org.eclipse.swt.widgets.Widget.gtk4_focus_window_event.

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

pack-priv void
gtk4_key_release_event(long
the corresponding controller responsible for capturing the event
controller
,
int
the released key
keyval
,
int
raw code of the released 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.Widget.gtk4_key_release_event.

pack-priv void
gtk4_leave_event(long
the corresponding controller responsible for capturing the event
controller
,
long
the GdkEvent captured
event
)

Overrides org.eclipse.swt.widgets.Widget.gtk4_leave_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.Widget.gtk4_motion_event.

pack-priv boolean
gtk4_scroll_event(long
the corresponding controller responsible for capturing the event
controller
,
double
x delta
dx
,
double
y delta
dy
,
long
the GdkEvent captured
event
)

Overrides org.eclipse.swt.widgets.Widget.gtk4_scroll_event.

pack-priv long
pack-priv long
gtk_button_press_event(long widget, long event, boolean sendMouseDown)

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

Overrides org.eclipse.swt.widgets.Widget.gtk_commit.

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

Overrides org.eclipse.swt.widgets.Widget.gtk_draw.

pack-priv long
pack-priv long
pack-priv long
gtk_focus(long widget, long directionType)

Overrides org.eclipse.swt.widgets.Widget.gtk_focus.

pack-priv long
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.Widget.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.Widget.gtk_gesture_release_event.

pack-priv long
pack-priv long
pack-priv void
gtk_label_set_align(long label, float xAlign, float yAlign)

pack-priv long
pack-priv long
pack-priv long
pack-priv long
pack-priv long
pack-priv long
pack-priv long
pack-priv void
gtk_style_context_get_border(long context, int state, GtkBorder padding)

pack-priv void
gtk_style_context_get_padding(long context, int state, GtkBorder padding)

pack-priv long
pack-priv long
pack-priv static void
gtk_widget_reparent(Control
that should be reparented.
control
,
long
pointer/handle to the new GtkWidget parent.
newParentHandle
)

Native gtkwidget re-parenting in SWT on Gtk3 needs to be handled in a special way because some controls have non-standard GdkWindow as parents.

pack-priv void
gtk_widget_set_align(long
the GTK reference.
widget
,
int
is of type GTKAlign enum. See OS.java
hAlign
,
int
is of type GTKAlign enum. See OS.java
vAlign
)

Not direct gtk api, but useful to have them combined as they are usually called together.

pack-priv boolean
pack-priv void
private void
hookKeyboardAndFocusSignals(long focusHandle)

private void
hookMouseSignals(long eventHandle)

private void
pack-priv boolean
private void
hookWidgetSignals(long focusHandle)

pack-priv long
pack-priv long
public void
internal_dispose_GC(long
the platform specific GC handle
hDC
,
GCData
the platform specific GC data
data
)

Implements org.eclipse.swt.graphics.Drawable.internal_dispose_GC.

Invokes platform specific functionality to dispose a GC handle.
public long

Returns:

the platform specific GC handle
internal_new_GC
(GCData
the platform specific GC data
data
)

Implements org.eclipse.swt.graphics.Drawable.internal_new_GC.

Invokes platform specific functionality to allocate a new GC handle.
pack-priv boolean
public boolean
isAutoScalable()

Overrides default org.eclipse.swt.graphics.Drawable.isAutoScalable.

Returns true iff coordinates can be auto-scaled on this drawable and false if not.
pack-priv boolean
public boolean

Returns:

the receiver's enabled state
isEnabled
()

Returns true if the receiver is enabled and all ancestors up to and including the receiver's nearest ancestor shell are enabled.

pack-priv boolean
public boolean

Returns:

the receiver's focus state
isFocusControl
()

Returns true if the receiver has the user-interface focus, and false otherwise.

pack-priv boolean
isFocusHandle(long widget)

public boolean

Returns:

true if the widget can be reparented, otherwise false
isReparentable
()

Returns true if the underlying operating system supports this reparenting, otherwise false

pack-priv boolean
pack-priv boolean
pack-priv boolean
public boolean

Returns:

the receiver's visibility state
isVisible
()

Returns true if the receiver is visible and all ancestors up to and including the receiver's nearest ancestor shell are visible.

pack-priv static void
magnifyProc(long gesture, double zoom, long user_data)

pack-priv void
markLayout(boolean changed, boolean all)

pack-priv boolean
mnemonicHit(char key)

pack-priv boolean
mnemonicMatch(char key)

public void
moveAbove(Control
the sibling control (or null)
control
)

Moves the receiver above the specified control in the drawing order.

public void
moveBelow(Control
the sibling control (or null)
control
)

Moves the receiver below the specified control in the drawing order.

pack-priv void
moveChildren(int oldWidth)

pack-priv void
moveHandle(int x, int y)

pack-priv boolean

Returns:

false by default on modern GTK 3 versions (3.20+).
mustBeVisibleOnInitBounds
()

Widgets with unusual bounds calculation behavior can override this method to return true if the widget must be visible during call to setInitialBounds().

public void
pack()

Causes the receiver to be resized to its preferred size.

public void
pack(boolean
whether or not the receiver's contents have changed
changed
)

Causes the receiver to be resized to its preferred size.

pack-priv long
pack-priv long
pack-priv long
pack-priv void
printWidget(GC gc, long drawable, int depth, int x, int y)

pack-priv void
printWindow(boolean first, Control control, GC gc, long drawable, int depth, long window, int x, int y)

public void
redraw()

Causes the entire bounds of the receiver to be marked as needing to be redrawn.

pack-priv void
redraw(boolean all)

public void
redraw(int
the x coordinate of the area to draw
x
,
int
the y coordinate of the area to draw
y
,
int
the width of the area to draw
width
,
int
the height of the area to draw
height
,
boolean
true if children should redraw, and false otherwise
all
)

Causes the rectangular area of the receiver specified by the arguments to be marked as needing to be redrawn.

pack-priv void
pack-priv void
redrawInPixels(int x, int y, int width, int height, boolean all)

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

pack-priv void
pack-priv void
pack-priv void
pack-priv void
pack-priv void
public void
removeControlListener(ControlListener
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 moved or resized.

public void
removeDragDetectListener(DragDetectListener
the listener which should no longer be notified
listener
)

Removes the listener from the collection of listeners who will be notified when a drag gesture occurs.

public void
removeFocusListener(FocusListener
the listener which should no longer be notified
listener
)

Removes the listener from the collection of listeners who will be notified when the control gains or loses focus.

public void
removeGestureListener(GestureListener
the listener which should no longer be notified
listener
)

Removes the listener from the collection of listeners who will be notified when gesture events are generated for the control.

public void
removeHelpListener(HelpListener
the listener which should no longer be notified
listener
)

Removes the listener from the collection of listeners who will be notified when the help events are generated for the control.

public void
removeKeyListener(KeyListener
the listener which should no longer be notified
listener
)

Removes the listener from the collection of listeners who will be notified when keys are pressed and released on the system keyboard.

public void
removeMenuDetectListener(MenuDetectListener
the listener which should no longer be notified
listener
)

Removes the listener from the collection of listeners who will be notified when the platform-specific context menu trigger has occurred.

public void
removeMouseListener(MouseListener
the listener which should no longer be notified
listener
)

Removes the listener from the collection of listeners who will be notified when mouse buttons are pressed and released.

public void
removeMouseMoveListener(MouseMoveListener
the listener which should no longer be notified
listener
)

Removes the listener from the collection of listeners who will be notified when the mouse moves.

public void
removeMouseTrackListener(MouseTrackListener
the listener which should no longer be notified
listener
)

Removes the listener from the collection of listeners who will be notified when the mouse passes or hovers over controls.

public void
removeMouseWheelListener(MouseWheelListener
the listener which should no longer be notified
listener
)

Removes the listener from the collection of listeners who will be notified when the mouse wheel is scrolled.

public void
removePaintListener(PaintListener
the listener which should no longer be notified
listener
)

Removes the listener from the collection of listeners who will be notified when the receiver needs to be painted.

pack-priv void
public void
removeTouchListener(TouchListener
the listener which should no longer be notified
listener
)

Removes the listener from the collection of listeners who will be notified when touch events occur.

public void
removeTraverseListener(TraverseListener
the listener which should no longer be notified
listener
)

Removes the listener from the collection of listeners who will be notified when traversal events occur.

public void
requestLayout()

Requests that this control and all of its ancestors be repositioned by their layouts at the earliest opportunity.

pack-priv Point
resizeCalculationsGTK3(long widget, int width, int height)

pack-priv void
resizeHandle(int width, int height)

pack-priv void
restackWindow(long
a GdkWindow
window
,
long
the sibling thereof, or 0
sibling
,
boolean
a boolean setting for whether the window should be raised or lowered
above
)

GTK3 only, do not call on GTK4.

pack-priv static void
rotateProc(long gesture, double angle, double angle_delta, long user_data)

pack-priv boolean
sendDragEvent(int button, int stateMask, int x, int y, boolean isStateMask)

pack-priv void
sendFocusEvent(int type)

pack-priv boolean
sendGestureEvent(int stateMask, int detail, int x, int y, double delta)

pack-priv boolean
sendGestureEvent(int stateMask, int detail, int x, int y, double xDirection, double yDirection)

pack-priv boolean
sendGestureEvent(int stateMask, int detail, int x, int y, double rotation, int xDirection, int yDirection, double magnification)

pack-priv boolean
sendHelpEvent(long helpType)

pack-priv boolean
pack-priv boolean
sendMouseEvent(int type, int button, int time, double x, double y, boolean is_hint, int state)

pack-priv boolean
sendMouseEvent(int type, int button, int count, int detail, boolean send, int time, double x, double y, boolean is_hint, int state)

private boolean
sendOrPost(int type, Event event)

pack-priv void
public void
setBackground(Color
the new color (or null)
color
)

Sets the receiver's background color to the color specified by the argument, or to the default system color for the control if the argument is null.

pack-priv void
setBackgroundGdkRGBA(long context, long handle, GdkRGBA rgba)

pack-priv void
pack-priv void
setBackgroundGdkRGBA(long handle, GdkRGBA rgba)

public void
setBackgroundImage(Image
the new image (or null)
image
)

Sets the receiver's background image to the image specified by the argument, or to the default system color for the control if the argument is null.

pack-priv void
public void
setBounds(Rectangle
the new bounds for the receiver
rect
)

Sets the receiver's size and location in points to the rectangular area specified by the argument.

public void
setBounds(int
the new x coordinate for the receiver
x
,
int
the new y coordinate for the receiver
y
,
int
the new width for the receiver
width
,
int
the new height for the receiver
height
)

Sets the receiver's size and location in points to the rectangular area specified by the arguments.

pack-priv int
setBounds(int x, int y, int width, int height, boolean move, boolean resize)

pack-priv void
pack-priv void
setBoundsInPixels(int x, int y, int width, int height)

public void
setCapture(boolean
true to capture the mouse, and false to release it
capture
)

If the argument is true, causes the receiver to have all mouse events delivered to it until the method is called with false as the argument.

public void
setCursor(Cursor
the new cursor (or null)
cursor
)

Sets the receiver's cursor to the cursor specified by the argument, or to the default cursor for that kind of control if the argument is null.

pack-priv void
setCursor(long cursor)

public void
setDragDetect(boolean
the new drag detect state
dragDetect
)

Sets the receiver's drag detect state.

private void
public void
setEnabled(boolean
the new enabled state
enabled
)

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

public boolean

Returns:

true if the control got focus, and false if it was unable to.
setFocus
()

Causes the receiver to have the keyboard focus, such that all keyboard events will be delivered to it.

public void
setFont(Font
the new font (or null)
font
)

Sets the font that the receiver will use to paint textual information to the font specified by the argument, or to the default font for that kind of control if the argument is null.

pack-priv void
setFontDescription(long font)

public void
setForeground(Color
the new color (or null)
color
)

Sets the receiver's foreground color to the color specified by the argument, or to the default system color for the control if the argument is null.

pack-priv void
pack-priv void
setForegroundGdkRGBA(long handle, GdkRGBA rgba)

pack-priv void
public void
setLayoutData(Object
the new layout data for the receiver.
layoutData
)

Sets the layout data associated with the receiver to the argument.

public void
setLocation(Point
the new location for the receiver
location
)

Sets the receiver's location to the point specified by the arguments which are relative to the receiver's parent (or its display if its parent is null), unless the receiver is a shell.

public void
setLocation(int
the new x coordinate for the receiver
x
,
int
the new y coordinate for the receiver
y
)

Sets the receiver's location to the point specified by the arguments which are relative to the receiver's parent (or its display if its parent is null), unless the receiver is a shell.

pack-priv void
pack-priv void
setLocationInPixels(int x, int y)

public void
setMenu(Menu
the new pop up menu
menu
)

Sets the receiver's pop up menu to the argument.

pack-priv void
public void
setOrientation(int
new orientation style
orientation
)

Sets the orientation of the receiver, which must be one of the constants SWT.LEFT_TO_RIGHT or SWT.RIGHT_TO_LEFT.

public boolean

Returns:

true if the parent is changed and false otherwise.
setParent
(Composite
the new parent for the control.
parent
)

Changes the parent of the widget to be the one provided.

pack-priv void
pack-priv void
pack-priv boolean
setRadioSelection(boolean value)

public void
setRedraw(boolean
the new redraw state
redraw
)

If the argument is false, causes subsequent drawing operations in the receiver to be ignored.

public void
setRegion(Region
the region that defines the shape of the control (or null)
region
)

Sets the shape of the control to the region specified by the argument.

pack-priv void
private void
public void
setSize(Point
the new size in points for the receiver
size
)

Sets the receiver's size to the point specified by the argument.

public void
setSize(int
the new width in points for the receiver
width
,
int
the new height in points for the receiver
height
)

Sets the receiver's size to the point specified by the arguments.

pack-priv void
pack-priv void
setSizeInPixels(int width, int height)

pack-priv boolean
public void
setTextDirection(int
the base text direction style
textDirection
)

Sets the base text direction (a.k.a. "paragraph direction") of the receiver, which must be one of the constants SWT.LEFT_TO_RIGHT, SWT.RIGHT_TO_LEFT, or SWT.AUTO_TEXT_DIRECTION.

public void
setToolTipText(String
the new tool tip text (or null)
string
)

Sets the receiver's tool tip text to the argument, which may be null indicating that the default tool tip for the control will be shown.

pack-priv void
setToolTipText(Shell shell, String newString)

public void
setTouchEnabled(boolean
the new touch-enabled state
enabled
)

Sets whether this control should send touch events (by default controls do not).

public void
setVisible(boolean
the new visibility state
visible
)

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

pack-priv void
private void
pack-priv void
setZOrder(Control sibling, boolean above, boolean fixRelations)

pack-priv void
setZOrder(Control sibling, boolean above, boolean fixRelations, boolean fixChildren)

pack-priv boolean
showMenu(int x, int y)

pack-priv boolean
showMenu(int x, int y, int detail)

pack-priv void
pack-priv void
sort(int[] items)

pack-priv static void
swipeProc(long gesture, double velocity_x, double velocity_y, long user_data)

public Point

Returns:

the translated coordinates
toControl
(int
the x coordinate in points to be translated
x
,
int
the y coordinate in points to be translated
y
)

Returns a point which is the result of converting the argument, which is specified in display relative coordinates, to coordinates relative to the receiver.

public Point

Returns:

the translated coordinates
toControl
(Point
the point to be translated (must not be null)
point
)

Returns a point which is the result of converting the argument, which is specified in display relative coordinates, to coordinates relative to the receiver.

public Point

Returns:

the translated coordinates
toDisplay
(int
the x coordinate to be translated
x
,
int
the y coordinate to be translated
y
)

Returns a point which is the result of converting the argument, which is specified in coordinates relative to the receiver, to display relative coordinates.

public Point

Returns:

the translated coordinates
toDisplay
(Point
the point to be translated (must not be null)
point
)

Returns a point which is the result of converting the argument, which is specified in coordinates relative to the receiver, to display relative coordinates.

pack-priv Point
toDisplayInPixels(int x, int y)

pack-priv Point
pack-priv long
pack-priv boolean
pack-priv boolean
translateMnemonic(int keyval, long event)

pack-priv boolean
translateTraversal(long event)

pack-priv int
traversalCode(int key, long event)

public boolean

Returns:

true if the traversal succeeded
traverse
(int
the type of traversal
traversal
)

Based on the argument, perform one of the expected platform traversal action.

public boolean

Returns:

true if the traversal succeeded
traverse
(int
the type of traversal, or SWT.TRAVERSE_NONE to compute this from event
traversal
,
Event
the KeyDown event
event
)

Performs a platform traversal action corresponding to a KeyDown event.

public boolean

Returns:

true if the traversal succeeded
traverse
(int
the type of traversal, or SWT.TRAVERSE_NONE to compute this from event
traversal
,
KeyEvent
the KeyDown event
event
)

Performs a platform traversal action corresponding to a KeyDown event.

pack-priv boolean
traverse(int traversal, char character, int keyCode, int keyLocation, int stateMask, boolean doit)

pack-priv boolean
traverse(Event event)

pack-priv boolean
pack-priv boolean
traverseGroup(boolean next)

pack-priv boolean
traverseItem(boolean next)

pack-priv boolean
traverseMnemonic(char key)

pack-priv boolean
traversePage(boolean next)

pack-priv boolean
public void
update()

Forces all outstanding paint requests for the widget to be processed before this method returns.

pack-priv void
update(boolean all, boolean flush)

pack-priv void
pack-priv void
updateLayout(boolean all)

pack-priv boolean
pack-priv long
windowProc(long handle, long arg0, long user_data)

Overrides org.eclipse.swt.widgets.Widget.windowProc.

Inherited from org.eclipse.swt.widgets.Widget:
_addListeneraddDisposeListeneraddListenercellDataProccheckBitscheckOpencheckOrientationcheckParentcheckSubclasscheckWidgetconvertPangoFontDescriptionToCsscreateHandlecssHandledisposedpiChangedenterMotionProcerrorfilterProcfiltersfixMnemonicfixMnemonicfixMnemonicfocusProcfontHeightgdk_event_freegdk_event_get_stategdk_event_get_surface_or_windowgdk_pointer_grabgdk_pointer_ungrabgdk_surface_get_sizegdk_window_get_sizeGdkSeatGrabPrepareFuncgesturePressReleaseProcgetDatagetDatagetDisplaygetListenersgetNamegetNameTextgetStylegtk_activategtk_adjustment_getgtk_box_newgtk_box_pack_endgtk_box_set_child_packinggtk_cell_renderer_get_preferred_sizegtk_change_valuegtk_changedgtk_clickedgtk_close_requestgtk_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_expand_collapse_cursor_rowgtk_grab_focusgtk_hidegtk_icon_releasegtk_inputgtk_insert_textgtk_mapgtk_map_eventgtk_menu_popped_upgtk_month_changedgtk_move_focusgtk_outputgtk_populate_popupgtk_row_activatedgtk_row_has_child_toggledgtk_scroll_childgtk_selectgtk_selection_donegtk_showgtk_size_allocategtk_start_interactive_searchgtk_status_icon_popup_menugtk_switch_pagegtk_test_collapse_rowgtk_test_expand_rowgtk_text_buffer_insert_textgtk_timergtk_toggledgtk_tree_view_column_cell_get_positiongtk_unmapgtk_unmap_eventgtk_value_changedgtk_widget_get_preferred_sizegtk_widget_get_surfacegtk_widget_get_windowgtk_widget_size_allocategtk_window_state_eventhooksisAutoDirectionisDisposedisListeningisValidSubclassisValidThreadkeyPressReleaseProcleaveProcmnemonicHitmnemonicMatchnotifyCreationTrackernotifyDisposalTrackernotifyListenersnotifyProcnotifyStatepostEventpostEventreleaseChildrenremoveDisposeListenerremoveListenerremoveListenerrendererGetPreferredWidthProcrendererRenderProcrendererSnapshotProcreskinreskinChildrenreskinWidgetscrollProcsendEventsendEventsendEventsendEventsendIMKeyEventsendKeyEventsendSelectionEventsendSelectionEventsetButtonStatesetDatasetDatasetFontDescriptionsetInputStatesetKeyStatesetLocationStatesetTabGroupFocussetToolTipTextshellMapProcsizeAllocateProcsizeRequestProcsnapshotToDrawtimerProctoStringtranslateTraversalwindowActiveProcwindowProcwindowProcwindowProcwindowProc