public class Shell extends Decorations
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:
RESIZE
) until it is
no longer maximized.
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
.
SWT
provides two "convenience constants"
for the most commonly required style combinations:
SHELL_TRIM
CLOSE | TITLE | MIN | MAX | RESIZE
)
DIALOG_TRIM
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.
Modifier and Type | Field and Description |
---|---|
(package private) Menu |
activeMenu |
(package private) int |
balloonIcon |
(package private) int |
balloonTipHandle |
(package private) java.lang.String |
balloonTitle |
(package private) int[] |
brushes |
(package private) static int |
BRUSHES_SIZE |
(package private) boolean |
center |
(package private) static TCHAR |
DialogClass |
(package private) static int |
DialogProc |
(package private) boolean |
fullScreen |
(package private) int |
hIMC |
(package private) int |
hwndMDIClient |
(package private) Control |
lastActive |
(package private) int |
lpstrTip |
(package private) int |
minHeight |
(package private) int |
minWidth |
(package private) boolean |
modified |
(package private) SHACTIVATEINFO |
psai |
(package private) boolean |
showWithParent |
(package private) static int[] |
SYSTEM_COLORS |
(package private) int |
toolIcon |
(package private) int |
toolTipHandle |
(package private) static int |
ToolTipProc |
(package private) ToolTip[] |
toolTips |
(package private) java.lang.String |
toolTitle |
(package private) boolean |
wasMaximized |
(package private) int |
windowProc |
defaultButton, hAccel, image, images, largeImage, maxRect, menuBar, menus, moved, nAccel, oldHeight, oldWidth, oldX, oldY, opened, resized, saveDefault, savedFocus, smallImage, swFlags
backgroundMode, layout, layoutCount, lpwp, tabList
horizontalBar, verticalBar
accessible, background, backgroundImage, cursor, drawCount, font, foreground, handle, layoutData, menu, parent, region, toolTipText
CANVAS, data, DEFAULT_HEIGHT, DEFAULT_WIDTH, DISABLED, display, DISPOSE_SENT, DISPOSED, DRAG_DETECT, DRAW_BACKGROUND, eventTable, FOREIGN_HANDLE, HIDDEN, IGNORE_WM_CHANGEUISTATE, KEYED_DATA, LAYOUT_CHANGED, LAYOUT_CHILD, LAYOUT_NEEDED, MAJOR, MINOR, MOVE_DEFERRED, MOVE_OCCURRED, PARENT_BACKGROUND, RELEASED, RESIZE_DEFERRED, RESIZE_OCCURRED, SKIN_NEEDED, state, style, THEME_BACKGROUND, TRACK_MOUSE
Constructor and Description |
---|
Shell()
Constructs a new instance of this class.
|
Shell(Display display)
Constructs a new instance of this class given only the display
to create it on.
|
Shell(Display display,
int style)
Constructs a new instance of this class given the display
to create it on and a style value describing its behavior
and appearance.
|
Shell(Display display,
Shell parent,
int style,
int handle,
boolean embedded) |
Shell(int style)
Constructs a new instance of this class given only the style
value describing its behavior and appearance.
|
Shell(Shell parent)
Constructs a new instance of this class given only its
parent.
|
Shell(Shell parent,
int style)
Constructs a new instance of this class given its parent
and a style value describing its behavior and appearance.
|
Modifier and Type | Method and Description |
---|---|
void |
addShellListener(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 the
ShellListener interface. |
(package private) int |
balloonTipHandle() |
(package private) int |
callWindowProc(int hwnd,
int msg,
int wParam,
int lParam) |
(package private) void |
center() |
(package private) static int |
checkStyle(Shell parent,
int style) |
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.
|
(package private) void |
createBalloonTipHandle() |
(package private) void |
createHandle() |
(package private) void |
createToolTip(ToolTip toolTip) |
(package private) void |
createToolTipHandle() |
(package private) void |
deregister() |
(package private) void |
destroyToolTip(ToolTip toolTip) |
(package private) void |
destroyWidget()
Destroys the widget in the operating system and releases
the widget's handle.
|
void |
dispose()
Disposes of the operating system resources associated with
the receiver and all its descendants.
|
(package private) void |
enableWidget(boolean enabled) |
(package private) Control |
findBackgroundControl() |
(package private) int |
findBrush(int value,
int lbStyle) |
(package private) Cursor |
findCursor() |
(package private) Composite |
findDeferredControl() |
(package private) Control |
findThemeControl() |
(package private) ToolTip |
findToolTip(int id) |
(package private) void |
fixActiveShell() |
(package private) void |
fixShell(Shell newShell,
Control control) |
(package private) void |
fixToolTip() |
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.
|
(package private) void |
forceResize() |
int |
getAlpha()
Returns the receiver's alpha value.
|
Rectangle |
getBounds()
Returns a rectangle describing the receiver's size and location
relative to its parent (or its display if its parent is null),
unless the receiver is a shell.
|
(package private) ToolTip |
getCurrentToolTip() |
(package private) ToolTip |
getCurrentToolTip(int hwndToolTip) |
boolean |
getEnabled()
Returns
true if the receiver is enabled, and
false otherwise. |
boolean |
getFullScreen()
Returns
true if the receiver is currently
in fullscreen state, and false otherwise. |
int |
getImeInputMode()
Returns the receiver's input method editor mode.
|
Point |
getLocation()
Returns a point describing the receiver's location relative
to its parent (or its display if its parent is null), unless
the receiver is a shell.
|
boolean |
getMaximized()
Returns
true if the receiver is currently
maximized, and false otherwise. |
Point |
getMinimumSize()
Returns a point describing the minimum receiver's size.
|
boolean |
getModified()
Gets the receiver's modified state.
|
Region |
getRegion()
Returns the region that defines the shape of the shell,
or
null if the shell has the default shape. |
Shell |
getShell()
Returns the receiver's shell.
|
Shell[] |
getShells()
Returns an array containing all shells which are
descendants of the receiver.
|
Point |
getSize()
Returns a point describing the receiver's size.
|
ToolBar |
getToolBar()
Returns a ToolBar object representing the tool bar that can be shown in the receiver's
trim.
|
(package private) int |
hwndMDIClient() |
static Shell |
internal_new(Display display,
int handle)
Invokes platform specific functionality to allocate a new shell
that is not embedded.
|
boolean |
isEnabled()
Returns
true if the receiver is enabled and all
ancestors up to and including the receiver's nearest ancestor
shell are enabled. |
boolean |
isVisible()
Returns
true if the receiver is visible and all
ancestors up to and including the receiver's nearest ancestor
shell are visible. |
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.
|
boolean |
print(GC gc)
Prints the receiver and all children.
|
(package private) void |
register() |
(package private) void |
releaseBrushes() |
(package private) void |
releaseChildren(boolean destroy) |
(package private) void |
releaseHandle() |
(package private) void |
releaseParent() |
(package private) void |
releaseWidget() |
(package private) void |
removeMenu(Menu menu) |
void |
removeShellListener(ShellListener listener)
Removes the listener from the collection of listeners who will
be notified when operations are performed on the receiver.
|
(package private) void |
reskinChildren(int flags) |
(package private) LRESULT |
selectPalette(int hPalette) |
(package private) boolean |
sendKeyEvent(int type,
int msg,
int wParam,
int lParam,
Event event) |
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
|
(package private) void |
setActiveControl(Control control) |
void |
setAlpha(int alpha)
Sets the receiver's alpha value which must be
between 0 (transparent) and 255 (opaque).
|
(package private) void |
setBounds(int x,
int y,
int width,
int height,
int flags,
boolean defer) |
void |
setEnabled(boolean enabled)
Enables the receiver if the argument is
true ,
and disables it otherwise. |
void |
setFullScreen(boolean fullScreen)
Sets the full screen state of the receiver.
|
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 class
SWT :
NONE , ROMAN , DBCS ,
PHONETIC , NATIVE , ALPHA . |
(package private) void |
setItemEnabled(int cmd,
boolean enabled) |
void |
setMinimumSize(int width,
int height)
Sets the receiver's minimum size to the size specified by the arguments.
|
void |
setMinimumSize(Point size)
Sets the receiver's minimum size to the size specified by the argument.
|
void |
setModified(boolean modified)
Sets the receiver's modified state as specified by the argument.
|
(package private) void |
setParent() |
void |
setRegion(Region region)
Sets the shape of the shell to the region specified
by the argument.
|
(package private) void |
setToolTipText(int hwnd,
java.lang.String text) |
(package private) void |
setToolTipText(NMTTDISPINFO lpnmtdi,
byte[] buffer) |
(package private) void |
setToolTipText(NMTTDISPINFO lpnmtdi,
char[] buffer) |
(package private) void |
setToolTipTitle(int hwndToolTip,
java.lang.String text,
int icon) |
void |
setVisible(boolean visible)
Marks the receiver as visible if the argument is
true ,
and marks it invisible otherwise. |
(package private) void |
subclass() |
(package private) int |
toolTipHandle() |
(package private) boolean |
translateAccelerator(MSG msg) |
(package private) boolean |
traverseEscape() |
(package private) void |
unsubclass() |
(package private) void |
updateModal() |
(package private) CREATESTRUCT |
widgetCreateStruct() |
(package private) int |
widgetExtStyle() |
(package private) int |
widgetParent() |
(package private) int |
widgetStyle() |
static Shell |
win32_new(Display display,
int handle)
Invokes platform specific functionality to allocate a new shell
that is embedded.
|
(package private) TCHAR |
windowClass() |
(package private) int |
windowProc() |
(package private) int |
windowProc(int hwnd,
int msg,
int wParam,
int lParam) |
(package private) LRESULT |
WM_ACTIVATE(int wParam,
int lParam) |
(package private) LRESULT |
WM_COMMAND(int wParam,
int lParam) |
(package private) LRESULT |
WM_DESTROY(int wParam,
int lParam) |
(package private) LRESULT |
WM_ENTERIDLE(int wParam,
int lParam) |
(package private) LRESULT |
WM_ERASEBKGND(int wParam,
int lParam) |
(package private) LRESULT |
WM_GETMINMAXINFO(int wParam,
int lParam) |
(package private) LRESULT |
WM_MOUSEACTIVATE(int wParam,
int lParam) |
(package private) LRESULT |
WM_MOVE(int wParam,
int lParam) |
(package private) LRESULT |
WM_NCHITTEST(int wParam,
int lParam) |
(package private) LRESULT |
WM_NCLBUTTONDOWN(int wParam,
int lParam) |
(package private) LRESULT |
WM_PALETTECHANGED(int wParam,
int lParam) |
(package private) LRESULT |
WM_QUERYNEWPALETTE(int wParam,
int lParam) |
(package private) LRESULT |
WM_SETCURSOR(int wParam,
int lParam) |
(package private) LRESULT |
WM_SETTINGCHANGE(int wParam,
int lParam) |
(package private) LRESULT |
WM_SHOWWINDOW(int wParam,
int lParam) |
(package private) LRESULT |
WM_SYSCOMMAND(int wParam,
int lParam) |
(package private) LRESULT |
WM_WINDOWPOSCHANGING(int wParam,
int lParam) |
_setMaximized, _setMinimized, addMenu, bringToTop, checkBorder, checkComposited, checkOpened, checkStyle, checkSubclass, closeWidget, compare, computeTabGroup, computeTabRoot, computeTrim, createAccelerators, createWidget, destroyAccelerators, findMenu, fixDecorations, getClientArea, getDefaultButton, getImage, getImages, getMenuBar, getMinimized, getNameText, getText, isReparentable, isTabGroup, isTabItem, menuShell, restoreFocus, saveFocus, setDefaultButton, setDefaultButton, setImage, setImages, setImages, setMaximized, setMenuBar, setMinimized, setOrientation, setPlacement, setSavedFocus, setSystemMenu, setText, sort, translateMDIAccelerator, translateMenuAccelerator, traverseDecorations, traverseItem, traverseReturn, WM_CLOSE, WM_HOTKEY, WM_KILLFOCUS, WM_NCACTIVATE, WM_QUERYOPEN, WM_SETFOCUS, WM_SIZE
clearArea, drawBackground, getCaret, getIME, scroll, setCaret, setFont, setIME, WM_CHAR, WM_IME_COMPOSITION_START, WM_IME_COMPOSITION, WM_IME_ENDCOMPOSITION, WM_INPUTLANGCHANGE, WM_LBUTTONDOWN, WM_WINDOWPOSCHANGED
_getChildren, _getTabList, changed, checkBuffered, checkComposited, computeSize, computeTabList, copyArea, drawBackground, findMenus, fixChildren, fixTabList, getBackgroundMode, getChildren, getChildrenCount, getLayout, getLayoutDeferred, getTabList, hooksKeys, isLayoutDeferred, layout, layout, layout, layout, layout, markLayout, minimumSize, redrawChildren, removeControl, resizeChildren, resizeChildren, resizeEmbeddedHandle, sendResize, setBackgroundMode, setFocus, setLayout, setLayoutDeferred, setResizeChildren, setTabGroupFocus, setTabList, toolTipText, translateMnemonic, translateTraversal, updateBackgroundColor, updateBackgroundImage, updateBackgroundMode, updateFont, updateLayout, updateLayout, updateOrientation, updateUIState, WM_GETDLGCODE, WM_GETFONT, WM_PAINT, WM_PARENTNOTIFY, WM_PRINTCLIENT, WM_SETFONT, WM_SYSCOLORCHANGE, WM_UPDATEUISTATE, wmNCPaint, wmNotify
createScrollBar, destroyScrollBar, getHorizontalBar, getScrollbarsMode, getVerticalBar, scrolledHandle, WM_HSCROLL, WM_MOUSEWHEEL, WM_VSCROLL, wmScroll, wmScrollWheel
addControlListener, addDragDetectListener, addFocusListener, addGestureListener, addHelpListener, addKeyListener, addMenuDetectListener, addMouseListener, addMouseMoveListener, addMouseTrackListener, addMouseWheelListener, addPaintListener, addTouchListener, addTraverseListener, binarySearch, borderHandle, checkBackground, checkGesture, checkHandle, checkMirrored, computeSize, defaultBackground, defaultFont, defaultForeground, dragDetect, dragDetect, dragDetect, drawBackground, drawBackground, drawBackground, drawImageBackground, drawThemeBackground, enableDrag, fillBackground, fillImageBackground, fillThemeBackground, findImageControl, findMnemonic, fixFocus, forceFocus, getAccessible, getBackground, getBackgroundImage, getBackgroundPixel, getBorderWidth, getClipboardText, getCodePage, getCursor, getDragDetect, getDrawing, getFont, getForeground, getForegroundPixel, getLayoutData, getMenu, getMonitor, getOrientation, getParent, getPath, getToolTipText, getTouchEnabled, getVisible, hasCursor, hasFocus, internal_dispose_GC, internal_new_GC, isActive, isFocusAncestor, isFocusControl, isShowing, mapEvent, mnemonicHit, mnemonicMatch, moveAbove, moveBelow, new_Accessible, new_GC, pack, pack, printWidget, redraw, redraw, redraw, removeControlListener, removeDragDetectListener, removeFocusListener, removeGestureListener, removeHelpListener, removeKeyListener, removeMenuDetectListener, removeMouseListener, removeMouseMoveListener, removeMouseTrackListener, removeMouseWheelListener, removePaintListener, removeTouchListener, removeTraverseListener, sendFocusEvent, sendGestureEvent, sendMove, sendTouchEvent, setBackground, setBackground, setBackgroundImage, setBackgroundImage, setBackgroundPixel, setBounds, setBounds, setBounds, setCapture, setCursor, setCursor, setDefaultFont, setDragDetect, setForeground, setForegroundPixel, setLayoutData, setLocation, setLocation, setMenu, setParent, setRadioFocus, setRadioSelection, setRedraw, setSavedFocus, setSize, setSize, setTabItemFocus, setToolTipText, setToolTipText, setTouchEnabled, showWidget, sort, toControl, toControl, toDisplay, toDisplay, topHandle, translateMnemonic, traverse, traverse, traverse, traverse, traverse, traverseGroup, traverseMnemonic, traversePage, update, update, updateImages, WM_CAPTURECHANGED, WM_CHANGEUISTATE, WM_CLEAR, WM_CONTEXTMENU, WM_CTLCOLOR, WM_CUT, WM_DRAWITEM, WM_ENDSESSION, WM_GESTURE, WM_GETOBJECT, WM_HELP, WM_IME_CHAR, WM_INITMENUPOPUP, WM_KEYDOWN, WM_KEYUP, WM_LBUTTONDBLCLK, WM_LBUTTONUP, WM_MBUTTONDBLCLK, WM_MBUTTONDOWN, WM_MBUTTONUP, WM_MEASUREITEM, WM_MENUCHAR, WM_MENUSELECT, WM_MOUSEHOVER, WM_MOUSEHWHEEL, WM_MOUSELEAVE, WM_MOUSEMOVE, WM_NCCALCSIZE, WM_NCPAINT, WM_NOTIFY, WM_PASTE, WM_PRINT, WM_QUERYENDSESSION, WM_RBUTTONDBLCLK, WM_RBUTTONDOWN, WM_RBUTTONUP, WM_SETREDRAW, WM_SYSCHAR, WM_SYSKEYDOWN, WM_SYSKEYUP, WM_TABLET_FLICK, WM_TIMER, WM_TOUCH, WM_UNDO, WM_UNINITMENUPOPUP, WM_XBUTTONDBLCLK, WM_XBUTTONDOWN, WM_XBUTTONUP, wmColorChild, wmCommandChild, wmDrawChild, wmMeasureChild, wmNotifyChild, wmScrollChild
_addListener, addDisposeListener, addListener, checkBits, checkOrientation, checkParent, checkWidget, DeferWindowPos, dragDetect, error, filters, findItem, fixMnemonic, fixMnemonic, getData, getData, getDisplay, getListeners, getName, getStyle, hooks, isDisposed, isListening, isValidSubclass, isValidThread, notifyListeners, postEvent, postEvent, release, removeDisposeListener, removeListener, removeListener, reskin, reskinWidget, sendDragEvent, sendDragEvent, sendEvent, sendEvent, sendEvent, sendEvent, sendKeyEvent, sendMouseEvent, sendMouseEvent, sendMouseWheelEvent, sendSelectionEvent, sendSelectionEvent, setData, setData, setInputState, setKeyState, setLocationMask, SetWindowPos, showMenu, showMenu, toString, updateMenuLocation, wmCaptureChanged, wmChar, wmContextMenu, wmIMEChar, wmKeyDown, wmKeyUp, wmKillFocus, wmLButtonDblClk, wmLButtonDown, wmLButtonUp, wmMButtonDblClk, wmMButtonDown, wmMButtonUp, wmMouseHover, wmMouseHWheel, wmMouseLeave, wmMouseMove, wmMouseWheel, wmPaint, wmPrint, wmRButtonDblClk, wmRButtonDown, wmRButtonUp, wmSetFocus, wmSysChar, wmSysKeyDown, wmSysKeyUp, wmXButtonDblClk, wmXButtonDown, wmXButtonUp
Menu activeMenu
ToolTip[] toolTips
int hIMC
int hwndMDIClient
int lpstrTip
int toolTipHandle
int balloonTipHandle
int minWidth
int minHeight
int[] brushes
boolean showWithParent
boolean fullScreen
boolean wasMaximized
boolean modified
boolean center
java.lang.String toolTitle
java.lang.String balloonTitle
int toolIcon
int balloonIcon
int windowProc
Control lastActive
SHACTIVATEINFO psai
static int ToolTipProc
static final int DialogProc
static final TCHAR DialogClass
static final int[] SYSTEM_COLORS
static final int BRUSHES_SIZE
public Shell()
Shell((Display) null)
.SWTException
- public Shell(int style)
Shell((Display) null, style)
.
The style value is either one of the style constants defined in
class SWT
which is applicable to instances of this
class, or must be built by bitwise OR'ing together
(that is, using the int
"|" operator) two or more
of those SWT
style constants. The class description
lists the style constants that are applicable to the class.
Style bits are also inherited from superclasses.
style
- the style of control to constructSWTException
- SWT.BORDER
,
SWT.CLOSE
,
SWT.MIN
,
SWT.MAX
,
SWT.RESIZE
,
SWT.TITLE
,
SWT.TOOL
,
SWT.NO_TRIM
,
SWT.SHELL_TRIM
,
SWT.DIALOG_TRIM
,
SWT.ON_TOP
,
SWT.MODELESS
,
SWT.PRIMARY_MODAL
,
SWT.APPLICATION_MODAL
,
SWT.SYSTEM_MODAL
,
SWT.SHEET
public Shell(Display display)
SWT.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.
display
- the display to create the shell onSWTException
- public Shell(Display display, int style)
The style value is either one of the style constants defined in
class SWT
which is applicable to instances of this
class, or must be built by bitwise OR'ing together
(that is, using the int
"|" operator) two or more
of those SWT
style constants. The class description
lists the style constants that are applicable to the class.
Style bits are also inherited from superclasses.
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.
display
- the display to create the shell onstyle
- the style of control to constructSWTException
- SWT.BORDER
,
SWT.CLOSE
,
SWT.MIN
,
SWT.MAX
,
SWT.RESIZE
,
SWT.TITLE
,
SWT.TOOL
,
SWT.NO_TRIM
,
SWT.SHELL_TRIM
,
SWT.DIALOG_TRIM
,
SWT.ON_TOP
,
SWT.MODELESS
,
SWT.PRIMARY_MODAL
,
SWT.APPLICATION_MODAL
,
SWT.SYSTEM_MODAL
,
SWT.SHEET
public Shell(Shell parent)
SWT.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.
parent
- a shell which will be the parent of the new instancejava.lang.IllegalArgumentException
- SWTException
- public Shell(Shell parent, int style)
The style value is either one of the style constants defined in
class SWT
which is applicable to instances of this
class, or must be built by bitwise OR'ing together
(that is, using the int
"|" operator) two or more
of those SWT
style constants. The class description
lists the style constants that are applicable to the class.
Style bits are also inherited from superclasses.
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.
parent
- a shell which will be the parent of the new instancestyle
- the style of control to constructjava.lang.IllegalArgumentException
- SWTException
- SWT.BORDER
,
SWT.CLOSE
,
SWT.MIN
,
SWT.MAX
,
SWT.RESIZE
,
SWT.TITLE
,
SWT.NO_TRIM
,
SWT.SHELL_TRIM
,
SWT.DIALOG_TRIM
,
SWT.ON_TOP
,
SWT.TOOL
,
SWT.MODELESS
,
SWT.PRIMARY_MODAL
,
SWT.APPLICATION_MODAL
,
SWT.SYSTEM_MODAL
,
SWT.SHEET
public static Shell win32_new(Display display, int handle)
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.
display
- the display for the shellhandle
- the handle for the shellpublic static Shell internal_new(Display display, int handle)
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.
display
- the display for the shellhandle
- the handle for the shellstatic int checkStyle(Shell parent, int style)
public void addShellListener(ShellListener listener)
ShellListener
interface.listener
- the listener which should be notifiedjava.lang.IllegalArgumentException
- SWTException
- ShellListener
,
removeShellListener(org.eclipse.swt.events.ShellListener)
int balloonTipHandle()
int callWindowProc(int hwnd, int msg, int wParam, int lParam)
callWindowProc
in class Decorations
void center()
public void close()
SWTException
- SWT.Close
,
dispose()
void createBalloonTipHandle()
void createHandle()
createHandle
in class Decorations
void createToolTip(ToolTip toolTip)
void createToolTipHandle()
void deregister()
deregister
in class Control
void destroyToolTip(ToolTip toolTip)
void destroyWidget()
Widget
When a widget is destroyed in the operating system, its
descendants are also destroyed by the operating system.
This means that it is only necessary to call destroyWidget
on the root of the widget tree.
This method is called after releaseWidget()
.
See also releaseChild()
, releaseWidget()
and releaseHandle()
.
destroyWidget
in class Control
Widget.dispose()
public void dispose()
Widget
true
when sent the message isDisposed()
.
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 Dispose
event.
void enableWidget(boolean enabled)
enableWidget
in class Control
Control findBackgroundControl()
findBackgroundControl
in class Control
Cursor findCursor()
findCursor
in class Control
Control findThemeControl()
findThemeControl
in class Control
ToolTip findToolTip(int id)
void fixActiveShell()
void fixToolTip()
public void forceActive()
SWTException
- Control.moveAbove(org.eclipse.swt.widgets.Control)
,
Control.setFocus()
,
Control.setVisible(boolean)
,
Display.getActiveShell()
,
Decorations.setDefaultButton(Button)
,
open()
,
setActive()
void forceResize()
forceResize
in class Control
public int getAlpha()
SWTException
- public Rectangle getBounds()
Control
getBounds
in class Decorations
ToolTip getCurrentToolTip()
ToolTip getCurrentToolTip(int hwndToolTip)
public boolean getEnabled()
Control
true
if the receiver is enabled, and
false
otherwise. A disabled control is typically
not selectable from the user interface and draws with an
inactive or "grayed" look.getEnabled
in class Control
Control.isEnabled()
public boolean getFullScreen()
true
if the receiver is currently
in fullscreen state, and false otherwise.
SWTException
- public int getImeInputMode()
SWT
:
NONE
, ROMAN
, DBCS
,
PHONETIC
, NATIVE
, ALPHA
.SWTException
- SWT
public Point getLocation()
Control
getLocation
in class Decorations
public boolean getMaximized()
Decorations
true
if the receiver is currently
maximized, and false otherwise.
getMaximized
in class Decorations
Decorations.setMaximized(boolean)
public Point getMinimumSize()
SWTException
- public boolean getModified()
true
if the receiver is marked as modified, or false
otherwiseSWTException
- public Region getRegion()
null
if the shell has the default shape.getRegion
in class Control
null
SWTException
- public Shell getShell()
Control
getShell
in class Control
Control.getParent()
public Point getSize()
Control
getSize
in class Decorations
public Shell[] getShells()
SWTException
- public ToolBar getToolBar()
null
if 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.
SWTException
- Composite findDeferredControl()
findDeferredControl
in class Composite
public boolean isEnabled()
Control
true
if the receiver is enabled and all
ancestors up to and including the receiver's nearest ancestor
shell are enabled. Otherwise, false
is returned.
A disabled control is typically not selectable from the user
interface and draws with an inactive or "grayed" look.isEnabled
in class Control
Control.getEnabled()
public boolean isVisible()
Control
true
if the receiver is visible and all
ancestors up to and including the receiver's nearest ancestor
shell are visible. Otherwise, false
is returned.isVisible
in class Control
Control.getVisible()
int hwndMDIClient()
public void open()
SWTException
- Control.moveAbove(org.eclipse.swt.widgets.Control)
,
Control.setFocus()
,
Control.setVisible(boolean)
,
Display.getActiveShell()
,
Decorations.setDefaultButton(Button)
,
setActive()
,
forceActive()
public boolean print(GC gc)
Control
void releaseBrushes()
void releaseChildren(boolean destroy)
releaseChildren
in class Decorations
void releaseHandle()
releaseHandle
in class Control
void releaseParent()
releaseParent
in class Composite
void releaseWidget()
releaseWidget
in class Decorations
void removeMenu(Menu menu)
removeMenu
in class Decorations
public void removeShellListener(ShellListener listener)
listener
- the listener which should no longer be notifiedjava.lang.IllegalArgumentException
- SWTException
- ShellListener
,
addShellListener(org.eclipse.swt.events.ShellListener)
void reskinChildren(int flags)
reskinChildren
in class Decorations
LRESULT selectPalette(int hPalette)
boolean sendKeyEvent(int type, int msg, int wParam, int lParam, Event event)
sendKeyEvent
in class Widget
public void setActive()
SWTException
- Control.moveAbove(org.eclipse.swt.widgets.Control)
,
Control.setFocus()
,
Control.setVisible(boolean)
,
Display.getActiveShell()
,
Decorations.setDefaultButton(Button)
,
open()
,
setActive()
void setActiveControl(Control control)
public void setAlpha(int alpha)
This operation requires the operating system's advanced widgets subsystem which may not be available on some platforms.
alpha
- the alpha valueSWTException
- void setBounds(int x, int y, int width, int height, int flags, boolean defer)
setBounds
in class Decorations
public void setEnabled(boolean enabled)
Control
true
,
and disables it otherwise. A disabled control is typically
not selectable from the user interface and draws with an
inactive or "grayed" look.setEnabled
in class Control
enabled
- the new enabled statepublic void setFullScreen(boolean fullScreen)
true
causes the receiver
to switch to the full screen state, and if the argument is
false
and 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)
and setMinimized(true)
will
vary by platform. Typically, the behavior will match the platform user's
expectations, but not always. This should be avoided if possible.
fullScreen
- the new fullscreen stateSWTException
- public void setImeInputMode(int mode)
SWT
:
NONE
, ROMAN
, DBCS
,
PHONETIC
, NATIVE
, ALPHA
.mode
- the new IME modeSWTException
- SWT
public void setMinimumSize(int width, int height)
width
- the new minimum width for the receiverheight
- the new minimum height for the receiverSWTException
- public void setMinimumSize(Point size)
size
- the new minimum size for the receiverjava.lang.IllegalArgumentException
- SWTException
- public void setModified(boolean modified)
modified
- the new modified state for the receiver
SWTException
- void setItemEnabled(int cmd, boolean enabled)
void setParent()
setParent
in class Decorations
public void setRegion(Region region)
setRegion
in class Control
region
- the region that defines the shape of the shell (or null)java.lang.IllegalArgumentException
- SWTException
- void setToolTipText(int hwnd, java.lang.String text)
void setToolTipText(NMTTDISPINFO lpnmtdi, byte[] buffer)
void setToolTipText(NMTTDISPINFO lpnmtdi, char[] buffer)
void setToolTipTitle(int hwndToolTip, java.lang.String text, int icon)
public void setVisible(boolean visible)
Control
true
,
and marks it invisible otherwise.
If one of the receiver's ancestors is not visible or some other condition makes the receiver not visible, marking it visible may not actually cause it to be displayed.
setVisible
in class Decorations
visible
- the new visibility stateint toolTipHandle()
boolean translateAccelerator(MSG msg)
translateAccelerator
in class Decorations
boolean traverseEscape()
traverseEscape
in class Control
void unsubclass()
unsubclass
in class Control
void updateModal()
CREATESTRUCT widgetCreateStruct()
widgetCreateStruct
in class Decorations
int widgetParent()
widgetParent
in class Decorations
int widgetExtStyle()
widgetExtStyle
in class Decorations
TCHAR windowClass()
windowClass
in class Canvas
int windowProc()
windowProc
in class Scrollable
int windowProc(int hwnd, int msg, int wParam, int lParam)
windowProc
in class Decorations
int widgetStyle()
widgetStyle
in class Decorations
LRESULT WM_ACTIVATE(int wParam, int lParam)
WM_ACTIVATE
in class Decorations
LRESULT WM_COMMAND(int wParam, int lParam)
WM_COMMAND
in class Control
LRESULT WM_DESTROY(int wParam, int lParam)
WM_DESTROY
in class Control
LRESULT WM_ERASEBKGND(int wParam, int lParam)
WM_ERASEBKGND
in class Composite
LRESULT WM_ENTERIDLE(int wParam, int lParam)
WM_ENTERIDLE
in class Control
LRESULT WM_GETMINMAXINFO(int wParam, int lParam)
WM_GETMINMAXINFO
in class Control
LRESULT WM_MOUSEACTIVATE(int wParam, int lParam)
WM_MOUSEACTIVATE
in class Control
LRESULT WM_MOVE(int wParam, int lParam)
WM_MOVE
in class Decorations
LRESULT WM_NCHITTEST(int wParam, int lParam)
WM_NCHITTEST
in class Composite
LRESULT WM_NCLBUTTONDOWN(int wParam, int lParam)
WM_NCLBUTTONDOWN
in class Control
LRESULT WM_PALETTECHANGED(int wParam, int lParam)
WM_PALETTECHANGED
in class Control
LRESULT WM_QUERYNEWPALETTE(int wParam, int lParam)
WM_QUERYNEWPALETTE
in class Control
LRESULT WM_SETCURSOR(int wParam, int lParam)
WM_SETCURSOR
in class Control
LRESULT WM_SETTINGCHANGE(int wParam, int lParam)
WM_SETTINGCHANGE
in class Control
LRESULT WM_SHOWWINDOW(int wParam, int lParam)
WM_SHOWWINDOW
in class Control
LRESULT WM_SYSCOMMAND(int wParam, int lParam)
WM_SYSCOMMAND
in class Decorations
LRESULT WM_WINDOWPOSCHANGING(int wParam, int lParam)
WM_WINDOWPOSCHANGING
in class Decorations