public class Heading extends ComplexWidget implements HasWidgets, HasText, HasEmphasis, HasAlignment, HasSubText
<b:Heading size="H1">
<b:Text text="Heading"/>
<b:Small text=" subtext"/>
</b:Heading>
<b:Heading size="H1" text="Heading Text" subText="Subtext Text"/>
<b:Heading size="H1" subText="Subtext Text" text="Heading Text"/>
<b:Heading size="H1">
<b:Icon type="..."/>
<b:Text text="Heading with icon"/>
</b:Heading>
<b:Heading size="H1">
<b:Icon type="..."/>
<b:Text text="Heading with icon"/>
<b:Small text=" subtext"/>
</b:Heading>
Heading h1 = new Heading(1, "Heading Text");
h1.setSubText("Subtext Text"); // optional
UIObject.DebugIdImpl, UIObject.DebugIdImplEnabledHasWidgets.ForIsWidgetIndexedPanel.ForIsWidgetDEBUG_ID_PREFIX| Constructor and Description |
|---|
Heading(HeadingSize size)
Creates a Heading with the passed in size.
|
Heading(HeadingSize size,
String text)
Creates a Heading with the passed in size and text.
|
Heading(HeadingSize size,
String text,
String subText)
Creates a Heading with the passed in size and text.
|
| Modifier and Type | Method and Description |
|---|---|
Alignment |
getAlignment()
Get the object's alignment.
|
Emphasis |
getEmphasis()
Get the object's emphasis.
|
String |
getSubText()
Returns the subtext of the heading.
|
String |
getText() |
protected void |
onAttach() |
void |
setAlignment(Alignment alignment)
Sets this object's alignment.
|
void |
setEmphasis(Emphasis emphasis)
Sets the object's emphasis.
|
void |
setSubText(String subText)
Sets the subtext for the heading (wrapped in a Small tag).
|
void |
setText(String text) |
add, getId, getPull, insert, insert, remove, setColor, setHiddenOn, setId, setMarginBottom, setMarginLeft, setMarginRight, setMarginTop, setPaddingBottom, setPaddingLeft, setPaddingRight, setPaddingTop, setPull, setVisibleOnadd, add, adjustIndex, checkIndexBoundsForAccess, checkIndexBoundsForInsertion, getChildren, getWidget, getWidgetCount, getWidgetIndex, getWidgetIndex, insert, iterator, removeadd, adopt, clear, doAttachChildren, doDetachChildren, orphan, removeaddAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, fireEvent, getHandlerCount, getLayoutData, getParent, isAttached, isOrWasAttached, onBrowserEvent, onDetach, onLoad, onUnload, removeFromParent, setLayoutData, sinkEvents, unsinkEventsaddStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getElement, getOffsetHeight, getOffsetWidth, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, getTitle, isVisible, isVisible, onEnsureDebugId, removeStyleDependentName, removeStyleName, resolvePotentialElement, setElement, setElement, setHeight, setPixelSize, setSize, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setTitle, setVisible, setVisible, setWidth, sinkBitlessEvent, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitadd, clear, iterator, removeforEach, spliterator@UiConstructor public Heading(HeadingSize size)
size - size of the headingpublic Heading(HeadingSize size, String text)
size - size of the headingtext - text for the headingpublic Heading(HeadingSize size, String text, String subText)
size - size of the headingtext - text for the headingsubText - subtext for the headingpublic void setSubText(String subText)
setSubText in interface HasSubTextsubText - the subtext of the headingpublic String getSubText()
getSubText in interface HasSubTextpublic void setEmphasis(Emphasis emphasis)
setEmphasis in interface HasEmphasisemphasis - the object's new emphasispublic Emphasis getEmphasis()
getEmphasis in interface HasEmphasispublic void setAlignment(Alignment alignment)
setAlignment in interface HasAlignmentalignment - the object's new alignmentpublic Alignment getAlignment()
getAlignment in interface HasAlignmentCopyright © 2017. All rights reserved.