org.eclipse.swt.widgets
Class Decorations

java.lang.Object
  |
  +--org.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:
Drawable
Direct Known Subclasses:
Shell

public class Decorations
extends Canvas

Safe:


Field Summary
(package private)  Button defaultButton
           
(package private)  int hAccel
           
(package private)  int hIcon
           
(package private) static int ID_START
           
(package private)  Image image
           
(package private)  MenuItem[] items
           
(package private)  Menu menuBar
           
(package private)  Menu[] menus
           
(package private)  int nAccel
           
(package private)  Button saveDefault
           
(package private)  Control savedFocus
           
(package private)  int swFlags
           
 
Fields inherited from class org.eclipse.swt.widgets.Canvas
caret
 
Fields inherited from class org.eclipse.swt.widgets.Composite
font, layout, lpwp, tabList
 
Fields inherited from class org.eclipse.swt.widgets.Scrollable
horizontalBar, verticalBar
 
Fields inherited from class org.eclipse.swt.widgets.Control
ACCENTS, accessible, background, drawCount, foreground, handle, hCursor, layoutData, menu, parent, toolTipText
 
Fields inherited from class org.eclipse.swt.widgets.Widget
CANVAS, COMCTL32_MAJOR, COMCTL32_MINOR, data, DEFAULT_HEIGHT, DEFAULT_WIDTH, DISABLED, DISPOSED, eventTable, HIDDEN, keys, MAJOR, MINOR, Mnemonic, state, style, values
 
Constructor Summary
(package private) Decorations()
          Prevents uninitialized instances from being created outside the package.
  Decorations(Composite parent, int style)
          Enabled: Constructs a new instance of this class given its parent and a style value describing its behavior and appearance.
 
Method Summary
(package private)  void add(Menu menu)
           
(package private)  void add(MenuItem item)
           
(package private)  void bringToTop()
           
(package private) static int checkStyle(int style)
           
protected  void checkSubclass()
          Checks that this class can be subclassed.
(package private)  Control computeTabGroup()
           
(package private)  Control computeTabRoot()
           
 Rectangle computeTrim(int x, int y, int width, int height)
          Enabled:
(package private)  void createAccelerators()
           
(package private)  void createHandle()
           
(package private)  void createWidget()
           
(package private)  void destroyAccelerators()
           
(package private)  Menu findMenu(int hMenu)
           
(package private)  MenuItem findMenuItem(int id)
           
 Rectangle getBounds()
          Enabled:
 Rectangle getClientArea()
          Enabled:
 Button getDefaultButton()
          Enabled: Returns the receiver's default button if one had previously been set, otherwise returns null.
 Image getImage()
          Enabled: Returns the receiver's image if it had previously been set using setImage().
 Point getLocation()
          Enabled:
 boolean getMaximized()
          Enabled: Returns true if the receiver is currently maximized, and false otherwise.
 Menu getMenuBar()
          Enabled: Returns the receiver's menu bar if one had previously been set, otherwise returns null.
 boolean getMinimized()
          Enabled: Returns true if the receiver is currently minimized, and false otherwise.
(package private)  String getNameText()
           
 Point getSize()
          Enabled:
 String getText()
          Enabled: Returns the receiver's text, which is the string that the window manager will typically display as the receiver's title.
(package private)  boolean isTabGroup()
           
(package private)  boolean isTabItem()
           
(package private)  Decorations menuShell()
           
(package private)  void releaseWidget()
           
(package private)  void remove(Menu menu)
           
(package private)  void remove(MenuItem item)
           
(package private)  boolean restoreFocus()
           
(package private)  void saveFocus()
           
(package private)  void setBounds(int x, int y, int width, int height, int flags)
           
 void setDefaultButton(Button button)
          Enabled: 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).
