Class Decorations
- Direct Known Subclasses:
- Shell
This class was introduced to be API compatible with SWT and does only provide those methods that are absolutely necessary to serve this purpose.
- 
Method SummaryModifier and TypeMethodDescription<T> TgetAdapter(Class<T> adapter) Implementation of theAdaptableinterface.Returns the receiver's default button if one had previously been set, otherwise returns null.getImage()Returns the receiver's image if it had previously been set usingsetImage().Image[]Returns the receiver's images if they had previously been set usingsetImages().Returns the receiver's menu bar if one had previously been set, otherwise returns null.getText()Returns the receiver's text, which is the string that the window manager will typically display as the receiver's title.booleanReturnstrueif the underlying operating system supports this reparenting, otherwisefalsevoidsetDefaultButton(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).voidSets the receiver's image to the argument, which may be null.voidSets the receiver's images to the argument, which may be an empty array.voidsetMenuBar(Menu menuBar) Sets the receiver's menu bar to the argument, which may be null.voidSets 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.CanvasaddPaintListener, removePaintListenerMethods inherited from class org.eclipse.swt.widgets.Compositechanged, computeSize, getBackgroundMode, getChildren, getLayout, getLayoutDeferred, getTabList, isLayoutDeferred, layout, layout, layout, layout, layout, setBackgroundMode, setFocus, setLayout, setLayoutDeferred, setTabListMethods inherited from class org.eclipse.swt.widgets.ScrollablecomputeTrim, getClientArea, getHorizontalBar, getVerticalBarMethods inherited from class org.eclipse.swt.widgets.ControladdControlListener, addDragDetectListener, addFocusListener, addGestureListener, addHelpListener, addKeyListener, addMenuDetectListener, addMouseListener, addTouchListener, addTraverseListener, computeSize, forceFocus, getAccessible, getBackground, getBackgroundImage, getBorderWidth, getBounds, getCursor, getEnabled, getFont, getForeground, getLayoutData, getLocation, getMenu, getMonitor, getOrientation, getParent, getShell, getSize, getToolTipText, getTouchEnabled, getVisible, isEnabled, isFocusControl, isVisible, moveAbove, moveBelow, pack, pack, redraw, redraw, removeControlListener, removeDragDetectListener, removeFocusListener, removeGestureListener, removeHelpListener, removeKeyListener, removeMenuDetectListener, removeMouseListener, removeTouchListener, removeTraverseListener, requestLayout, setBackground, setBackgroundImage, setBounds, setBounds, setCursor, setData, setEnabled, setFont, setForeground, setLayoutData, setLocation, setLocation, setMenu, setOrientation, setParent, setRedraw, setSize, setSize, setToolTipText, setTouchEnabled, setVisible, toControl, toControl, toDisplay, toDisplay, updateMethods inherited from class org.eclipse.swt.widgets.WidgetaddDisposeListener, addListener, checkSubclass, checkWidget, dispose, getData, getData, getDisplay, getListeners, getStyle, isDisposed, isListening, notifyListeners, removeDisposeListener, removeListener, removeListener, reskin, setData, toString
- 
Method Details- 
getAdapterDescription copied from class:WidgetImplementation of theAdaptableinterface.IMPORTANT: This method is not part of the RWT public API. It is marked public only so that it can be shared within the packages provided by RWT. It should never be accessed from application code. - Specified by:
- getAdapterin interface- Adaptable
- Overrides:
- getAdapterin class- Canvas
- Parameters:
- adapter- the lookup class
- Returns:
- an object that can be cast to the given class or nullif there is no adapter associated with the given class.
 
- 
setImagesSets 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" attributes. It is expected that the array will contain the same icon rendered at different sizes, with different depth and transparency attributes.- Parameters:
- images- the new image array
- Throws:
- IllegalArgumentException-- ERROR_NULL_ARGUMENT - if the array of images is null
- ERROR_INVALID_ARGUMENT - if one of the images is null or 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
 
- Since:
- 1.3
 
- 
getImagesReturns the receiver's images if they had previously been set usingsetImages(). 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" attributes. It is expected that the array will contain the same icon rendered at different sizes, with different depth and transparency attributes.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.- Returns:
- the images
- 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
 
- Since:
- 1.3
 
- 
setImageSets 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)
- Throws:
- IllegalArgumentException-- ERROR_INVALID_ARGUMENT - if the image 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
 
 
- 
getImageReturns the receiver's image if it had previously been set usingsetImage(). 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
- 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
 
 
- 
setTextSets 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.- Parameters:
- text- the new text
- Throws:
- IllegalArgumentException-- ERROR_NULL_ARGUMENT - if the text is null
 
- SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
 
- Since:
- 2.2
 
- 
getTextReturns 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
- 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
 
- Since:
- 2.2
 
- 
setMenuBarSets the receiver's menu bar to the argument, which may be null.- Parameters:
- menuBar- 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
 
 
- 
getMenuBarReturns the receiver's menu bar if one had previously been set, otherwise returns null.- Returns:
- the menu bar 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
 
 
- 
isReparentablepublic boolean isReparentable()Description copied from class:ControlReturnstrueif the underlying operating system supports this reparenting, otherwisefalse- Overrides:
- isReparentablein class- Control
- Returns:
- trueif the widget can be reparented, otherwise- false
 
- 
setDefaultButtonIf 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.The default button is the button that is selected when the receiver is active and the user presses ENTER. - Parameters:
- button- the new default button
- Throws:
- IllegalArgumentException-- ERROR_INVALID_ARGUMENT - if the button has been disposed
- ERROR_INVALID_PARENT - if the control 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
 
- Since:
- 2.2
 
- 
getDefaultButtonReturns 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
 
- Since:
- 2.2
- See Also:
 
 
-