com.google.gwt.user.client.ui
Class Widget

java.lang.Object
  extended bycom.google.gwt.user.client.ui.UIObject
      extended bycom.google.gwt.user.client.ui.Widget
All Implemented Interfaces:
EventListener
Direct Known Subclasses:
Composite, FocusWidget, Hyperlink, Image, Label, MenuBar, Panel, Tree

public class Widget
extends UIObject
implements EventListener

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.


Field Summary
 
Fields inherited from class java.lang.Object
typeId, typeName
 
Constructor Summary
Widget()
           
 
Method Summary
 Panel 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 when the widget becomes attached to the browser's document.
 
Methods inherited from class com.google.gwt.user.client.ui.UIObject
addStyleName, getAbsoluteLeft, getAbsoluteTop, getElement, getOffsetHeight, getOffsetWidth, getStyleName, isVisible, isVisible, removeStyleName, setElement, setHeight, setPixelSize, setSize, setStyleName, setStyleName, setVisible, setVisible, setWidth, sinkEvents, toString, unsinkEvents
 
Methods inherited from class java.lang.Object
equals, finalize, hashCode
 

Constructor Detail

Widget

public Widget()
Method Detail

getParent

public Panel getParent()
Gets this widget's parent panel.

Returns:
the widget's parent panel

isAttached

public 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).

Returns:
true if the widget is attached

onBrowserEvent

public void onBrowserEvent(Event event)
Description copied from interface: EventListener
Fired whenever a browser event is received.

Specified by:
onBrowserEvent in interface EventListener
Parameters:
event - the event received

onLoad

protected void onLoad()
This method is called when the widget becomes attached to the browser's document.


onAttach

protected void onAttach()
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 onLoad() method.


onDetach

protected void onDetach()
This method is called when a widget is detached from the browser's document. It must not be overridden, except by Panel.



This javadoc distribution was not produced by Google. The official documentation is here.