(package private)  void setDefaultButton(Button button, boolean save)
           
 boolean setFocus()
          Suppressed:
 void setImage(Image image)
          Enabled: Sets the receiver's image to the argument, which may be null.
 void setMaximized(boolean maximized)
          Enabled: Sets the maximized state of the receiver.
 void setMenuBar(Menu menu)
          Enabled: Sets the receiver's menu bar to the argument, which may be null.
 void setMinimized(boolean minimized)
          Enabled: Sets the minimized stated of the receiver.
(package private)  void setParent()
           
(package private)  void setPlacement(int x, int y, int width, int height, int flags)
           
(package private)  void setSavedFocus(Control control)
           
(package private)  void setSystemMenu()
           
 void setText(String string)
          Enabled: 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.
 void setVisible(boolean visible)
          Enabled:
(package private)  boolean translateAccelerator(org.eclipse.swt.internal.win32.MSG msg)
           
(package private)  boolean traverseItem(boolean next)
           
(package private)  boolean traverseReturn()
           
(package private)  int widgetExtStyle()
           
(package private)  int widgetStyle()
           
(package private)  int windowProc(int msg, int wParam, int lParam)
           
(package private)  org.eclipse.swt.internal.win32.LRESULT WM_ACTIVATE(int wParam, int lParam)
           
(package private)  org.eclipse.swt.internal.win32.LRESULT WM_CLOSE(int wParam, int lParam)
           
(package private)  org.eclipse.swt.internal.win32.LRESULT WM_HOTKEY(int wParam, int lParam)
           
(package private)  org.eclipse.swt.internal.win32.LRESULT WM_KILLFOCUS(int wParam, int lParam)
           
(package private)  org.eclipse.swt.internal.win32.LRESULT WM_NCACTIVATE(int wParam, int lParam)
           
(package private)  org.eclipse.swt.internal.win32.LRESULT WM_QUERYOPEN(int wParam, int lParam)
           
(package private)  org.eclipse.swt.internal.win32.LRESULT WM_SETFOCUS(int wParam, int lParam)
           
(package private)  org.eclipse.swt.internal.win32.LRESULT WM_SIZE(int wParam, int lParam)
           
(package private)  org.eclipse.swt.internal.win32.LRESULT WM_WINDOWPOSCHANGING(int wParam, int lParam)
           
 
Methods inherited from class org.eclipse.swt.widgets.Canvas
clearArea, getCaret, scroll, setCaret, setFont
 
Methods inherited from class org.eclipse.swt.widgets.Composite
_getChildren, _getTabList, computeSize, computeTabList, getChildren, getChildrenCount, getLayout, getTabList, hooksKeys, layout, layout, minimumSize, moveAbove, moveBelow, releaseChildren, resizeChildren, resizeChildren, setLayout, setResizeChildren, setTabGroupFocus, setTabItemFocus, setTabList, toolTipText, translateMnemonic, updateFont, WM_ERASEBKGND, WM_GETDLGCODE, WM_GETFONT, WM_LBUTTONDOWN, WM_NOTIFY, WM_PAINT, WM_SETFONT, WM_SYSCOLORCHANGE, WM_SYSCOMMAND
 
Methods inherited from class org.eclipse.swt.widgets.Scrollable
callWindowProc, createScrollBar, getHorizontalBar, getVerticalBar, windowClass, windowProc, WM_HSCROLL, WM_MOUSEWHEEL, WM_VSCROLL, wmScroll
 
