Class Shell
- All Implemented Interfaces:
Drawable
Display as the argument) are described
as top level shells. Instances that do have
a parent are described as secondary or
dialog shells.
Instances are always displayed in one of the maximized, minimized or normal states:
-
When an instance is marked as maximized, the
window manager will typically resize it to fill the
entire visible area of the display, and the instance
is usually put in a state where it can not be resized
(even if it has style
RESIZE) until it is no longer maximized. - When an instance is in the normal state (neither maximized or minimized), its appearance is controlled by the style constants which were specified when it was created and the restrictions of the window manager (see below).
- When an instance has been marked as minimized, its contents (client area) will usually not be visible, and depending on the window manager, it may be "iconified" (that is, replaced on the desktop by a small simplified representation of itself), relocated to a distinguished area of the screen, or hidden. Combinations of these changes are also possible.
The modality of an instance may be specified using
style bits. The modality style bits are used to determine
whether input is blocked for other shells on the display.
The PRIMARY_MODAL style allows an instance to block
input to its parent. The APPLICATION_MODAL style
allows an instance to block input to every other shell in the
display. The SYSTEM_MODAL style allows an instance
to block input to all shells, including shells belonging to
different applications.
Note: The styles supported by this class are treated
as HINTs, since the window manager for the
desktop on which the instance is visible has ultimate
control over the appearance and behavior of decorations
and modality. For example, some window managers only
support resizable windows and will always assume the
RESIZE style, even if it is not set. In addition, if a
modality style is not supported, it is "upgraded" to a
more restrictive modality style that is supported. For
example, if PRIMARY_MODAL is not supported,
it would be upgraded to APPLICATION_MODAL.
A modality style may also be "downgraded" to a less
restrictive style. For example, most operating systems
no longer support SYSTEM_MODAL because
it can freeze up the desktop, so this is typically
downgraded to APPLICATION_MODAL.
- Styles:
- BORDER, CLOSE, MIN, MAX, NO_MOVE, NO_TRIM, RESIZE, TITLE, ON_TOP, TOOL, SHEET
- APPLICATION_MODAL, MODELESS, PRIMARY_MODAL, SYSTEM_MODAL
- Events:
- Activate, Close, Deactivate, Deiconify, Iconify
Class SWT provides two "convenience constants"
for the most commonly required style combinations:
SHELL_TRIM-
the result of combining the constants which are required
to produce a typical application top level shell: (that
is,
CLOSE | TITLE | MIN | MAX | RESIZE) DIALOG_TRIM-
the result of combining the constants which are required
to produce a typical application dialog shell: (that
is,
TITLE | CLOSE | BORDER)
Note: Only one of the styles APPLICATION_MODAL, MODELESS, PRIMARY_MODAL and SYSTEM_MODAL may be specified.
IMPORTANT: This class is not intended to be subclassed.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) static final int(package private) boolean(package private) boolean(package private) GeometryInterface(package private) boolean(package private) long(package private) boolean(package private) boolean(package private) boolean(package private) Control(package private) boolean(package private) static final int(package private) long(package private) boolean(package private) boolean(package private) int(package private) int(package private) int(package private) int(package private) boolean(package private) Region(package private) boolean(package private) static final double(package private) long(package private) boolean(package private) ToolTip[](package private) long(package private) longFields inherited from class Decorations
accelGroup, defaultButton, image, images, maximized, menuBar, menus, minimized, saveDefault, savedFocus, text, vboxHandleFields inherited from class Composite
backgroundMode, childrenLowered, embeddedHandle, fixClipHandle, fixClipMap, imHandle, layout, layoutCount, NO_INPUT_METHOD, noChildDrawing, popupChild, socketHandle, tabListFields inherited from class Scrollable
horizontalBar, RESIZE_ON_GETCLIENTAREA, scrolledHandle, verticalBarFields inherited from class Control
accessible, autoScale, backgroundAlpha, backgroundImage, cachedNoBackground, checkScaleFactor, cssBackground, cssForeground, cursor, DISABLE_EMOJI, dragDetectionQueue, dragGesture, drawCount, drawRegion, enableWindow, eventRegion, firstFixedHandle, fixedHandle, font, gestureBegin, gestureEnd, gestureRotation, gestureSwipe, gestureZoom, keyController, labelRelation, lastInput, layoutData, menu, mouseDown, panGesture, parent, provider, redrawWindow, region, regionHandle, rotateGesture, toolTipText, zoomGestureFields inherited from class Widget
ACTIVATE, ACTIVATE_INVERSE, AUTO_TEXT_DIRECTION, BACKGROUND, BACKSPACE, BACKSPACE_INVERSE, BUTTON_PRESS_EVENT, BUTTON_PRESS_EVENT_INVERSE, BUTTON_RELEASE_EVENT, BUTTON_RELEASE_EVENT_INVERSE, CANVAS, CHANGE_VALUE, CHANGED, CHECK_SUBWINDOW, CLICKED, CLOSE_REQUEST, COMMIT, COMPUTE_SIZE, CONFIGURE_EVENT, COPY_CLIPBOARD, COPY_CLIPBOARD_INVERSE, CREATE_MENU_PROXY, CUT_CLIPBOARD, CUT_CLIPBOARD_INVERSE, data, DAY_SELECTED, DAY_SELECTED_DOUBLE_CLICK, DECELERATE, DEFAULT_HEIGHT, DEFAULT_WIDTH, DELETE_EVENT, DELETE_FROM_CURSOR, DELETE_FROM_CURSOR_INVERSE, DELETE_RANGE, DELETE_TEXT, DIRECTION_CHANGED, DISABLED, display, DISPOSE_SENT, DISPOSED, DPI_CHANGED, DRAG_DETECT, DRAW, ENTER, ENTER_NOTIFY_EVENT, EVENT, EVENT_AFTER, eventTable, EXPAND_COLLAPSE_CURSOR_ROW, EXPOSE_EVENT, EXPOSE_EVENT_INVERSE, FOCUS, FOCUS_IN, FOCUS_IN_EVENT, FOCUS_OUT, FOCUS_OUT_EVENT, FONT, FOREGROUND, FOREIGN_HANDLE, gdkSeatGrabPrepareFunc, GESTURE_PRESSED, GESTURE_RELEASED, GRAB_FOCUS, handle, HANDLE, HAS_AUTO_DIRECTION, HIDDEN, HIDE, ICON_RELEASE, IM_UPDATE, INPUT, INSERT_TEXT, IS_ACTIVE, KEY_CHECK_SUBWINDOW, KEY_GTK_CSS, KEY_PRESS_EVENT, KEY_PRESSED, KEY_RELEASE_EVENT, KEY_RELEASED, KEYED_DATA, LAST_SIGNAL, LAYOUT_CHANGED, LAYOUT_CHILD, LAYOUT_NEEDED, LEAVE, LEAVE_NOTIFY_EVENT, MAP, MAP_EVENT, MENU, MNEMONIC_ACTIVATE, MONTH_CHANGED, MOTION, MOTION_INVERSE, MOTION_NOTIFY_EVENT, MOTION_NOTIFY_EVENT_INVERSE, MOVE_CURSOR, MOVE_CURSOR_INVERSE, MOVE_FOCUS, MOVED, NOTIFY_DEFAULT_HEIGHT, NOTIFY_DEFAULT_WIDTH, NOTIFY_MAXIMIZED, NOTIFY_STATE, OBSCURED, OUTPUT, PARENT_BACKGROUND, PASTE_CLIPBOARD, PASTE_CLIPBOARD_INVERSE, POPPED_UP, POPULATE_POPUP, POPUP_MENU, PREEDIT_CHANGED, REALIZE, RELEASED, RESIZED, ROW_ACTIVATED, ROW_DELETED, ROW_HAS_CHILD_TOGGLED, ROW_INSERTED, SCROLL, SCROLL_BEGIN, SCROLL_CHILD, SCROLL_END, SCROLL_EVENT, SELECT, SELECTION_DONE, SHOW, SHOW_HELP, SIZE_ALLOCATE, SIZE_ALLOCATE_GTK4, SKIN_NEEDED, START_INTERACTIVE_SEARCH, state, STATUS_ICON_POPUP_MENU, style, STYLE_UPDATED, SWITCH_PAGE, TEST_COLLAPSE_ROW, TEST_EXPAND_ROW, TEXT_BUFFER_INSERT_TEXT, THEME_BACKGROUND, TOGGLED, UNMAP, UNMAP_EVENT, UNREALIZE, VALUE_CHANGED, WINDOW_STATE_EVENT, ZERO_HEIGHT, ZERO_WIDTH -
Constructor Summary
ConstructorsConstructorDescriptionShell()Constructs a new instance of this class.Shell(int style) Constructs a new instance of this class given only the style value describing its behavior and appearance.Constructs a new instance of this class given only the display to create it on.Constructs a new instance of this class given the display to create it on and a style value describing its behavior and appearance.Constructs a new instance of this class given only its parent.Constructs a new instance of this class given its parent and a style value describing its behavior and appearance. -
Method Summary
Modifier and TypeMethodDescription(package private) ShellvoidaddShellListener(ShellListener listener) Adds the listener to the collection of listeners who will be notified when operations are performed on the receiver, by sending the listener one of the messages defined in theShellListenerinterface.(package private) voidaddToolTip(ToolTip toolTip) (package private) voidadjustTrim(int widthHint, int heightHint) Resize the shell based on the trim width and height.(package private) voidbringToTop(boolean force) (package private) voidcenter()(package private) voidSWT.ON_TOP shells on Wayland requires gdk_seat_grab to grab keyboard/input focus, the grabbed focus need to be removed when Shell is disposed/hidden.(package private) void(package private) void(package private) static intcheckStyle(Shell parent, int style) voidclose()Requests that the window manager close the receiver in the same way it would be closed when the user clicks on the "close box" or performs some other platform specific key or mouse combination that indicates the window should be removed.(package private) void(package private) RectanglecomputeTrimInPixels(int x, int y, int width, int height) (package private) voidcreateHandle(int index) (package private) voidvoiddispose()Disposes of the operating system resources associated with the receiver and all its descendants.(package private) longfilterProc(long xEvent, long gdkEvent, long data2) (package private) Control(package private) Composite(package private) void(package private) void(package private) voidfixStyle(long handle) voidIf the receiver is visible, moves it to the top of the drawing order for the display on which it was created (so that all other shells on that display, which are not the receiver's children will be drawn behind it) and forces the window manager to make the shell active.(package private) void(package private) voidforceResize(int width, int height) (package private) static voidgdk_region_get_rectangles(long region, long[] rectangles, int[] n_rectangles) intgetAlpha()Returns the receiver's alpha value.(package private) RectanglebooleanReturnstrueif the receiver is currently in fullscreen state, and false otherwise.intReturns the receiver's input method editor mode.(package private) PointbooleanReturnstrueif the receiver is currently maximized, and false otherwise.Returns a point describing the maximum receiver's size.Returns a point describing the minimum receiver's size.(package private) ShellbooleanGets the receiver's modified state.Returns the region that defines the shape of the shell, ornullif the shell has the default shape.(package private) intgetResizeMode(double x, double y) Shell[]Returns an array containing all shells which are descendants of the receiver.(package private) Point(package private) PointGets the position of the top left corner of the control in root window (display) coordinates.Returns a ToolBar object representing the tool bar that can be shown in the receiver's trim.booleanReturnstrueif the receiver is visible, andfalseotherwise.(package private) PointGets the position of the top left corner of the control in root window (display) coordinates.(package private) longgtk_button_press_event(long widget, long event) (package private) longgtk_close_request(long widget) (package private) longgtk_configure_event(long widget, long event) (package private) longgtk_delete_event(long widget, long event) (package private) longgtk_draw(long widget, long cairo) (package private) longgtk_enter_notify_event(long widget, long event) (package private) longgtk_focus(long widget, long directionType) (package private) longgtk_focus_in_event(long widget, long event) (package private) longgtk_focus_out_event(long widget, long event) (package private) longgtk_leave_notify_event(long widget, long event) (package private) longgtk_map(long widget) (package private) longgtk_motion_notify_event(long widget, long event) (package private) longgtk_move_focus(long widget, long directionType) static ShellInvokes platform specific functionality to allocate a new shell that is embedded.(package private) longgtk_realize(long widget) (package private) longgtk_size_allocate(long widget, long allocation) (package private) longgtk_window_state_event(long widget, long event) (package private) longgtk3_key_press_event(long widget, long event) (package private) boolean(package private) voidstatic Shellinternal_new(Display display, long handle) Invokes platform specific functionality to allocate a new shell that is not embedded.(package private) booleanDetermines whether a Shell has both SWT.RESIZE and SWT.ON_TOP set without SWT.NO_TRIM.booleanReturnstrueif the receiver is enabled and all ancestors up to and including the receiver's nearest ancestor shell are enabled.(package private) booleanDetermines whether a Shell's parent is a popup window.(package private) booleanbooleanReturnstrueif the receiver is visible and all ancestors up to and including the receiver's nearest ancestor shell are visible.(package private) static RegionmirrorRegion(Region region) (package private) longnotifyState(long object, long arg0) voidopen()Moves the receiver to the top of the drawing order for the display on which it was created (so that all other shells on that display, which are not the receiver's children will be drawn behind it), marks it visible, sets the focus and asks the window manager to make the shell active.(package private) longbooleanPrints the receiver and all children.(package private) voidregister()(package private) voidreleaseChildren(boolean destroy) (package private) void(package private) void(package private) voidvoidremoveShellListener(ShellListener listener) Removes the listener from the collection of listeners who will be notified when operations are performed on the receiver.(package private) voidremoveTooTip(ToolTip toolTip) voidRequests that this control and all of its ancestors be repositioned by their layouts at the earliest opportunity.(package private) boolean(package private) voidresizeBounds(int width, int height, boolean notify) (package private) voidreskinChildren(int flags) voidIf the receiver is visible, moves it to the top of the drawing order for the display on which it was created (so that all other shells on that display, which are not the receiver's children will be drawn behind it) and asks the window manager to make the shell active(package private) voidsetActiveControl(Control control) (package private) voidsetActiveControl(Control control, int type) voidsetAlpha(int alpha) Sets the receiver's alpha value which must be between 0 (transparent) and 255 (opaque).(package private) intsetBounds(int x, int y, int width, int height, boolean move, boolean resize) (package private) voidsetCursor(long cursor) voidsetEnabled(boolean enabled) Enables the receiver if the argument istrue, and disables it otherwise.voidsetFullScreen(boolean fullScreen) Sets the full screen state of the receiver.voidsetImeInputMode(int mode) Sets the input method editor mode to the argument which should be the result of bitwise OR'ing together one or more of the following constants defined in classSWT:NONE,ROMAN,DBCS,PHONETIC,NATIVE,ALPHA.(package private) voidvoidsetMaximized(boolean maximized) Sets the maximized state of the receiver.voidsetMaximumSize(int width, int height) Sets the receiver's maximum size to the size specified by the arguments.voidsetMaximumSize(Point size) Sets the receiver's maximum size to the size specified by the argument.voidsetMenuBar(Menu menu) Sets the receiver's menu bar to the argument, which may be null.voidsetMinimized(boolean minimized) Sets the minimized stated of the receiver.voidsetMinimumSize(int width, int height) Sets the receiver's minimum size to the size specified by the arguments.voidsetMinimumSize(Point size) Sets the receiver's minimum size to the size specified by the argument.voidsetModified(boolean modified) Sets the receiver's modified state as specified by the argument.voidSets the shape of the shell to the region specified by the argument.(package private) voidvoidSets the receiver's text, which is the string that the window manager will typically display as the receiver's title, to the argument, which must not be null.voidsetVisible(boolean visible) Marks the receiver as visible if the argument istrue, and marks it invisible otherwise.(package private) void(package private) longshellMapProc(long handle, long arg0, long user_data) (package private) void(package private) longsizeAllocateProc(long handle, long arg0, long user_data) (package private) longsizeRequestProc(long handle, long arg0, long user_data) (package private) long(package private) boolean(package private) int(package private) intprivate voidupdateDecorations(long gdkResource) (package private) voidupdateMinimized(boolean minimized) (package private) voidMethods inherited from class Decorations
_setImages, addMenu, checkStyle, checkSubclass, compare, computeTabGroup, computeTabRoot, createAccelGroup, createWidget, destroyAccelGroup, fixAccelGroup, fixDecorations, getDefaultButton, getImage, getImages, getMenuBar, getMinimized, getNameText, getText, isReparentable, isTabGroup, isTabItem, menuShell, removeMenu, restoreFocus, setDefaultButton, setImage, setImages, setOrientation, setSavedFocus, sort, traverseItem, traverseReturnMethods inherited from class Canvas
drawBackground, drawCaretInFocus, getCaret, getIMCaretPos, getIME, gtk_commit, gtk_preedit_changed, gtk4_draw, gtk4_focus_enter_event, gtk4_focus_leave_event, redrawWidget, scroll, setCaret, setFont, setIME, updateCaretMethods inherited from class Composite
_getChildren, _getTabList, adjustChildClipping, applyThemeBackground, changed, checkBuffered, checkSubwindow, computeSizeInPixels, computeTabList, connectFixedHandleDraw, createHandle, drawBackground, enableWidget, findMenus, fixChildren, fixClippings, fixModal, fixParentGdkResource, fixStyle, fixTabList, fixZOrder, focusHandle, forceFocus, getBackgroundMode, getChildren, getChildrenCount, getClientAreaInPixels, getLayout, getLayoutDeferred, getTabList, gtk_scroll_child, gtk_style_updated, gtk4_key_press_event, hooksKeys, imHandle, isLayoutDeferred, layout, layout, layout, layout, layout, markLayout, minimumSize, moveAbove, moveBelow, moveChildren, mustBeVisibleOnInitBounds, parentingHandle, printWidget, propagateDraw, redrawChildren, removeControl, resizeHandle, setBackgroundMode, setFocus, setLayout, setLayoutDeferred, setScrollBarVisible, setTabGroupFocus, setTabItemFocus, setTabList, toString, translateMnemonic, translateTraversal, traversalCode, updateBackgroundMode, updateLayoutMethods inherited from class Scrollable
clientHandle, computeTrim, createScrollBar, destroyScrollBar, getBorderWidthInPixels, getClientArea, getHorizontalBar, getScrollbarsMode, getVerticalBar, gtk_scroll_event, hScrollBarWidth, redrawBackgroundImage, sendLeaveNotify, setScrollbarsMode, updateScrollBarValue, vScrollBarWidthMethods inherited from class Control
_getAccessible, addControlListener, addDragDetectListener, addFocusListener, addGestureListener, addHelpListener, addKeyListener, addMenuDetectListener, addMouseListener, addMouseMoveListener, addMouseTrackListener, addMouseWheelListener, addPaintListener, addRelation, addTouchListener, addTraverseListener, cairoClipRegion, cairoCopyRegion, cairoDisposeRegion, checkBackground, checkMirrored, cleanupEnableWindow, computeNativeSize, computeSize, computeSize, computeSizeInPixels, containedInRegion, defaultBackground, defaultFont, destroyWidget, dragDetect, dragDetect, dragDetect, dragDetect, drawBackground, drawGripper, drawWidget, enterExitHandle, eventHandle, eventSurface, eventWindow, filterKey, fixFocus, fixGdkEventTypeValues, flushQueueOnDnd, fontHandle, forceFocus, gestureBeginProc, gestureEndProc, gestureHandle, getAccessible, getBackground, getBackgroundGdkRGBA, getBackgroundImage, getBaseGdkRGBA, getBgGdkRGBA, getBorderWidth, getBounds, getClientWidth, getContextBackgroundGdkRGBA, getContextColorGdkRGBA, getControl, getControlOrigin, getCursor, getDragDetect, getEnabled, getFont, getFontDescription, getForeground, getForegroundGdkRGBA, getLayoutData, getLocation, getMenu, getMonitor, getOrientation, getParent, getPath, getShell, getSize, getTextDirection, getThickness, getToolTipText, getTouchEnabled, gtk_button_press_event, gtk_button_release_event, gtk_css_provider_load_from_css, gtk_gesture_press_event, gtk_gesture_release_event, gtk_label_set_align, gtk_mnemonic_activate, gtk_style_context_get_border, gtk_style_context_get_padding, gtk_unrealize, gtk_widget_reparent, gtk_widget_set_align, gtk3_event_after, gtk3_key_release_event, gtk3_popup_menu, gtk3_show_help, gtk4_enter_event, gtk4_focus_window_event, gtk4_key_release_event, gtk4_leave_event, gtk4_motion_event, gtk4_scroll_event, hasFocus, hooksPaint, hoverProc, internal_dispose_GC, internal_new_GC, isActive, isAutoScalable, isDescribedByLabel, isFocusAncestor, isFocusControl, isFocusHandle, isShowing, magnifyProc, mnemonicHit, mnemonicMatch, moveAbove, moveBelow, moveHandle, pack, pack, paintSurface, paintWindow, printWindow, redraw, redraw, redraw, release, removeControlListener, removeDragDetectListener, removeFocusListener, removeGestureListener, removeHelpListener, removeKeyListener, removeMenuDetectListener, removeMouseListener, removeMouseMoveListener, removeMouseTrackListener, removeMouseWheelListener, removePaintListener, removeRelation, removeTouchListener, removeTraverseListener, resizeCalculationsGTK3, restackWindow, rotateProc, sendDragEvent, sendFocusEvent, sendGestureEvent, sendGestureEvent, sendGestureEvent, sendHelpEvent, sendMouseEvent, sendMouseEvent, setBackground, setBackground, setBackgroundGdkRGBA, setBackgroundGdkRGBA, setBackgroundGdkRGBA, setBackgroundImage, setBackgroundSurface, setBounds, setBounds, setBoundsInPixels, setBoundsInPixels, setCapture, setCursor, setDragDetect, setFontDescription, setForeground, setForegroundGdkRGBA, setForegroundGdkRGBA, setLayoutData, setLocation, setLocation, setLocationInPixels, setLocationInPixels, setMenu, setOrientation, setParent, setParentBackground, setParentGdkResource, setRadioSelection, setRedraw, setSize, setSize, setSizeInPixels, setSizeInPixels, setTextDirection, setToolTipText, setToolTipText, setTouchEnabled, setWidgetBackground, setZOrder, showMenu, showMenu, sort, swipeProc, toControl, toControl, toDisplay, toDisplay, toDisplayInPixels, translateMnemonic, traverse, traverse, traverse, traverse, traverse, traverseGroup, traverseMnemonic, traversePage, update, update, wantDragDropDetection, windowProcMethods inherited from class Widget
_addListener, addDisposeListener, addListener, addTypedListener, cellDataProc, checkBits, checkOrientation, checkParent, checkWidget, convertPangoFontDescriptionToCss, cssHandle, dpiChanged, enterMotionProc, error, filters, fixMnemonic, fixMnemonic, fixMnemonic, focusProc, fontHeight, gdk_event_free, gdk_event_get_state, gdk_event_get_surface_or_window, gdk_pointer_grab, gdk_pointer_ungrab, gdk_surface_get_size, gdk_window_get_size, GdkSeatGrabPrepareFunc, gesturePressReleaseProc, getData, getData, getDisplay, getListeners, getName, getStyle, getTypedListeners, gtk_activate, gtk_adjustment_get, gtk_box_new, gtk_box_pack_end, gtk_box_set_child_packing, gtk_cell_renderer_get_preferred_size, gtk_change_value, gtk_changed, gtk_clicked, gtk_container_get_border_width_or_margin, gtk_container_set_border_width, gtk_create_menu_proxy, gtk_day_selected, gtk_day_selected_double_click, gtk_delete_range, gtk_delete_text, gtk_expand_collapse_cursor_row, gtk_grab_focus, gtk_hide, gtk_icon_release, gtk_input, gtk_insert_text, gtk_map_event, gtk_menu_popped_up, gtk_month_changed, gtk_output, gtk_populate_popup, gtk_row_activated, gtk_row_has_child_toggled, gtk_select, gtk_selection_done, gtk_show, gtk_start_interactive_search, gtk_status_icon_popup_menu, gtk_switch_page, gtk_test_collapse_row, gtk_test_expand_row, gtk_text_buffer_insert_text, gtk_timer, gtk_toggled, gtk_tree_view_column_cell_get_position, gtk_unmap, gtk_unmap_event, gtk_value_changed, gtk_widget_get_preferred_size, gtk_widget_get_surface, gtk_widget_get_window, gtk_widget_hide, gtk_widget_show, gtk_widget_size_allocate, hooks, isAutoDirection, isDisposed, isListening, isValidSubclass, isValidThread, keyPressReleaseProc, leaveProc, mnemonicHit, mnemonicMatch, notifyCreationTracker, notifyDisposalTracker, notifyListeners, notifyProc, postEvent, postEvent, removeDisposeListener, removeListener, removeListener, removeListener, removeTypedListener, rendererGetPreferredWidthProc, rendererRenderProc, rendererSnapshotProc, reskin, reskinWidget, scrollProc, sendEvent, sendEvent, sendEvent, sendEvent, sendIMKeyEvent, sendKeyEvent, sendSelectionEvent, sendSelectionEvent, setButtonState, setData, setData, setFontDescription, setInputState, setKeyState, setLocationState, setToolTipText, snapshotToDraw, timerProc, translateTraversal, windowActiveProc, windowProc, windowProc, windowProc, windowProc
-
Field Details
-
shellHandle
long shellHandle -
tooltipsHandle
long tooltipsHandle -
tooltipWindow
long tooltipWindow -
group
long group -
modalGroup
long modalGroup -
mapped
boolean mapped -
moved
boolean moved -
resized
boolean resized -
opened
boolean opened -
fullScreen
boolean fullScreen -
showWithParent
boolean showWithParent -
modified
boolean modified -
center
boolean center -
oldX
int oldX -
oldY
int oldY -
oldWidth
int oldWidth -
oldHeight
int oldHeight -
geometry
GeometryInterface geometry -
lastActive
Control lastActive -
toolTips
ToolTip[] toolTips -
ignoreFocusOut
boolean ignoreFocusOut -
ignoreFocusIn
boolean ignoreFocusIn -
ignoreFocusOutAfterGrab
boolean ignoreFocusOutAfterGrab -
grabbedFocus
boolean grabbedFocus -
originalRegion
Region originalRegion -
MAXIMUM_TRIM
static final int MAXIMUM_TRIM- See Also:
-
BORDER
static final int BORDER- See Also:
-
SHELL_TO_MONITOR_RATIO
static final double SHELL_TO_MONITOR_RATIO- See Also:
-
-
Constructor Details
-
Shell
public Shell()Constructs a new instance of this class. This is equivalent to callingShell((Display) null).- Throws:
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
-
Shell
public Shell(int style) Constructs a new instance of this class given only the style value describing its behavior and appearance. This is equivalent to callingShell((Display) null, style).The style value is either one of the style constants defined in class
SWTwhich is applicable to instances of this class, or must be built by bitwise OR'ing together (that is, using theint"|" operator) two or more of thoseSWTstyle constants. The class description lists the style constants that are applicable to the class. Style bits are also inherited from superclasses.- Parameters:
style- the style of control to construct- Throws:
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:
-
Shell
Constructs a new instance of this class given only the display to create it on. It is created with styleSWT.SHELL_TRIM.Note: Currently, null can be passed in for the display argument. This has the effect of creating the shell on the currently active display if there is one. If there is no current display, the shell is created on a "default" display. Passing in null as the display argument is not considered to be good coding style, and may not be supported in a future release of SWT.
- Parameters:
display- the display to create the shell on- Throws:
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
-
Shell
Constructs a new instance of this class given the display to create it on and a style value describing its behavior and appearance.The style value is either one of the style constants defined in class
SWTwhich is applicable to instances of this class, or must be built by bitwise OR'ing together (that is, using theint"|" operator) two or more of thoseSWTstyle constants. The class description lists the style constants that are applicable to the class. Style bits are also inherited from superclasses.Note: Currently, null can be passed in for the display argument. This has the effect of creating the shell on the currently active display if there is one. If there is no current display, the shell is created on a "default" display. Passing in null as the display argument is not considered to be good coding style, and may not be supported in a future release of SWT.
- Parameters:
display- the display to create the shell onstyle- the style of control to construct- Throws:
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:
-
Shell
-
Shell
Constructs a new instance of this class given only its parent. It is created with styleSWT.DIALOG_TRIM.Note: Currently, null can be passed in for the parent. This has the effect of creating the shell on the currently active display if there is one. If there is no current display, the shell is created on a "default" display. Passing in null as the parent is not considered to be good coding style, and may not be supported in a future release of SWT.
- Parameters:
parent- a shell which will be the parent of the new instance- Throws:
IllegalArgumentException-- ERROR_INVALID_ARGUMENT - if the parent is disposed
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
-
Shell
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
SWTwhich is applicable to instances of this class, or must be built by bitwise OR'ing together (that is, using theint"|" operator) two or more of thoseSWTstyle constants. The class description lists the style constants that are applicable to the class. Style bits are also inherited from superclasses.Note: Currently, null can be passed in for the parent. This has the effect of creating the shell on the currently active display if there is one. If there is no current display, the shell is created on a "default" display. Passing in null as the parent is not considered to be good coding style, and may not be supported in a future release of SWT.
- Parameters:
parent- a shell which will be the parent of the new instancestyle- the style of control to construct- Throws:
IllegalArgumentException-- ERROR_INVALID_ARGUMENT - if the parent is disposed
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:
-
-
Method Details
-
gtk_new
Invokes platform specific functionality to allocate a new shell that is embedded.IMPORTANT: This method is not part of the public API for
Shell. It is marked public only so that it can be shared within the packages provided by SWT. It is not available on all platforms, and should never be called from application code.- Parameters:
display- the display for the shellhandle- the handle for the shell- Returns:
- a new shell object containing the specified display and handle
-
internal_new
Invokes platform specific functionality to allocate a new shell that is not embedded.IMPORTANT: This method is not part of the public API for
Shell. It is marked public only so that it can be shared within the packages provided by SWT. It is not available on all platforms, and should never be called from application code.- Parameters:
display- the display for the shellhandle- the handle for the shell- Returns:
- a new shell object containing the specified display and handle
- Since:
- 3.3
-
checkStyle
-
addShellListener
Adds the listener to the collection of listeners who will be notified when operations are performed on the receiver, by sending the listener one of the messages defined in theShellListenerinterface.- Parameters:
listener- the listener which should be notified- Throws:
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:
-
addToolTip
-
adjustTrim
void adjustTrim(int widthHint, int heightHint) Resize the shell based on the trim width and height. Trim width and height adjustments are read from '$HOME/.swt/trims.prefs' for each trim style. If such a file does not exist then the trim values are queried from GTK. Note that we are trying to resize the shell which is already open. Shell already has width and height, Which is either set by setSize()/setBounds() or size is calculated based on layout and content of the shell. Without setting bounds/layout shell won't display content which is created on it.- Parameters:
widthHint- Current width of the shell that is already open.heightHint- Current height of the shell that is already open.
-
bringToTop
void bringToTop(boolean force) -
center
void center() -
checkBorder
void checkBorder()- Overrides:
checkBorderin classControl
-
checkOpen
-
close
public void close()Requests that the window manager close the receiver in the same way it would be closed when the user clicks on the "close box" or performs some other platform specific key or mouse combination that indicates the window should be removed.- Throws:
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:
-
closeWidget
void closeWidget() -
computeTrimInPixels
- Overrides:
computeTrimInPixelsin classScrollable
-
createHandle
void createHandle(int index) - Overrides:
createHandlein classComposite
-
filterProc
long filterProc(long xEvent, long gdkEvent, long data2) - Overrides:
filterProcin classWidget
-
findBackgroundControl
Control findBackgroundControl()- Overrides:
findBackgroundControlin classControl
-
findDeferredControl
Composite findDeferredControl()- Overrides:
findDeferredControlin classComposite
-
getToolBar
Returns a ToolBar object representing the tool bar that can be shown in the receiver's trim. This will returnnullif the platform does not support tool bars that are not part of the content area of the shell, or if the Shell's style does not support having a tool bar.- Returns:
- a ToolBar object representing the Shell's tool bar, or
null. - Throws:
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.7
-
hasBorder
-
hookEvents
void hookEvents()- Overrides:
hookEventsin classComposite
-
isEnabled
public boolean isEnabled()Description copied from class:ControlReturnstrueif the receiver is enabled and all ancestors up to and including the receiver's nearest ancestor shell are enabled. Otherwise,falseis returned. A disabled control is typically not selectable from the user interface and draws with an inactive or "grayed" look. -
isUndecorated
boolean isUndecorated() -
isCustomResize
boolean isCustomResize()Determines whether a Shell has both SWT.RESIZE and SWT.ON_TOP set without SWT.NO_TRIM.- Returns:
- true if this Shell has both SWT.RESIZE and SWT.ON_TOP set without SWT.NO_TRIM, false otherwise.
-
isVisible
public boolean isVisible()Description copied from class:ControlReturnstrueif the receiver is visible and all ancestors up to and including the receiver's nearest ancestor shell are visible. Otherwise,falseis returned. -
isMappedToPopup
boolean isMappedToPopup()Determines whether a Shell's parent is a popup window. See bug 534554.- Returns:
- true if the parent of this Shell has style SWT.ON_TOP, false otherwise.
-
register
-
releaseParent
void releaseParent()- Overrides:
releaseParentin classControl
-
requestLayout
public void requestLayout()Description copied from class:ControlRequests that this control and all of its ancestors be repositioned by their layouts at the earliest opportunity. This should be invoked after modifying the control in order to inform any dependent layouts of the change.The control will not be repositioned synchronously. This method is fast-running and only marks the control for future participation in a deferred layout.
Invoking this method multiple times before the layout occurs is an inexpensive no-op.
- Overrides:
requestLayoutin classControl
-
topHandle
long topHandle()- Overrides:
topHandlein classScrollable
-
paintHandle
long paintHandle()- Overrides:
paintHandlein classControl
-
fixActiveShell
void fixActiveShell() -
fixShell
-
fixStyle
-
forceResize
void forceResize()- Overrides:
forceResizein classControl
-
forceResize
void forceResize(int width, int height) -
getAlpha
public int getAlpha()Returns the receiver's alpha value. The alpha value is between 0 (transparent) and 255 (opaque).- Returns:
- the alpha value
- Throws:
SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- Since:
- 3.4
-
getResizeMode
int getResizeMode(double x, double y) -
getFullScreen
public boolean getFullScreen()Returnstrueif the receiver is currently in fullscreen state, and false otherwise.- Returns:
- the fullscreen state
- Throws:
SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- Since:
- 3.4
-
getLocationInPixels
Point getLocationInPixels()- Overrides:
getLocationInPixelsin classControl
-
getMaximized
public boolean getMaximized()Description copied from class:DecorationsReturnstrueif the receiver is currently maximized, and false otherwise.- Overrides:
getMaximizedin classDecorations- Returns:
- the maximized state
- See Also:
-
getMinimumSize
Returns a point describing the minimum receiver's size. The x coordinate of the result is the minimum width of the receiver. The y coordinate of the result is the minimum height of the receiver.- Returns:
- the receiver's size
- Throws:
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.1
-
getMaximumSize
Returns a point describing the maximum receiver's size. The x coordinate of the result is the maximum width of the receiver. The y coordinate of the result is the maximum height of the receiver.- Returns:
- the receiver's size
- Throws:
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.116
-
getModalShell
Shell getModalShell() -
getModified
public boolean getModified()Gets the receiver's modified state.- Returns:
trueif the receiver is marked as modified, orfalseotherwise- Throws:
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.5
-
getSizeInPixels
Point getSizeInPixels()- Overrides:
getSizeInPixelsin classControl
-
getVisible
public boolean getVisible()Description copied from class:ControlReturnstrueif the receiver is visible, andfalseotherwise.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.
- Overrides:
getVisiblein classControl- Returns:
- the receiver's visibility state
-
getRegion
Returns the region that defines the shape of the shell, ornullif the shell has the default shape.- Overrides:
getRegionin classControl- Returns:
- the region that defines the shape of the shell, or
null - Throws:
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.0
-
getImeInputMode
public int getImeInputMode()Returns the receiver's input method editor mode. This will be the result of bitwise OR'ing together one or more of the following constants defined in classSWT:NONE,ROMAN,DBCS,PHONETIC,NATIVE,ALPHA.- Returns:
- the IME mode
- Throws:
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:
-
_getShell
-
getShells
Returns an array containing all shells which are descendants of the receiver.- Returns:
- the dialog shells
- Throws:
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_event
long gtk_button_press_event(long widget, long event) - Overrides:
gtk_button_press_eventin classCanvas
-
gtk_configure_event
long gtk_configure_event(long widget, long event) - Overrides:
gtk_configure_eventin classWidget
-
gtk_close_request
long gtk_close_request(long widget) - Overrides:
gtk_close_requestin classWidget
-
gtk_delete_event
long gtk_delete_event(long widget, long event) - Overrides:
gtk_delete_eventin classWidget
-
gtk_enter_notify_event
long gtk_enter_notify_event(long widget, long event) - Overrides:
gtk_enter_notify_eventin classControl
-
gtk_draw
-
gtk_focus
-
gtk_focus_in_event
long gtk_focus_in_event(long widget, long event) - Overrides:
gtk_focus_in_eventin classCanvas
-
gtk_focus_out_event
long gtk_focus_out_event(long widget, long event) - Overrides:
gtk_focus_out_eventin classCanvas
-
gtk_leave_notify_event
long gtk_leave_notify_event(long widget, long event) - Overrides:
gtk_leave_notify_eventin classControl
-
gtk_map
-
gtk_move_focus
long gtk_move_focus(long widget, long directionType) - Overrides:
gtk_move_focusin classWidget
-
gtk_motion_notify_event
long gtk_motion_notify_event(long widget, long event) - Overrides:
gtk_motion_notify_eventin classControl
-
gtk3_key_press_event
long gtk3_key_press_event(long widget, long event) - Overrides:
gtk3_key_press_eventin classComposite
-
gtk_size_allocate
long gtk_size_allocate(long widget, long allocation) - Overrides:
gtk_size_allocatein classWidget
-
updateDecorations
private void updateDecorations(long gdkResource) -
gtk_realize
long gtk_realize(long widget) - Overrides:
gtk_realizein classComposite
-
gtk_window_state_event
long gtk_window_state_event(long widget, long event) - Overrides:
gtk_window_state_eventin classWidget
-
notifyState
long notifyState(long object, long arg0) - Overrides:
notifyStatein classWidget
-
open
public void open()Moves the receiver to the top of the drawing order for the display on which it was created (so that all other shells on that display, which are not the receiver's children will be drawn behind it), marks it visible, sets the focus and asks the window manager to make the shell active.- Throws:
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:
-
print
-
removeShellListener
Removes the listener from the collection of listeners who will be notified when operations are performed on the receiver.- Parameters:
listener- the listener which should no longer be notified- Throws:
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:
-
removeTooTip
-
reskinChildren
void reskinChildren(int flags) - Overrides:
reskinChildrenin classDecorations
-
setActive
public void setActive()If the receiver is visible, moves it to the top of the drawing order for the display on which it was created (so that all other shells on that display, which are not the receiver's children will be drawn behind it) and asks the window manager to make the shell active- Throws:
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:
- 2.0
- See Also:
-
setActiveControl
-
setActiveControl
-
setAlpha
public void setAlpha(int alpha) Sets the receiver's alpha value which must be between 0 (transparent) and 255 (opaque).This operation requires the operating system's advanced widgets subsystem which may not be available on some platforms.
- Parameters:
alpha- the alpha value- Throws:
SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- Since:
- 3.4
-
resizeBounds
void resizeBounds(int width, int height, boolean notify) -
setBounds
-
setCursor
-
setEnabled
public void setEnabled(boolean enabled) Description copied from class:ControlEnables the receiver if the argument istrue, and disables it otherwise. A disabled control is typically not selectable from the user interface and draws with an inactive or "grayed" look.- Overrides:
setEnabledin classControl- Parameters:
enabled- the new enabled state
-
setFullScreen
public void setFullScreen(boolean fullScreen) Sets the full screen state of the receiver. If the argument istruecauses the receiver to switch to the full screen state, and if the argument isfalseand the receiver was previously switched into full screen state, causes the receiver to switch back to either the maximized or normal states.Note: The result of intermixing calls to
setFullScreen(true),setMaximized(true),setMinimized(true)andsetMaximumSizewill vary by platform. Typically, the behavior will match the platform user's expectations, but not always. This should be avoided if possible.- Parameters:
fullScreen- the new fullscreen state- Throws:
SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- Since:
- 3.4
-
setImeInputMode
public void setImeInputMode(int mode) Sets the input method editor mode to the argument which should be the result of bitwise OR'ing together one or more of the following constants defined in classSWT:NONE,ROMAN,DBCS,PHONETIC,NATIVE,ALPHA.- Parameters:
mode- the new IME mode- Throws:
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:
-
setInitialBounds
void setInitialBounds()- Overrides:
setInitialBoundsin classControl
-
setMaximized
public void setMaximized(boolean maximized) Description copied from class:DecorationsSets the maximized state of the receiver. If the argument istruecauses the receiver to switch to the maximized state, and if the argument isfalseand the receiver was previously maximized, causes the receiver to switch back to either the minimized or normal states.Note: The result of intermixing calls to
setMaximized(true)andsetMinimized(true)will vary by platform. Typically, the behavior will match the platform user's expectations, but not always. This should be avoided if possible.- Overrides:
setMaximizedin classDecorations- Parameters:
maximized- the new maximized state- See Also:
-
setMenuBar
Description copied from class:DecorationsSets the receiver's menu bar to the argument, which may be null.- Overrides:
setMenuBarin classDecorations- Parameters:
menu- the new menu bar
-
setMinimized
public void setMinimized(boolean minimized) Description copied from class:DecorationsSets the minimized stated of the receiver. If the argument istruecauses the receiver to switch to the minimized state, and if the argument isfalseand the receiver was previously minimized, causes the receiver to switch back to either the maximized or normal states.Note: The result of intermixing calls to
setMaximized(true)andsetMinimized(true)will vary by platform. Typically, the behavior will match the platform user's expectations, but not always. This should be avoided if possible.- Overrides:
setMinimizedin classDecorations- Parameters:
minimized- the new minimized state- See Also:
-
setMinimumSize
public void setMinimumSize(int width, int height) Sets the receiver's minimum size to the size specified by the arguments. If the new minimum size is larger than the current size of the receiver, the receiver is resized to the new minimum size.- Parameters:
width- the new minimum width for the receiverheight- the new minimum height for the receiver- Throws:
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.1
-
setMinimumSize
Sets the receiver's minimum size to the size specified by the argument. If the new minimum size is larger than the current size of the receiver, the receiver is resized to the new minimum size.- Parameters:
size- the new minimum size for the receiver- Throws:
IllegalArgumentException-- ERROR_NULL_ARGUMENT - if the point 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
- Since:
- 3.1
-
setMaximumSize
public void setMaximumSize(int width, int height) Sets the receiver's maximum size to the size specified by the arguments. If the new maximum size is smaller than the current size of the receiver, the receiver is resized to the new maximum size.Note: The result of intermixing calls to
setMaximumSizeandsetFullScreen(true)will vary by platform. Typically, the behavior will match the platform user's expectations, but not always. This should be avoided if possible.- Parameters:
width- the new maximum width for the receiverheight- the new maximum height for the receiver- Throws:
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.116
-
setMaximumSize
Sets the receiver's maximum size to the size specified by the argument. If the new maximum size is smaller than the current size of the receiver, the receiver is resized to the new maximum size.Note: The result of intermixing calls to
setMaximumSizeandsetFullScreen(true)will vary by platform. Typically, the behavior will match the platform user's expectations, but not always. This should be avoided if possible.- Parameters:
size- the new maximum size for the receiver- Throws:
IllegalArgumentException-- ERROR_NULL_ARGUMENT - if the point 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
- Since:
- 3.116
-
setModified
public void setModified(boolean modified) Sets the receiver's modified state as specified by the argument.- Parameters:
modified- the new modified state for the receiver- Throws:
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.5
-
setRegion
Sets the shape of the shell to the region specified by the argument. When the argument is null, the default shape of the shell is restored. The shell must be created with the style SWT.NO_TRIM in order to specify a region.NOTE: This method also sets the size of the shell. Clients should not call
Control.setSize(Point)orsetBounds(int, int, int, int, boolean, boolean)on this shell. Furthermore, the passed region should not be modified any more.- Overrides:
setRegionin classControl- Parameters:
region- the region that defines the shape of the shell (or null)- Throws:
IllegalArgumentException-- ERROR_INVALID_ARGUMENT - if the region has been disposed
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.0
-
gdk_region_get_rectangles
static void gdk_region_get_rectangles(long region, long[] rectangles, int[] n_rectangles) -
mirrorRegion
-
setRelations
void setRelations()- Overrides:
setRelationsin classControl
-
setText
Description copied from class:DecorationsSets the receiver's text, which is the string that the window manager will typically display as the receiver's title, to the argument, which must not be null.Note: If control characters like '\n', '\t' etc. are used in the string, then the behavior is platform dependent.
- Overrides:
setTextin classDecorations- Parameters:
string- the new text
-
setVisible
public void setVisible(boolean visible) Description copied from class:ControlMarks the receiver as visible if the argument istrue, 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.
- Overrides:
setVisiblein classControl- Parameters:
visible- the new visibility state
-
setZOrder
-
shellMapProc
long shellMapProc(long handle, long arg0, long user_data) - Overrides:
shellMapProcin classWidget
-
showWidget
void showWidget()- Overrides:
showWidgetin classComposite
-
sizeAllocateProc
long sizeAllocateProc(long handle, long arg0, long user_data) - Overrides:
sizeAllocateProcin classWidget
-
sizeRequestProc
long sizeRequestProc(long handle, long arg0, long user_data) - Overrides:
sizeRequestProcin classWidget
-
traverseEscape
boolean traverseEscape()- Overrides:
traverseEscapein classControl
-
trimHeight
int trimHeight() -
trimWidth
int trimWidth() -
updateModal
void updateModal() -
updateMinimized
void updateMinimized(boolean minimized) -
deregister
void deregister()- Overrides:
deregisterin classComposite
-
requiresUngrab
boolean requiresUngrab() -
checkAndUngrabFocus
void checkAndUngrabFocus()SWT.ON_TOP shells on Wayland requires gdk_seat_grab to grab keyboard/input focus, the grabbed focus need to be removed when Shell is disposed/hidden. -
dispose
public void dispose()Description copied from class:WidgetDisposes of the operating system resources associated with the receiver and all its descendants. After this method has been invoked, the receiver and all descendants will answertruewhen sent the messageisDisposed(). Any internal connections between the widgets in the tree will have been removed to facilitate garbage collection. This method does nothing if the widget is already disposed.NOTE: This method is not called recursively on the descendants of the receiver. This means that, widget implementers can not detect when a widget is being disposed of by re-implementing this method, but should instead listen for the
Disposeevent. -
forceActive
public void forceActive()If the receiver is visible, moves it to the top of the drawing order for the display on which it was created (so that all other shells on that display, which are not the receiver's children will be drawn behind it) and forces the window manager to make the shell active.- Throws:
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:
- 2.0
- See Also:
-
getBoundsInPixels
Rectangle getBoundsInPixels()- Overrides:
getBoundsInPixelsin classControl
-
releaseHandle
void releaseHandle()- Overrides:
releaseHandlein classDecorations
-
releaseChildren
void releaseChildren(boolean destroy) - Overrides:
releaseChildrenin classDecorations
-
releaseWidget
void releaseWidget()- Overrides:
releaseWidgetin classDecorations
-
getWindowOrigin
Point getWindowOrigin()Description copied from class:ControlGets the position of the top left corner of the control in root window (display) coordinates. GTK3 only, do not call on GTK4.- Overrides:
getWindowOriginin classControl- Returns:
- the origin
-
getSurfaceOrigin
Point getSurfaceOrigin()Description copied from class:ControlGets the position of the top left corner of the control in root window (display) coordinates. GTK4 only, do not call on GTK3.- Overrides:
getSurfaceOriginin classControl- Returns:
- the origin
-