Class RenderablePanel
- All Implemented Interfaces:
HasAttachHandlers,HasHandlers,EventListener,HasVisibility,HasWidgets,HasWidgets.ForIsWidget,IndexedPanel,IndexedPanel.ForIsWidget,IsRenderable,IsWidget,Iterable<Widget>
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).
-
Nested Class Summary
Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.UIObject
UIObject.DebugIdImpl, UIObject.DebugIdImplEnabledNested classes/interfaces inherited from interface com.google.gwt.user.client.ui.HasWidgets
HasWidgets.ForIsWidgetNested classes/interfaces inherited from interface com.google.gwt.user.client.ui.IndexedPanel
IndexedPanel.ForIsWidget -
Field Summary
FieldsFields inherited from class com.google.gwt.user.client.ui.Widget
eventsToSinkFields inherited from class com.google.gwt.user.client.ui.UIObject
DEBUG_ID_PREFIX, MISSING_ELEMENT_ERROR, SETELEMENT_TWICE_ERROR -
Constructor Summary
ConstructorsConstructorDescriptionRenderablePanel(SafeHtml safeHtml) Initializes the panel's HTML from a givenSafeHtmlobject.RenderablePanel(String html) Creates an HTML panel with the specified HTML contents inside a DIV element. -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds a child widget to the panel.voidaddAndReplaceElement(IsWidget widget, Element toReplace) Overloaded version for IsWidget.voidaddAndReplaceElement(IsWidget widget, Element toReplace) Deprecated.final voidaddAndReplaceElement(Widget widget, Element toReplace) Adds a child widget to the panel, replacing the HTML element.voidaddAndReplaceElement(Widget widget, Element toReplace) Deprecated.voidclaimElement(Element element) Replace the previous contents of the receiver with the given element, presumed to have been created and stamped via a previous call toIsRenderable.render(com.google.gwt.user.client.ui.RenderableStamper).protected SafeHtmlReturns the HTML to be set as the innerHTML of the container.voidPerform any initialization needed when the widget is not attached to the document.protected booleanWhether the initilization of the panel is finished (i.e., the corresponding DOM element has been built).voidlogicalAdd(IsRenderable renderable) Adopts the given, but doesn't change anything about its DOM element.render(RenderableStamper stamper) voidrender(RenderableStamper stamper, SafeHtmlBuilder builder) Tells this object to render itself as HTML and append it to the given builder.EXPERIMENTAL and subject to change.Methods inherited from class com.google.gwt.user.client.ui.ComplexPanel
add, add, adjustIndex, checkIndexBoundsForAccess, checkIndexBoundsForInsertion, doLogicalClear, getChildren, getWidget, getWidgetCount, getWidgetIndex, getWidgetIndex, insert, insert, iterator, remove, removeMethods inherited from class com.google.gwt.user.client.ui.Panel
add, adopt, clear, doAttachChildren, doDetachChildren, orphan, removeMethods inherited from class com.google.gwt.user.client.ui.Widget
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, unsinkEventsMethods inherited from class com.google.gwt.user.client.ui.UIObject
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, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Field Details
-
wrapInitializationCallback
-
detachedInitializationCallback
-
html
-
-
Constructor Details
-
RenderablePanel
Creates an HTML panel with the specified HTML contents inside a DIV element. Any element within this HTML that has a specified id can contain a child widget. The actual element that will hold this HTML isn't initialized until it is needed.- Parameters:
html- the panel's HTML
-
-
Method Details
-
add
Adds a child widget to the panel.- Specified by:
addin interfaceHasWidgets- Overrides:
addin classPanel- Parameters:
widget- the widget to be added- See Also:
-
addAndReplaceElement
Adds a child widget to the panel, replacing the HTML element.- Parameters:
widget- the widget to be addedtoReplace- the element to be replaced by the widget
-
addAndReplaceElement
Deprecated.Adds a child widget to the panel, replacing the HTML element.- Parameters:
widget- the widget to be addedtoReplace- the element to be replaced by the widget
-
addAndReplaceElement
Deprecated.Overloaded version for IsWidget.- See Also:
-
addAndReplaceElement
Overloaded version for IsWidget.- See Also:
-
claimElement
Description copied from interface:IsRenderableReplace the previous contents of the receiver with the given element, presumed to have been created and stamped via a previous call toIsRenderable.render(com.google.gwt.user.client.ui.RenderableStamper).- Specified by:
claimElementin interfaceIsRenderable
-
initializeClaimedElement
public void initializeClaimedElement()Description copied from interface:IsRenderablePerform any initialization needed when the widget is not attached to the document. Assumed to be called afterIsRenderable.claimElement(com.google.gwt.dom.client.Element).- Specified by:
initializeClaimedElementin interfaceIsRenderable
-
logicalAdd
Adopts the given, but doesn't change anything about its DOM element. Should only be used for widgets with elements that are children of this panel's element. No-op if called with anIsRenderablethat isn't also IsWidget, but safe to call with such as a convenience. -
render
- Specified by:
renderin interfaceIsRenderable- See Also:
-
resolvePotentialElement
Description copied from class:UIObjectEXPERIMENTAL and subject to change. Do not use this in production code.To be overridden by
IsRenderablesubclasses that initialize themselves by by callingsetElement(PotentialElement.build(this)).The receiver must:
- create a real
Elementto replace itsPotentialElement - call
#setElement()with the new Element - and return 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)andIsRenderable.claimElement(Element).- Overrides:
resolvePotentialElementin classUIObject- See Also:
- create a real
-
getInnerHtml
Returns the HTML to be set as the innerHTML of the container. -
isFullyInitialized
protected boolean isFullyInitialized()Whether the initilization of the panel is finished (i.e., the corresponding DOM element has been built).
-
addAndReplaceElement(IsWidget, Element)