Methods inherited from class org.eclipse.swt.widgets.Control
addControlListener, addFocusListener, addHelpListener, addKeyListener, addMouseListener, addMouseMoveListener, addMouseTrackListener, addPaintListener, addTraverseListener, checkOrientation, computeSize, defaultBackground, defaultFont, defaultForeground, deregister, destroyWidget, drawBackground, drawBackground, findBrush, findCursor, findMnemonic, fixFocus, forceFocus, forceResize, getAccessible, getBackground, getBackgroundPixel, getBorderWidth, getCodePage, getDisplay, getEnabled, getFont, getForeground, getForegroundPixel, getLayoutData, getMenu, getParent, getPath, getShell, getToolTipText, getVisible, hasCursor, hasFocus, internal_dispose_GC, internal_new_GC, isActive, isDisposed, isEnabled, isFocusAncestor, isFocusControl, isReparentable, isShowing, isVisible, mnemonicHit, mnemonicMatch, moveAbove, moveBelow, new_Accessible, pack, pack, redraw, redraw, register, releaseHandle, removeControlListener, removeFocusListener, removeHelpListener, removeKeyListener, removeMouseListener, removeMouseMoveListener, removeMouseTrackListener, removePaintListener, removeTraverseListener, sendKeyEvent, sendKeyEvent, sendMouseEvent, sendMouseEvent, setBackground, setBackgroundPixel, setBounds, setBounds, setCapture, setCursor, setDefaultFont, setEnabled, setForeground, setForegroundPixel, setLayoutData, setLocation, setLocation, setMenu, setParent, setRadioFocus, setRadioSelection, setRedraw, setSavedFocus, setSize, setSize, setToolTipText, sort, subclass, toControl, toControl, toDisplay, toDisplay, transferActive, transferFocus, translateMnemonic, translateTraversal, traverse, traverse, traverseEscape, traverseGroup, traverseMnemonic, traversePage, unsubclass, update, update, WM_CHAR, WM_CLEAR, WM_COMMAND, WM_CONTEXTMENU, WM_CTLCOLOR, WM_CUT, WM_DESTROY, WM_DRAWITEM, WM_ENDSESSION, WM_GETOBJECT, WM_HELP, WM_IME_CHAR, WM_IME_COMPOSITION, WM_INITMENUPOPUP, WM_KEYDOWN, WM_KEYUP, WM_LBUTTONDBLCLK, WM_LBUTTONUP, WM_MBUTTONDBLCLK, WM_MBUTTONDOWN, WM_MBUTTONUP, WM_MEASUREITEM, WM_MENUCHAR, WM_MENUSELECT, WM_MOUSEACTIVATE, WM_MOUSEHOVER, WM_MOUSELEAVE, WM_MOUSEMOVE, WM_MOVE, WM_NCCALCSIZE, WM_NCHITTEST, WM_PALETTECHANGED, WM_PASTE, WM_PRINTCLIENT, WM_QUERYENDSESSION, WM_QUERYNEWPALETTE, WM_RBUTTONDBLCLK, WM_RBUTTONDOWN, WM_RBUTTONUP, WM_SETCURSOR, WM_SETREDRAW, WM_SETTINGCHANGE, WM_SHOWWINDOW, WM_SYSCHAR, WM_SYSKEYDOWN, WM_SYSKEYUP, WM_TIMER, WM_UNDO, wmColorChild, wmCommandChild, wmDrawChild, wmMeasureChild, wmNotifyChild, wmScrollChild
 
Methods inherited from class org.eclipse.swt.widgets.Widget
addDisposeListener, addListener, checkBits, checkParent, checkWidget, dispose, error, filters, getData, getData, getName, getStyle, hooks, isListening, isValidSubclass, isValidThread, mbcsToWcs, mbcsToWcs, notifyListeners, postEvent, postEvent, releaseChild, releaseResources, removeDisposeListener, removeListener, removeListener, sendEvent, sendEvent, sendEvent, sendEvent, setData, setData, setInputState, setKeyState, toString, wcsToMbcs, wcsToMbcs
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

image

Image image

menuBar

Menu menuBar

menus

Menu[] menus

items

MenuItem[] items

savedFocus

Control savedFocus

defaultButton

Button defaultButton

saveDefault

Button saveDefault

swFlags

int swFlags

hAccel

int hAccel

nAccel

int nAccel

hIcon

int hIcon

ID_START

static final int ID_START
Constructor Detail

Decorations

Decorations()
Prevents uninitialized instances from being created outside the package.


Decorations

public Decorations(Composite parent,
                   int style)
Enabled: 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.

Parameters:
parent - a composite control which will be the parent of the new instance (cannot be null)
style - the style of control to construct
See Also:
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, Widget.checkSubclass(), Widget.getStyle()
Method Detail

