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, Runnable
Direct Known Subclasses:
Shell

public class Decorations
extends Canvas


Field Summary
 
Fields inherited from class org.eclipse.swt.widgets.Widget
h, INCMD_DISPOSE, INCMD_EXTKEY, INCMD_KEY, INCMD_LDOWN, INCMD_LUP, INCMD_MENU, INCMD_POS, UPDATEITEM_ENABLED, UPDATEITEM_NAME, w, x, y
 
Method Summary
 Button getDefaultButton()
          Returns the receiver's default button if one had previously been set, otherwise returns null.
 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 setMenuBar(Menu menu)
          Sets the menu bar of the instance.
 void setText(String string)
          Sets the receiver's text, which is the string that the window manager will typically display as the receiver's title.
 
Methods inherited from class org.eclipse.swt.widgets.Composite
getChildren, pack, setLayout
 
Methods inherited from class org.eclipse.swt.widgets.Scrollable
getClientArea
 
Methods inherited from class org.eclipse.swt.widgets.Control
computeSize, computeSize, getLayoutData, isFocusControl, pack, setBackground, setBounds, setFocus, setLayoutData, setSize, setSize, update
 
Methods inherited from class org.eclipse.swt.widgets.Widget
addListener, dispose, focusState, getBorderWidth, getDisplayArea, getSelection, getStyle, getText, isDisposed, removeListener, setBounds, setCursor, stop
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, toString
 
Methods inherited from interface org.eclipse.swt.graphics.Drawable
drawLine, drawRect, drawText, setColor
 
Methods inherited from interface java.lang.Runnable
run
 

Method Detail

getDefaultButton

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

Returns:
the default button or null
Throws:
SWTException -
  • ERROR_WIDGET_DISPOSED - if the receiver has been disposed
  • ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
See Also:
setDefaultButton(org.eclipse.swt.widgets.Button)

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.

Throws:
IllegalArgumentException -
  • ERROR_INVALID_ARGUMENT - if the button has been disposed
SWTException -
  • ERROR_WIDGET_DISPOSED - if the receiver has been disposed
  • ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver

setMenuBar

public void setMenuBar(Menu menu)
Sets the menu bar of the instance. The argument may be null, in this case the current menu bar of the instance is removed.

Parameters:
menu - the new menu bar
Throws:
IllegalArgumentException -
  • ERROR_INVALID_ARGUMENT - if the menu has been disposed
  • ERROR_INVALID_PARENT - if the menu is not in the same widget tree
SWTException -
  • ERROR_WIDGET_DISPOSED - if the receiver has been disposed
  • ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver

setText

public void setText(String string)
Sets the receiver's text, which is the string that the window manager will typically display as the receiver's title. May not be null.

Parameters:
string - - the name to be set