com.google.gwt.user.client.ui
Class Composite
java.lang.Object
com.google.gwt.user.client.ui.UIObject
com.google.gwt.user.client.ui.Widget
com.google.gwt.user.client.ui.Composite
- All Implemented Interfaces:
- EventListener
- Direct Known Subclasses:
- TabBar, TabPanel
- public abstract class Composite
- extends Widget
A type of widget that can wrap another widget, hiding the wrapped widget's
methods. When added to a panel, a composite behaves exactly as if the widget
it wraps had been added.
The composite is useful for creating a single widget out of an aggregate of
multiple other widgets contained in a single panel.
Example
code
Method Summary |
Element |
getElement()
This override checks to ensure setWidget(Widget) has been called. |
protected void |
onAttach()
This method is called when a widget is attached to the browser's document.
|
protected void |
onDetach()
This method is called when a widget is detached from the browser's
document. |
protected void |
setWidget(Widget widget)
Sets the widget to be wrapped by the composite. |
Methods inherited from class com.google.gwt.user.client.ui.UIObject |
addStyleName, getAbsoluteLeft, getAbsoluteTop, getOffsetHeight, getOffsetWidth, getStyleName, isVisible, isVisible, removeStyleName, setElement, setHeight, setPixelSize, setSize, setStyleName, setStyleName, setVisible, setVisible, setWidth, sinkEvents, toString, unsinkEvents |
Composite
public Composite()
onAttach
protected void onAttach()
- Description copied from class:
Widget
- This method is called when a widget is attached to the browser's document.
It must not be overridden, except by
Panel
. To receive
notification when a widget is attached to the document, override the
Widget.onLoad()
method.
- Overrides:
onAttach
in class Widget
onDetach
protected void onDetach()
- Description copied from class:
Widget
- This method is called when a widget is detached from the browser's
document. It must not be overridden, except by
Panel
.
- Overrides:
onDetach
in class Widget
getElement
public Element getElement()
- This override checks to ensure
setWidget(Widget)
has been called.
- Overrides:
getElement
in class UIObject
- Returns:
- the object's browser element
setWidget
protected void setWidget(Widget widget)
- Sets the widget to be wrapped by the composite. The wrapped widget must be
set before calling any
Widget
methods on this object, or adding it
to a panel.
- Parameters:
widget
- the widget to be wrapped
This javadoc distribution was not produced by Google. The official documentation is here.