|
|||||||||
| Home >> All >> org >> eclipse >> swt >> [ widgets overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
org.eclipse.swt.widgets
Class Decorations

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
- All Implemented Interfaces:
- org.eclipse.swt.graphics.Drawable
- Direct Known Subclasses:
- Shell
- public class Decorations
- extends Canvas
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:
-
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.
- Styles:
- BORDER, CLOSE, MIN, MAX, NO_TRIM, RESIZE, TITLE, ON_TOP, TOOL
- Events:
- (none)
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)
IMPORTANT: This class is intended to be subclassed only within the SWT implementation.
| Field Summary | |
(package private) long |
accelGroup
|
(package private) Button |
defaultButton
|
(package private) org.eclipse.swt.graphics.Image |
image
|
(package private) org.eclipse.swt.graphics.Image[] |
images
|
(package private) boolean |
maximized
|
(package private) Menu |
menuBar
|
(package private) Menu[] |
menus
|
(package private) boolean |
minimized
|
(package private) Button |
saveDefault
|
(package private) Control |
savedFocus
|
(package private) java.lang.String |
text
|
| Fields inherited from class org.eclipse.swt.widgets.Canvas |
caret |
| Fields inherited from class org.eclipse.swt.widgets.Composite |
embeddedHandle, imHandle, layout, socketHandle, tabList |
| Fields inherited from class org.eclipse.swt.widgets.Scrollable |
horizontalBar, scrolledHandle, verticalBar |
| Fields inherited from class org.eclipse.swt.widgets.Control |
accessible, cursor, drawCount, enableWindow, fixedHandle, font, layoutData, menu, parent, redrawWindow, toolTipText |
| Fields inherited from class org.eclipse.swt.widgets.Widget |
ACTIVATE, BUTTON_PRESS_EVENT, BUTTON_RELEASE_EVENT, CANVAS, CHANGED, CLICKED, COMMIT, CONFIGURE_EVENT, data, DEFAULT_HEIGHT, DEFAULT_WIDTH, DELETE_EVENT, DELETE_RANGE, DELETE_TEXT, DISABLED, display, DISPOSED, ENTER_NOTIFY_EVENT, EVENT, EVENT_AFTER, eventTable, EXPOSE_EVENT, FOCUS, FOCUS_IN_EVENT, FOCUS_OUT_EVENT, handle, HANDLE, HIDE, INSERT_TEXT, KEY_PRESS_EVENT, KEY_RELEASE_EVENT, KEYED_DATA, LEAVE_NOTIFY_EVENT, MAP_EVENT, MENU, MNEMONIC_ACTIVATE, MOTION_NOTIFY_EVENT, OBSCURED, POPUP_MENU, PREEDIT_CHANGED, REALIZE, ROW_ACTIVATED, SCROLL_CHILD, SELECT, SHOW, SHOW_HELP, SIZE_ALLOCATE, state, style, STYLE_SET, SWITCH_PAGE, TEST_COLLAPSE_ROW, TEST_EXPAND_ROW, TOGGLED, UNMAP_EVENT, UNREALIZE, VALUE_CHANGED, VISIBILITY_NOTIFY_EVENT, WINDOW_STATE_EVENT |
| Constructor Summary | |
(package private) |
Decorations()
|
|
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 | |
(package private) void |
_setImages(org.eclipse.swt.graphics.Image[] images)
|
(package private) void |
add(Menu menu)
|
(package private) static int |
checkStyle(int style)
|
(package private) Control |
computeTabGroup()
|
(package private) Control |
computeTabRoot()
|
(package private) void |
createAccelGroup()
|
(package private) void |
createWidget(int index)
|
(package private) void |
destroyAccelGroup()
|
(package private) void |
fixAccelGroup()
|
(package private) void |
fixDecorations(Decorations newDecorations,
Control control,
Menu[] menus)
|
Button |
getDefaultButton()
Returns the receiver's default button if one had previously been set, otherwise returns null. |
org.eclipse.swt.graphics.Image |
getImage()
Returns the receiver's image if it had previously been set using setImage(). |
org.eclipse.swt.graphics.Image[] |
getImages()
Returns the receiver's images if they had previously been set using setImages(). |
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. |
(package private) java.lang.String |
getNameText()
|
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. |
boolean |
isReparentable()
Returns true if the underlying operating
system supports this reparenting, otherwise false |
(package private) boolean |
isTabGroup()
|
(package private) boolean |
isTabItem()
|
(package private) Decorations |
menuShell()
|
(package private) void |
releaseWidget()
|
(package private) void |
remove(Menu menu)
|
(package private) boolean |
restoreFocus()
|
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(org.eclipse.swt.graphics.Image image)
Sets the receiver's image to the argument, which may be null. |
void |
setImages(org.eclipse.swt.graphics.Image[] images)
Sets the receiver's images to the argument, which may be an empty array. |
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. |
(package private) void |
setSavedFocus(Control control)
|
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 may not be null. |
(package private) boolean |
traverseItem(boolean next)
|
(package private) boolean |
traverseReturn()
|
| Methods inherited from class org.eclipse.swt.widgets.Canvas |
getCaret, getIMCaretPos, gtk_expose_event, gtk_focus_in_event, gtk_focus_out_event, redrawWidget, scroll, setBounds, setCaret, setFont, updateCaret |
| Methods inherited from class org.eclipse.swt.widgets.Composite |
_getChildren, _getTabList, checkSubclass, computeSize, computeTabList, createHandle, createHandle, deregister, enableWidget, findMenus, fixChildren, fixTabList, focusHandle, forceFocus, getChildren, getChildrenCount, getLayout, getTabList, gtk_button_press_event, gtk_focus, gtk_key_press_event, gtk_realize, gtk_scroll_child, gtk_style_set, hasBorder, hookEvents, hooksKeys, imHandle, layout, layout, minimumSize, moveAbove, moveBelow, parentingHandle, register, releaseChildren, removeControl, resizeHandle, setFocus, setLayout, setTabGroupFocus, setTabItemFocus, setTabList, translateMnemonic, translateTraversal, traversalCode |
| Methods inherited from class org.eclipse.swt.widgets.Scrollable |
clientHandle, computeTrim, createScrollBar, getBorderWidth, getClientArea, getHorizontalBar, getVerticalBar, hScrollBarWidth, releaseHandle, setOrientation, topHandle, vScrollBarWidth |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
text
java.lang.String text
image
org.eclipse.swt.graphics.Image image
images
org.eclipse.swt.graphics.Image[] images
minimized
boolean minimized
maximized
boolean maximized
menuBar
Menu menuBar
menus
Menu[] menus
savedFocus
Control savedFocus
defaultButton
Button defaultButton
saveDefault
Button saveDefault
accelGroup
long accelGroup
| Constructor Detail |
Decorations
Decorations()
Decorations
public Decorations(Composite parent, int style)
- 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.
| Method Detail |
checkStyle
static int checkStyle(int style)
_setImages
void _setImages(org.eclipse.swt.graphics.Image[] images)
add
void add(Menu menu)
computeTabGroup
Control computeTabGroup()
- Overrides:
computeTabGroupin classControl
computeTabRoot
Control computeTabRoot()
- Overrides:
computeTabRootin classControl
createAccelGroup
void createAccelGroup()
createWidget
void createWidget(int index)
- Overrides:
createWidgetin classScrollable
destroyAccelGroup
void destroyAccelGroup()
fixAccelGroup
void fixAccelGroup()
fixDecorations
void fixDecorations(Decorations newDecorations, Control control, Menu[] menus)
getDefaultButton
public Button getDefaultButton()
- Returns the receiver's default button if one had
previously been set, otherwise returns null.
getImage
public org.eclipse.swt.graphics.Image getImage()
- Returns the receiver's image if it had previously been
set using
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.
getImages
public org.eclipse.swt.graphics.Image[] getImages()
- Returns the receiver's images if they had previously been
set using
setImages(). Images are 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. Depending where the icon is displayed, the platform chooses the icon with the "best" size. It is expected that the array will contain the same icon rendered at different resolutions.Note: This method will return an empty array if called before
setImages()is called. It does not provide access to a window manager provided, "default" image even if one exists.- Since:
- 3.0
getMaximized
public boolean getMaximized()
- Returns
trueif the receiver is currently maximized, and false otherwise.
getMenuBar
public Menu getMenuBar()
- Returns the receiver's menu bar if one had previously
been set, otherwise returns null.
getMinimized
public boolean getMinimized()
- Returns
trueif the receiver is currently minimized, and false otherwise.
getNameText
java.lang.String getNameText()
- Overrides:
getNameTextin classWidget
getText
public 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. If the text has not previously been set,
returns an empty string.
isReparentable
public boolean isReparentable()
- Description copied from class:
Control - Returns
trueif the underlying operating system supports this reparenting, otherwisefalse- Overrides:
isReparentablein classControl
isTabGroup
boolean isTabGroup()
- Overrides:
isTabGroupin classComposite
isTabItem
boolean isTabItem()
menuShell
Decorations menuShell()
remove
void remove(Menu menu)
releaseWidget
void releaseWidget()
- Overrides:
releaseWidgetin classCanvas
restoreFocus
boolean restoreFocus()
setDefaultButton
public 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). If no default button had
previously been set, or the saved default button was
disposed, the receiver's default button will be set to
null.
setImage
public void setImage(org.eclipse.swt.graphics.Image image)
- Sets the receiver's image to the argument, which may
be null. 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.
setImages
public void setImages(org.eclipse.swt.graphics.Image[] images)
- Sets the receiver's images to the argument, which may
be an empty array. Images are 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. Depending where
the icon is displayed, the platform chooses the icon with
the "best" size. It is expected that the array will contain
the same icon rendered at different resolutions.
- Since:
- 3.0
setMaximized
public void setMaximized(boolean maximized)
- Sets the maximized state of the receiver.
If the argument is
truecauses 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.
setMenuBar
public void setMenuBar(Menu menu)
- Sets the receiver's menu bar to the argument, which
may be null.
setMinimized
public void setMinimized(boolean minimized)
- Sets the minimized stated of the receiver.
If the argument is
truecauses 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.
setSavedFocus
void setSavedFocus(Control control)
setText
public 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 may not be null.
traverseItem
boolean traverseItem(boolean next)
- Overrides:
traverseItemin classControl
traverseReturn
boolean traverseReturn()
- Overrides:
traverseReturnin classControl
|
|||||||||
| Home >> All >> org >> eclipse >> swt >> [ widgets overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC