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.DebugIdImplEnabled
HasWidgets.ForIsWidget
IndexedPanel.ForIsWidget
DEBUG_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, setVisibleOn
add, add, adjustIndex, checkIndexBoundsForAccess, checkIndexBoundsForInsertion, getChildren, getWidget, getWidgetCount, getWidgetIndex, getWidgetIndex, insert, iterator, remove
add, adopt, clear, doAttachChildren, doDetachChildren, orphan, remove
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, fireEvent, getHandlerCount, getLayoutData, getParent, isAttached, isOrWasAttached, onBrowserEvent, onDetach, 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, resolvePotentialElement, setElement, setElement, setHeight, setPixelSize, setSize, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setTitle, setVisible, setVisible, setWidth, sinkBitlessEvent, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
add, clear, iterator, remove
forEach, 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 HasSubText
subText
- the subtext of the headingpublic String getSubText()
getSubText
in interface HasSubText
public void setEmphasis(Emphasis emphasis)
setEmphasis
in interface HasEmphasis
emphasis
- the object's new emphasispublic Emphasis getEmphasis()
getEmphasis
in interface HasEmphasis
public void setAlignment(Alignment alignment)
setAlignment
in interface HasAlignment
alignment
- the object's new alignmentpublic Alignment getAlignment()
getAlignment
in interface HasAlignment
Copyright © 2017. All rights reserved.