Class PotentialElement
- java.lang.Object
-
- com.google.gwt.core.client.JavaScriptObject
-
- com.google.gwt.dom.client.Node
-
- com.google.gwt.dom.client.Element
-
- com.google.gwt.user.client.ui.PotentialElement
-
public class PotentialElement extends Element
EXPERIMENTAL and subject to change. Do not use this in production code.A simple
Elementimplementation (not an actual dom object) that can serve as stand in to be used byIsRenderablewidgets before they are fully built. For example, it can accumulate simple set*() values to be used when the widget is actually ready to render. Thus, mostIsRenderablewidget code can be written without taking into account whether or not the widget has yet been rendered.DOM#appendChildis aware of PotentialElement, and calls its resolve() method. This triggers a call toUIObject.resolvePotentialElement(), which widgets can customize to get a realElementin place at the last moment. TODO(rdcastro): Cover all unsupported methods with helpful error messages.
-
-
Field Summary
-
Fields inherited from class com.google.gwt.dom.client.Element
DRAGGABLE_AUTO, DRAGGABLE_FALSE, DRAGGABLE_TRUE
-
Fields inherited from class com.google.gwt.dom.client.Node
DOCUMENT_NODE, ELEMENT_NODE, TEXT_NODE
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedPotentialElement()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static PotentialElementas(Element e)static PotentialElementbuild(UIObject o)Builds a new PotentialElement with the tag name set to "div".static PotentialElementbuild(UIObject o, java.lang.String tagName)Builds a new PotentialElement.static HtmlElementBuildercreateBuilderFor(Element potentialElement)Creates anHtmlElementBuilderinstance inheriting all attributes set for the given PotentialElement.static booleanisPotential(JavaScriptObject o)Tests whether a givenJavaScriptObjectrepresents a PotentialElement.static Elementresolve(Element maybePotential)If given a PotentialElement, returns the real Element to be built from it.(package private) ElementsetResolver(UIObject resolver)-
Methods inherited from class com.google.gwt.dom.client.Element
addClassName, as, as, blur, dispatchEvent, focus, getAbsoluteBottom, getAbsoluteLeft, getAbsoluteRight, getAbsoluteTop, getAttribute, getClassName, getClientHeight, getClientWidth, getDir, getDraggable, getElementsByTagName, getFirstChildElement, getId, getInnerHTML, getInnerText, getLang, getNextSiblingElement, getOffsetHeight, getOffsetLeft, getOffsetParent, getOffsetTop, getOffsetWidth, getPreviousSiblingElement, getPropertyBoolean, getPropertyDouble, getPropertyInt, getPropertyJSO, getPropertyObject, getPropertyString, getScrollHeight, getScrollLeft, getScrollTop, getScrollWidth, getString, getStyle, getTabIndex, getTagName, getTitle, hasAttribute, hasClassName, hasTagName, is, is, removeAttribute, removeClassName, replaceClassName, scrollIntoView, setAttribute, setClassName, setDir, setDraggable, setId, setInnerHTML, setInnerSafeHtml, setInnerText, setLang, setPropertyBoolean, setPropertyDouble, setPropertyInt, setPropertyJSO, setPropertyObject, setPropertyString, setScrollLeft, setScrollTop, setTabIndex, setTitle, toggleClassName
-
Methods inherited from class com.google.gwt.dom.client.Node
appendChild, cloneNode, getChild, getChildCount, getChildNodes, getFirstChild, getLastChild, getNextSibling, getNodeName, getNodeType, getNodeValue, getOwnerDocument, getParentElement, getParentNode, getPreviousSibling, hasChildNodes, hasParentElement, insertAfter, insertBefore, insertFirst, isOrHasChild, removeAllChildren, removeChild, removeFromParent, replaceChild, setNodeValue
-
Methods inherited from class com.google.gwt.core.client.JavaScriptObject
cast, createArray, createArray, createFunction, createObject, equals, hashCode, toSource, toString
-
-
-
-
Method Detail
-
as
public static PotentialElement as(Element e)
-
build
public static PotentialElement build(UIObject o)
Builds a new PotentialElement with the tag name set to "div".- See Also:
build(UIObject,String)
-
build
public static PotentialElement build(UIObject o, java.lang.String tagName)
Builds a new PotentialElement. This element keeps track of theUIObjectso that it can callUIObject.resolvePotentialElement()to get a real element when that is needed.
-
createBuilderFor
public static HtmlElementBuilder createBuilderFor(Element potentialElement)
Creates anHtmlElementBuilderinstance inheriting all attributes set for the given PotentialElement.- Parameters:
potentialElement- assumed to be a PotentialElement, used as basis for the builder- Returns:
- a propertly configured
HtmlElementBuilderinstance
-
isPotential
public static boolean isPotential(JavaScriptObject o)
Tests whether a givenJavaScriptObjectrepresents a PotentialElement.- Parameters:
o- theJavaScriptObjectto be tested- Returns:
- true if the given object is a PotentialElement instance
-
resolve
public static Element resolve(Element maybePotential)
If given a PotentialElement, returns the real Element to be built from it. Otherwise returns the given Element itself.Note that a PotentialElement can only be resolved once. Making repeated calls to this method with the same PotentialElement is an error.
-
-