add

void add(Menu menu)

add

void add(MenuItem item)

bringToTop

void bringToTop()

checkStyle

static int checkStyle(int style)

checkSubclass

protected void checkSubclass()
Description copied from class: Widget
Checks that this class can be subclassed.

The SWT class library is intended to be subclassed only at specific, controlled points (most notably, Composite and Canvas when implementing new widgets). This method enforces this rule unless it is overridden.

IMPORTANT: By providing an implementation of this method that allows a subclass of a class which does not normally allow subclassing to be created, the implementer agrees to be fully responsible for the fact that any such subclass will likely fail between SWT releases and will be strongly platform specific. No support is provided for user-written classes which are implemented in this fashion.

The ability to subclass outside of the allowed SWT classes is intended purely to enable those not on the SWT development team to implement patches in order to get around specific limitations in advance of when those limitations can be addressed by the team. Subclassing should not be attempted without an intimate and detailed understanding of the hierarchy.

Overrides:
checkSubclass in class Composite

computeTabGroup

Control computeTabGroup()
Overrides:
computeTabGroup in class Control

computeTabRoot

Control computeTabRoot()
Overrides:
computeTabRoot in class Control

computeTrim

public Rectangle computeTrim(int x,
                             int y,
                             int width,
                             int height)
Enabled:

Overrides:
computeTrim in class Scrollable
Returns:
the required bounds to produce the given client area
See Also:
Scrollable.getClientArea()

createAccelerators

void createAccelerators()

createHandle

void createHandle()
Overrides:
createHandle in class Composite

createWidget

void createWidget()
Overrides:
createWidget in class Scrollable

destroyAccelerators

void destroyAccelerators()

findMenu

Menu findMenu(int hMenu)

findMenuItem

MenuItem findMenuItem(int id)

getBounds

public Rectangle getBounds()
Enabled:

Overrides:
getBounds in class Control
Returns:
the receiver's bounding rectangle

getClientArea

public Rectangle getClientArea()
Enabled:

Overrides:
getClientArea in class Scrollable
Returns:
the client area
See Also:
Scrollable.computeTrim(int, int, int, int)

getDefaultButton

public Button getDefaultButton()
Enabled: Returns the receiver's default button if one had previously been set, otherwise returns null.

Returns:
the default button or null
See Also:
setDefaultButton(org.eclipse.swt.widgets.Button)

getImage

public Image getImage()
Enabled: 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.

Returns:
the image

getLocation

public Point getLocation()
Enabled:

Overrides:
getLocation in class Control
Returns:
the receiver's location

getMaximized

public boolean getMaximized()
Enabled: Returns true if the receiver is currently maximized, and false otherwise.

Returns:
the maximized state
See Also:
setMaximized(boolean)

getMenuBar

public Menu getMenuBar()
Enabled: Returns the receiver's menu bar if one had previously been set, otherwise returns null.

Returns:
the menu bar or null

getMinimized

public boolean getMinimized()
Enabled: Returns true if the receiver is currently minimized, and false otherwise.

Returns:
the minimized state
See Also:
setMinimized(boolean)

getNameText

String getNameText()
Overrides:
getNameText in class Widget

getSize

public Point getSize()
Enabled:

Overrides:
getSize in class Control
Returns:
the receiver's size

getText

public String getText()
Enabled: 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.

Returns:
the text

isTabGroup

boolean isTabGroup()
Overrides:
isTabGroup in class Control

isTabItem

boolean isTabItem()
Overrides:
isTabItem in class Control

menuShell

Decorations menuShell()
Overrides:
menuShell in class Control

releaseWidget

void releaseWidget()
Overrides:
releaseWidget in class Canvas

remove

void remove(Menu menu)

remove

void remove(MenuItem item)

restoreFocus

boolean restoreFocus()

saveFocus

void saveFocus()

setBounds

void setBounds(int x,
               int y,
               int width,
               int height,
               int flags)
