|
||||||||||
| 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
public class 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.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.UIObject |
|---|
UIObject.DebugIdImpl, UIObject.DebugIdImplEnabled |
| Field Summary |
|---|
| Fields inherited from class com.google.gwt.user.client.ui.UIObject |
|---|
DEBUG_ID_PREFIX |
| Constructor Summary | |
|---|---|
Widget()
|
|
| Method Summary | |
|---|---|
void |
fireEvent(GwtEvent<?> event)
Fires the given event to all the appropriate handlers. |
java.lang.Object |
getLayoutData()
Gets the panel-defined layout data associated with this widget. |
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). |
void |
onBrowserEvent(Event event)
Fired whenever a browser event is received. |
void |
removeFromParent()
Removes this widget from its parent widget, if one exists. |
void |
setLayoutData(java.lang.Object layoutData)
Sets the panel-defined layout data associated with this widget. |
void |
sinkEvents(int eventBitsToAdd)
Overridden to defer the call to super.sinkEvents until the first time this widget is attached to the dom, as a performance enhancement. |
| Methods inherited from class com.google.gwt.user.client.ui.UIObject |
|---|
addStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getElement, getOffsetHeight, getOffsetWidth, getStyleName, getStylePrimaryName, getTitle, isVisible, isVisible, removeStyleDependentName, removeStyleName, setHeight, setPixelSize, setSize, setStyleDependentName, setStyleName, setStyleName, setStylePrimaryName, setTitle, setVisible, setVisible, setWidth, toString, unsinkEvents |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Widget()
| Method Detail |
|---|
public void fireEvent(GwtEvent<?> event)
HasHandlers
fireEvent in interface HasHandlersevent - the event to be firedpublic java.lang.Object getLayoutData()
setLayoutData(java.lang.Object)public Widget getParent()
public boolean isAttached()
true if the widget is attachedpublic void onBrowserEvent(Event event)
EventListener
onBrowserEvent in interface EventListenerevent - the event receivedpublic void removeFromParent()
If it has no parent, this method does nothing. If it is a "root" widget
(meaning it's been added to the detach list via
RootPanel.detachOnWindowClose(Widget)), it will be removed from the
detached immediately. This makes it possible for Composites and Panels to
adopt root widgets.
java.lang.IllegalStateException - if this widget's parent does not support
removal (e.g. Composite)public void setLayoutData(java.lang.Object layoutData)
layoutData - the widget's layout datapublic void sinkEvents(int eventBitsToAdd)
isOrWasAttached():
@Override
public void sinkEvents(int eventBitsToAdd) {
if (isOrWasAttached()) {
/* customized sink code goes here */
} else {
super.sinkEvents(eventBitsToAdd);
}
}
sinkEvents in class UIObjecteventBitsToAdd - a bitfield representing the set of events to be added
to this element's event setEvent
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||