Class RenderablePanel
- java.lang.Object
-
- com.google.gwt.user.client.ui.UIObject
-
- com.google.gwt.user.client.ui.Widget
-
- com.google.gwt.user.client.ui.Panel
-
- com.google.gwt.user.client.ui.ComplexPanel
-
- com.google.gwt.user.client.ui.RenderablePanel
-
- All Implemented Interfaces:
HasAttachHandlers
,HasHandlers
,EventListener
,HasVisibility
,HasWidgets
,HasWidgets.ForIsWidget
,IndexedPanel
,IndexedPanel.ForIsWidget
,IsRenderable
,IsWidget
,java.lang.Iterable<Widget>
public class RenderablePanel extends ComplexPanel implements IsRenderable
EXPERIMENTAL and subject to change. Do not use this in production code.An
IsRenderable
version ofHTMLPanel
. This class is a stepping in our transition to the Renderable strategy. Eventually this functionality should be merged intoHTMLPanel
. The only reason this class doesn't extendHTMLPanel
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.DebugIdImplEnabled
-
Nested classes/interfaces inherited from interface com.google.gwt.user.client.ui.HasWidgets
HasWidgets.ForIsWidget
-
Nested classes/interfaces inherited from interface com.google.gwt.user.client.ui.IndexedPanel
IndexedPanel.ForIsWidget
-
-
Field Summary
Fields Modifier and Type Field Description Scheduler.ScheduledCommand
detachedInitializationCallback
protected SafeHtml
html
Scheduler.ScheduledCommand
wrapInitializationCallback
-
Fields inherited from class com.google.gwt.user.client.ui.Widget
eventsToSink
-
Fields inherited from class com.google.gwt.user.client.ui.UIObject
DEBUG_ID_PREFIX, MISSING_ELEMENT_ERROR, SETELEMENT_TWICE_ERROR
-
-
Constructor Summary
Constructors Constructor Description RenderablePanel(SafeHtml safeHtml)
Initializes the panel's HTML from a givenSafeHtml
object.RenderablePanel(java.lang.String html)
Creates an HTML panel with the specified HTML contents inside a DIV element.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
add(Widget widget)
Adds a child widget to the panel.void
addAndReplaceElement(IsWidget widget, Element toReplace)
Overloaded version for IsWidget.void
addAndReplaceElement(IsWidget widget, Element toReplace)
Deprecated.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 toIsRenderable.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.-
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, remove
-
Methods inherited from class com.google.gwt.user.client.ui.Panel
add, adopt, clear, doAttachChildren, doDetachChildren, orphan, remove
-
Methods 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, unsinkEvents
-
Methods 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, toString
-
-
-
-
Field Detail
-
wrapInitializationCallback
public Scheduler.ScheduledCommand wrapInitializationCallback
-
detachedInitializationCallback
public Scheduler.ScheduledCommand detachedInitializationCallback
-
html
protected SafeHtml html
-
-
Constructor Detail
-
RenderablePanel
public RenderablePanel(java.lang.String html)
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 Detail
-
add
public void add(Widget widget)
Adds a child widget to the panel.- Specified by:
add
in interfaceHasWidgets
- Overrides:
add
in classPanel
- Parameters:
widget
- the widget to be added- See Also:
HasWidgets.add(Widget)
-
addAndReplaceElement
public final void addAndReplaceElement(Widget widget, Element toReplace)
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 public void addAndReplaceElement(Widget widget, Element toReplace)
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 public void addAndReplaceElement(IsWidget widget, Element toReplace)
Deprecated.Overloaded version for IsWidget.- See Also:
addAndReplaceElement(Widget,Element)
-
addAndReplaceElement
public void addAndReplaceElement(IsWidget widget, Element toReplace)
Overloaded version for IsWidget.- See Also:
addAndReplaceElement(Widget,Element)
-
claimElement
public void claimElement(Element element)
Description copied from interface:IsRenderable
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)
.- Specified by:
claimElement
in interfaceIsRenderable
-
initializeClaimedElement
public void initializeClaimedElement()
Description copied from interface:IsRenderable
Perform 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:
initializeClaimedElement
in interfaceIsRenderable
-
logicalAdd
public void logicalAdd(IsRenderable renderable)
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 anIsRenderable
that isn't also IsWidget, but safe to call with such as a convenience.
-
render
public SafeHtml render(RenderableStamper stamper)
- Specified by:
render
in interfaceIsRenderable
- See Also:
TODO(rdcastro): Remove this once UiBinder doesn't rely on it anymore.
-
render
public void render(RenderableStamper stamper, SafeHtmlBuilder builder)
Description copied from interface:IsRenderable
Tells this object to render itself as HTML and append it to the given builder. If the implementation expects to be able to claim an element later, it must be marked by the given stamper.- Specified by:
render
in interfaceIsRenderable
-
resolvePotentialElement
public Element resolvePotentialElement()
Description copied from class:UIObject
EXPERIMENTAL and subject to change. Do not use this in production code.To be overridden by
IsRenderable
subclasses that initialize themselves by by callingsetElement(PotentialElement.build(this))
.The receiver must:
- create a real
Element
to 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:
resolvePotentialElement
in classUIObject
- See Also:
PotentialElement
,IsRenderable
- create a real
-
getInnerHtml
protected SafeHtml 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).
-
-