|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.google.gwt.user.client.ui.UIObject
com.google.gwt.user.client.ui.Widget
The base class for the majority of user-interface objects. Widget adds
support for receiving events from the browser and being added directly to
panels
.
Constructor Summary | |
Widget()
|
Method Summary | |
Widget |
getParent()
Gets this widget's parent panel. |
boolean |
isAttached()
Determines whether this widget is currently attached to the browser's document (i.e., there is an unbroken chain of widgets between this widget and the underlying browser document). |
protected void |
onAttach()
This method is called when a widget is attached to the browser's document. |
void |
onBrowserEvent(Event event)
Fired whenever a browser event is received. |
protected void |
onDetach()
This method is called when a widget is detached from the browser's document. |
protected void |
onLoad()
This method is called immediately after a widget becomes attached to the browser's document. |
protected void |
onUnload()
This method is called immediately before a widget will be detached from the browser's document. |
void |
removeFromParent()
Removes this widget from its parent widget. |
protected void |
setElement(Element elem)
Sets this object's browser element. |
Methods inherited from class com.google.gwt.user.client.ui.UIObject |
addStyleName, getAbsoluteLeft, getAbsoluteTop, getElement, getOffsetHeight, getOffsetWidth, getStyleElement, getStyleName, getTitle, isVisible, isVisible, removeStyleName, resetStyleName, setHeight, setPixelSize, setSize, setStyleName, setStyleName, setTitle, setVisible, setVisible, setWidth, sinkEvents, toString, unsinkEvents |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public Widget()
Method Detail |
public Widget getParent()
public boolean isAttached()
true
if the widget is attachedpublic void onBrowserEvent(Event event)
EventListener
onBrowserEvent
in interface EventListener
event
- the event receivedpublic void removeFromParent()
java.lang.IllegalStateException
- if this widget's parent does not support
removal (e.g. Composite
)protected void onAttach()
onLoad()
method.
Subclasses that override this method must call
super.onAttach()
to ensure that the Widget has been
attached to the underlying Element.
java.lang.IllegalStateException
- if this widget is already attachedprotected void onDetach()
onUnload()
method.
Subclasses that override this method must call
super.onDetach()
to ensure that the Widget has been
detached from the underlying Element. Failure to do so will result
in application memeroy leaks due to circular references between DOM
Elements and JavaScript objects.
java.lang.IllegalStateException
- if this widget is already detachedprotected void onLoad()
protected void onUnload()
protected void setElement(Element elem)
setElement
in class UIObject
elem
- the object's new element
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |