|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.swt.widgets.Widget
org.eclipse.swt.widgets.Control
org.eclipse.swt.widgets.Scrollable
org.eclipse.swt.widgets.Composite
org.eclipse.swt.widgets.Canvas
org.eclipse.swt.widgets.Decorations
public class Decorations
Instances of this class provide the appearance and
behavior of Shells
, but are not top
level shells or dialogs. Class Shell
shares a significant amount of code with this class,
and is a subclass.
IMPORTANT: This class was intended to be abstract and
should never be referenced or instantiated.
Instead, the class Shell
should be used.
Instances are always displayed in one of the maximized, minimized or normal states:
RESIZE
) until it is
no longer maximized.
SWT
provides two "convenience constants"
for the most commonly required style combinations:
SHELL_TRIM
CLOSE | TITLE | MIN | MAX | RESIZE
)
DIALOG_TRIM
TITLE | CLOSE | BORDER
)
IMPORTANT: This class is intended to be subclassed only within the SWT implementation.
getMinimized()
,
getMaximized()
,
Shell
,
SWT
Field Summary |
---|
Fields inherited from class org.eclipse.swt.widgets.Control |
---|
enableTraverse, internal_parent |
Fields inherited from class org.eclipse.swt.widgets.Widget |
---|
internal_handle, internal_style |
Constructor Summary | |
---|---|
Decorations(Composite parent,
int style)
Constructs a new instance of this class given its parent and a style value describing its behavior and appearance. |
Method Summary | |
---|---|
Button |
getDefaultButton()
Returns the receiver's default button if one had previously been set, otherwise returns null. |
Image |
getImage()
Returns the receiver's image if it had previously been set using setImage() . |
boolean |
getMaximized()
Returns true if the receiver is currently
maximized, and false otherwise. |
Menu |
getMenuBar()
Returns the receiver's menu bar if one had previously been set, otherwise returns null. |
boolean |
getMinimized()
Returns true if the receiver is currently
minimized, and false otherwise. |
java.lang.String |
getText()
Returns the receiver's text, which is the string that the window manager will typically display as the receiver's title. |
protected int |
internal_getNativeStyle()
|
boolean |
isReparentable()
Returns true if the underlying operating
system supports this reparenting, otherwise false |
void |
setBounds(int x,
int y,
int width,
int height)
Sets the receiver's size and location to the rectangular area specified by the arguments. |
void |
setDefaultButton(Button button)
If the argument is not null, sets the receiver's default button to the argument, and if the argument is null, sets the receiver's default button to the first button which was set as the receiver's default button (called the saved default button). |
void |
setImage(Image image)
Sets the receiver's image to the argument, which may be null. |
void |
setLocation(int x,
int y)
Sets the receiver's location to the point specified by the arguments which are relative to the receiver's parent (or its display if its parent is null), unless the receiver is a shell. |
void |
setMaximized(boolean maximized)
Sets the maximized state of the receiver. |
void |
setMenuBar(Menu menu)
Sets the receiver's menu bar to the argument, which may be null. |
void |
setMinimized(boolean minimized)
Sets the minimized stated of the receiver. |
void |
setText(java.lang.String string)
Sets 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. |
Methods inherited from class org.eclipse.swt.widgets.Canvas |
---|
removeInternalFilter, scroll, traverse |
Methods inherited from class org.eclipse.swt.widgets.Composite |
---|
allowTraverseByArrowKey, checkSubclass, computeSize, getChildren, getLayout, getTabList, internal_createHandle, internal_removeChild, layout, layout, setFocus, setLayout, setSize, setTabList, traverse |
Methods inherited from class org.eclipse.swt.widgets.Scrollable |
---|
computeTrim, getClientArea, getHorizontalBar, getVerticalBar |
Methods inherited from class org.eclipse.swt.widgets.Widget |
---|
addDisposeListener, addListener, checkWidget, getData, getData, getDisplay, getStyle, internal_sendEvent, isDisposed, isListening, notifyListeners, removeDisposeListener, removeListener, removeListener, sendEvent, setData, setData, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Decorations(Composite 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.
parent
- a composite control which will be the parent of the new instance (cannot be null)style
- the style of control to construct
java.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
,
Widget.checkSubclass()
,
Widget.getStyle()
Method Detail |
---|
public Button getDefaultButton()
SWTException
- setDefaultButton(org.eclipse.swt.widgets.Button)
public Image getImage()
setImage()
. The image is typically
displayed by the window manager when the instance is
marked as iconified, and may also be displayed somewhere
in the trim when the instance is in normal or maximized
states.
Note: This method will return null if called before
setImage()
is called. It does not provide
access to a window manager provided, "default" image
even if one exists.
SWTException
- public boolean getMaximized()
true
if the receiver is currently
maximized, and false otherwise.
SWTException
- setMaximized(boolean)
public Menu getMenuBar()
SWTException
- public boolean getMinimized()
true
if the receiver is currently
minimized, and false otherwise.
SWTException
- setMinimized(boolean)
protected int internal_getNativeStyle()
internal_getNativeStyle
in class Composite
public java.lang.String getText()
SWTException
- public boolean isReparentable()
Control
true
if the underlying operating
system supports this reparenting, otherwise false
isReparentable
in class Control
true
if the widget can be reparented, otherwise false
public void setDefaultButton(Button button)
The default button is the button that is selected when the receiver is active and the user presses ENTER.
button
- the new default button
java.lang.IllegalArgumentException
- SWTException
- public void setImage(Image image)
image
- the new image (or null)
java.lang.IllegalArgumentException
- SWTException
- public void setMaximized(boolean maximized)
true
causes the receiver
to switch to the maximized state, and if the argument is
false
and 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)
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.
maximized
- the new maximized state
SWTException
- setMinimized(boolean)
public void setMenuBar(Menu menu)
menu
- the new menu bar
java.lang.IllegalArgumentException
- SWTException
- public void setMinimized(boolean minimized)
true
causes the receiver
to switch to the minimized state, and if the argument is
false
and 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)
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.
minimized
- the new maximized state
SWTException
- setMaximized(boolean)
public void setText(java.lang.String string)
string
- the new text
java.lang.IllegalArgumentException
- SWTException
- public void setBounds(int x, int y, int width, int height)
Control
x
and
y
arguments are relative to the receiver's
parent (or its display if its parent is null), unless
the receiver is a shell. In this case, the x
and y
arguments are relative to the display.
Note: Attempting to set the width or height of the receiver to a negative number will cause that value to be set to zero instead.
setBounds
in class Composite
x
- the new x coordinate for the receivery
- the new y coordinate for the receiverwidth
- the new width for the receiverheight
- the new height for the receiverpublic void setLocation(int x, int y)
Control
setLocation
in class Control
x
- the new x coordinate for the receivery
- the new y coordinate for the receiver
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |