Instances of this class represent the "windows"
which the desktop or "window manager" is managing.
Instances that do not have a parent (that is, they
are built using the constructor, which takes a
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.

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.

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.

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.

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

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.

Constructor Detail

Shell

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 calling 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.

Shell

Constructs a new instance of this class given only the display
to create it on. It is created with style 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.

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

Shell

Constructs a new instance of this class given only its
parent. It is created with style 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.

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

Method Detail

win32_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 shell

handle - the handle for the shell

Returns:

a new shell object containing the specified display and handle

Restriction:

This method is not intended to be referenced by clients.

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.

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.

dispose

Disposes 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 answer
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.

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.

ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver

Since:

3.4

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 class
SWT:
NONE, ROMAN, DBCS,
PHONETIC, NATIVE, ALPHA.

getToolBar

Returns a ToolBar object representing the tool bar that can be shown in the receiver's
trim. This will return 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.

isEnabled

Returns 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.

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.

requestLayout

Requests 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.

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

setFullScreen

public void setFullScreen(boolean fullScreen)

Sets the full screen state of the receiver.
If the argument is 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.

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 class SWT:
NONE, ROMAN, DBCS,
PHONETIC, NATIVE, ALPHA.

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.