public class RenderablePanel extends ComplexPanel implements IsRenderable
An IsRenderable
version of HTMLPanel
. This class is a stepping
in our transition to the Renderable strategy. Eventually this functionality
should be merged into HTMLPanel
.
The only reason this class doesn't extend HTMLPanel
is because it
doesn't provide any way to build the panel lazily (which is needed here).
UIObject.DebugIdImpl, UIObject.DebugIdImplEnabled
IndexedPanel.ForIsWidget
HasWidgets.ForIsWidget
Modifier and Type | Field and Description |
---|---|
Scheduler.ScheduledCommand |
detachedInitializationCallback |
protected SafeHtml |
html |
Scheduler.ScheduledCommand |
wrapInitializationCallback |
eventsToSink
DEBUG_ID_PREFIX, MISSING_ELEMENT_ERROR, SETELEMENT_TWICE_ERROR
Constructor and Description |
---|
RenderablePanel(SafeHtml safeHtml)
Initializes the panel's HTML from a given
SafeHtml object. |
RenderablePanel(java.lang.String html)
Creates an HTML panel with the specified HTML contents inside a DIV
element.
|
Modifier and Type | Method and Description |
---|---|
void |
add(Widget widget)
Adds a child widget to the panel.
|
void |
addAndReplaceElement(IsWidget widget,
Element toReplace)
Deprecated.
|
void |
addAndReplaceElement(IsWidget widget,
Element toReplace)
Overloaded version for IsWidget.
|
void |
addAndReplaceElement(Widget widget,
Element toReplace)
Adds a child widget to the panel, replacing the HTML element.
|
void |
addAndReplaceElement(Widget widget,
Element toReplace)
Deprecated.
|
void |
claimElement(Element element)
Replace the previous contents of the receiver with the given element,
presumed to have been created and stamped via a previous call to
IsRenderable.render(com.google.gwt.user.client.ui.RenderableStamper) . |
protected SafeHtml |
getInnerHtml()
Returns the HTML to be set as the innerHTML of the container.
|
void |
initializeClaimedElement()
Perform any initialization needed when the widget is not attached to
the document.
|
protected boolean |
isFullyInitialized()
Whether the initilization of the panel is finished (i.e., the corresponding
DOM element has been built).
|
void |
logicalAdd(IsRenderable renderable)
Adopts the given, but doesn't change anything about its DOM element.
|
SafeHtml |
render(RenderableStamper stamper) |
void |
render(RenderableStamper stamper,
SafeHtmlBuilder builder)
Tells this object to render itself as HTML and append it to the given builder.
|
Element |
resolvePotentialElement()
EXPERIMENTAL and subject to change.
|
add, add, adjustIndex, checkIndexBoundsForAccess, checkIndexBoundsForInsertion, doLogicalClear, getChildren, getWidget, getWidgetCount, getWidgetIndex, getWidgetIndex, insert, insert, iterator, remove, remove
add, adopt, clear, doAttachChildren, doDetachChildren, orphan, remove
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, ensureHandlers, fireEvent, getHandlerCount, getHandlerManager, getLayoutData, getParent, isAttached, isOrWasAttached, onAttach, onBrowserEvent, onDetach, onLoad, onUnload, removeFromParent, replaceElement, setLayoutData, setParent, sinkEvents, unsinkEvents
addStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getElement, getOffsetHeight, getOffsetWidth, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, getTitle, isVisible, isVisible, onEnsureDebugId, removeStyleDependentName, removeStyleName, setElement, setElement, setHeight, setPixelSize, setSize, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setTitle, setVisible, setVisible, setWidth, sinkBitlessEvent, toString
public Scheduler.ScheduledCommand wrapInitializationCallback
public Scheduler.ScheduledCommand detachedInitializationCallback
protected SafeHtml html
public RenderablePanel(java.lang.String html)
html
- the panel's HTMLpublic void add(Widget widget)
add
in interface HasWidgets
add
in class Panel
widget
- the widget to be addedHasWidgets.add(Widget)
public final void addAndReplaceElement(Widget widget, Element toReplace)
widget
- the widget to be addedtoReplace
- the element to be replaced by the widget@Deprecated public void addAndReplaceElement(Widget widget, Element toReplace)
addAndReplaceElement(Widget, Element)
widget
- the widget to be addedtoReplace
- the element to be replaced by the widget@Deprecated public void addAndReplaceElement(IsWidget widget, Element toReplace)
addAndReplaceElement(IsWidget, Element)
addAndReplaceElement(Widget,Element)
public void addAndReplaceElement(IsWidget widget, Element toReplace)
addAndReplaceElement(Widget,Element)
public void claimElement(Element element)
IsRenderable
IsRenderable.render(com.google.gwt.user.client.ui.RenderableStamper)
.claimElement
in interface IsRenderable
public void initializeClaimedElement()
IsRenderable
IsRenderable.claimElement(com.google.gwt.dom.client.Element)
.initializeClaimedElement
in interface IsRenderable
public void logicalAdd(IsRenderable renderable)
IsRenderable
that isn't also IsWidget,
but safe to call with such as a convenience.public SafeHtml render(RenderableStamper stamper)
render
in interface IsRenderable
TODO(rdcastro): Remove this once UiBinder doesn't rely on it anymore.
public void render(RenderableStamper stamper, SafeHtmlBuilder builder)
IsRenderable
render
in interface IsRenderable
public Element resolvePotentialElement()
UIObject
To be overridden by IsRenderable
subclasses that initialize
themselves by by calling
setElement(PotentialElement.build(this))
.
The receiver must:
Element
to replace its PotentialElement
#setElement()
with the new Element
This method is called when the receiver's element is about to be
added to a parent node, as a side effect of DOM.appendChild(com.google.gwt.dom.client.Element, com.google.gwt.dom.client.Element)
.
Note that this method is normally called only on the top element
of an IsRenderable tree. Children instead will receive IsRenderable.render(com.google.gwt.user.client.ui.RenderableStamper)
and IsRenderable.claimElement(Element)
.
resolvePotentialElement
in class UIObject
PotentialElement
,
IsRenderable
protected SafeHtml getInnerHtml()
protected boolean isFullyInitialized()