public class CaptionPanel extends Composite implements HasWidgets.ForIsWidget
Modifier and Type | Class and Description |
---|---|
static class |
CaptionPanel.CaptionPanelImpl
Implementation class without browser-specific hacks.
|
static class |
CaptionPanel.CaptionPanelImplMozilla
Implementation class that handles Mozilla rendering issues.
|
static class |
CaptionPanel.CaptionPanelImplSafari
Implementation class that handles Safari rendering issues.
|
UIObject.DebugIdImpl, UIObject.DebugIdImplEnabled
HasWidgets.ForIsWidget
DEBUG_ID_PREFIX
Constructor and Description |
---|
CaptionPanel()
Constructs a CaptionPanel with an empty caption.
|
CaptionPanel(SafeHtml caption)
Constructs a CaptionPanel with specified caption text.
|
CaptionPanel(String captionText)
Constructs a CaptionPanel with specified caption text.
|
CaptionPanel(String caption,
boolean asHTML)
Constructs a CaptionPanel having the specified caption.
|
Modifier and Type | Method and Description |
---|---|
void |
add(IsWidget w)
Overloaded version for IsWidget.
|
void |
add(Widget w)
Adds a child widget.
|
void |
clear()
Removes the content widget.
|
String |
getCaptionHTML()
Returns the caption as HTML; note that if the caption was previously set
using
setCaptionText(String) , the return value is undefined. |
String |
getCaptionText()
Returns the caption as text; note that if the caption was previously set
using
setCaptionHTML(String) , the return value is undefined. |
Widget |
getContentWidget()
Accesses the content widget, if present.
|
Iterator<Widget> |
iterator()
Iterates over the singular content widget, if present.
|
boolean |
remove(IsWidget w)
Overloaded version for IsWidget.
|
boolean |
remove(Widget w)
Removes the specified widget, although in practice the specified widget
must be the content widget.
|
void |
setCaptionHTML(SafeHtml html)
Sets the caption for the panel using a SafeHtml string.
|
void |
setCaptionHTML(String html)
Sets the caption for the panel using an HTML fragment.
|
void |
setCaptionText(String text)
Sets the caption for the panel using text that will be automatically
escaped.
|
void |
setContentWidget(Widget w)
Sets or replaces the content widget within the CaptionPanel.
|
claimElement, getWidget, initializeClaimedElement, initWidget, isAttached, onAttach, onBrowserEvent, onDetach, render, render, resolvePotentialElement, setWidget
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, doAttachChildren, doDetachChildren, fireEvent, getHandlerCount, getLayoutData, getParent, isOrWasAttached, onLoad, onUnload, removeFromParent, setLayoutData, 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
forEach, spliterator
public CaptionPanel()
public CaptionPanel(SafeHtml caption)
caption
- the text of the captionpublic CaptionPanel(String captionText)
captionText
- the text of the caption, which is automatically escapedpublic CaptionPanel(String caption, boolean asHTML)
caption
- the caption to displayasHTML
- if true
, the caption
param is
interpreted as HTML; otherwise, caption
is
treated as text and automatically escapedpublic void add(Widget w)
HasWidgets
add
in interface HasWidgets
w
- the widget to be addedpublic void add(IsWidget w)
add
in interface HasWidgets.ForIsWidget
add(Widget)
public void clear()
clear
in interface HasWidgets
public String getCaptionHTML()
setCaptionText(String)
, the return value is undefined.public String getCaptionText()
setCaptionHTML(String)
, the return value is undefined.public Widget getContentWidget()
setContentWidget(Widget)
public Iterator<Widget> iterator()
iterator
in interface HasWidgets
iterator
in interface Iterable<Widget>
public boolean remove(Widget w)
remove
in interface HasWidgets
w
- the widget to remove; note that anything other than the Widget
returned by getContentWidget()
will have no effecttrue
if the widget was presentpublic boolean remove(IsWidget w)
remove
in interface HasWidgets.ForIsWidget
remove(Widget)
public void setCaptionHTML(String html)
html
- HTML for the new caption; must not be null
public void setCaptionHTML(SafeHtml html)
html
- HTML for the new caption; must not be null
public void setCaptionText(String text)
text
- text for the new caption; must not be null
public void setContentWidget(Widget w)
w
- the content widget to be setCopyright © 2018. All rights reserved.