org.gwtwidgets.client.wwrapper
Class WBuilder
java.lang.Object
org.gwtwidgets.client.wwrapper.WBuilder
public class WBuilder
- extends java.lang.Object
|
Method Summary |
static WrappedWidget |
getWidgetFromDOM(java.lang.String id)
Wraps the HTML element with the specified ID as a widget. |
static com.google.gwt.user.client.Element |
replaceElementWithWidget(com.google.gwt.user.client.Element from,
com.google.gwt.user.client.ui.Widget to)
Replaces an existing element in the HTML
document with a different widget. |
static com.google.gwt.user.client.ui.Widget |
replaceWidget(com.google.gwt.user.client.ui.Widget from,
com.google.gwt.user.client.ui.Widget to)
Replaces an existing widget in the HTML
document with a different widget. |
static void |
resetElement(com.google.gwt.user.client.ui.Widget widget)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
WBuilder
public WBuilder()
getWidgetFromDOM
public static WrappedWidget getWidgetFromDOM(java.lang.String id)
- Wraps the HTML element with the specified ID as a widget.
All widgets returned extend Widget and implement the
WrappedWidget interface.
The following HTML tags are currently supported:
a (WHyperlink), div (WPanel), button (WButton),
img (WImage).
WrappedWidget navLinkSearch = WBuilder.getWidgetFromDOM("nav-link-search");
if (navLinkSearch.isHyperlink()) {
((WHyperlink)navLinkSearch).addClickListener(navListener);
}
- Parameters:
id -
- Returns:
- null if unable to find or build the widget)
replaceElementWithWidget
public static com.google.gwt.user.client.Element replaceElementWithWidget(com.google.gwt.user.client.Element from,
com.google.gwt.user.client.ui.Widget to)
- Replaces an existing element in the HTML
document with a different widget.
- Parameters:
from - element being replacedto - widget being added
- Returns:
- the element being replaced
replaceWidget
public static com.google.gwt.user.client.ui.Widget replaceWidget(com.google.gwt.user.client.ui.Widget from,
com.google.gwt.user.client.ui.Widget to)
- Replaces an existing widget in the HTML
document with a different widget.
- Parameters:
from - widget being replacedto - widget being added
- Returns:
- the widget being replaced
resetElement
public static void resetElement(com.google.gwt.user.client.ui.Widget widget)
Copyright © 2009. All Rights Reserved.