Overrides:
setBounds in class Control

setDefaultButton

public void setDefaultButton(Button button)
Enabled: 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.


setDefaultButton

void setDefaultButton(Button button,
                      boolean save)

setFocus

public boolean setFocus()
Suppressed:

Overrides:
setFocus in class Composite
Returns:
true if the control got focus, and false if it was unable to.
See Also:
Control.forceFocus()

setImage

public void setImage(Image image)
Enabled: 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.

Parameters:
image - the new image (or null)

setMaximized

public void setMaximized(boolean maximized)
Enabled: Sets the maximized state of the receiver. If the argument is 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 tosetMaximized(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.

See Also:
setMinimized(boolean)

setMenuBar

public void setMenuBar(Menu menu)
Enabled: Sets the receiver's menu bar to the argument, which may be null.

Parameters:
menu - the new menu bar

setMinimized

public void setMinimized(boolean minimized)
Enabled: Sets the minimized stated of the receiver. If the argument is 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 tosetMaximized(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.

See Also:
setMaximized(boolean)

setParent

void setParent()

setPlacement

void setPlacement(int x,
                  int y,
                  int width,
                  int height,
                  int flags)

setSavedFocus

void setSavedFocus(Control control)

setSystemMenu

void setSystemMenu()

setText

public void setText(String string)
Enabled: 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.


setVisible

public void setVisible(boolean visible)
Enabled:

Overrides:
setVisible in class Control
Parameters:
visible - the new visibility state

translateAccelerator

boolean translateAccelerator(org.eclipse.swt.internal.win32.MSG msg)
Overrides:
translateAccelerator in class Control

traverseItem

boolean traverseItem(boolean next)
Overrides:
traverseItem in class Control

traverseReturn

boolean traverseReturn()
Overrides:
traverseReturn in class Control

widgetExtStyle

int widgetExtStyle()
Overrides:
widgetExtStyle in class Scrollable

widgetStyle

int widgetStyle()
Overrides:
widgetStyle in class Composite

windowProc

int windowProc(int msg,
               int wParam,
               int lParam)
Overrides:
windowProc in class Control

WM_ACTIVATE

org.eclipse.swt.internal.win32.LRESULT WM_ACTIVATE(int wParam,
                                                   int lParam)
Overrides:
WM_ACTIVATE in class Control

WM_CLOSE

org.eclipse.swt.internal.win32.LRESULT WM_CLOSE(int wParam,
                                                int lParam)
Overrides:
WM_CLOSE in class Control

WM_HOTKEY

org.eclipse.swt.internal.win32.LRESULT WM_HOTKEY(int wParam,
                                                 int lParam)
Overrides:
WM_HOTKEY in class Control

WM_KILLFOCUS

org.eclipse.swt.internal.win32.LRESULT WM_KILLFOCUS(int wParam,
                                                    int lParam)
Overrides:
WM_KILLFOCUS in class Canvas

WM_NCACTIVATE

org.eclipse.swt.internal.win32.LRESULT WM_NCACTIVATE(int wParam,
                                                     int lParam)
Overrides:
WM_NCACTIVATE in class Control

WM_QUERYOPEN

org.eclipse.swt.internal.win32.LRESULT WM_QUERYOPEN(int wParam,
                                                    int lParam)
Overrides:
WM_QUERYOPEN in class Control

WM_SETFOCUS

org.eclipse.swt.internal.win32.LRESULT WM_SETFOCUS(int wParam,
                                                   int lParam)
Overrides:
WM_SETFOCUS in class Canvas

WM_SIZE

org.eclipse.swt.internal.win32.LRESULT WM_SIZE(int wParam,
                                               int lParam)
Overrides:
WM_SIZE in class Composite

WM_WINDOWPOSCHANGING

org.eclipse.swt.internal.win32.LRESULT WM_WINDOWPOSCHANGING(int wParam,
                                                            int lParam)
Overrides:
WM_WINDOWPOSCHANGING in class Control


comments?