public class TextButton extends Button
Button
that only contains textModifier and Type | Field and Description |
---|---|
protected TextButtonRenderNode |
renderNode |
effects, styleId, visibility, zIndex
Constructor and Description |
---|
TextButton()
Constructor.
|
TextButton(java.lang.String id)
Constructor
|
Modifier and Type | Method and Description |
---|---|
void |
attach(ParentRenderNode<?,?> parentRenderNode)
Attaches a
RenderNode for this element to a parent
RenderNode |
void |
detach(ParentRenderNode<?,?> parentRenderNode)
Detaches this element's
RenderNode from a parent
RenderNode |
java.lang.String |
getText()
Returns the text of this
TextButton |
HorizontalAlignment |
getTextAlignment()
Returns the
HorizontalAlignment of the button's text |
void |
setLayout(java.lang.String layout)
Sets the current layout for this
Button |
void |
setStyleId(java.lang.String styleId)
Sets the style if for this
UiElement |
void |
setText(java.lang.String text)
Sets the text of this
TextButton |
void |
setTextAlignment(HorizontalAlignment textAlignment)
Sets the
HorizontalAlignment of the button's text |
void |
setVisibility(Visibility visibility)
Sets the current
Visibility of this UiElement |
void |
setZIndex(int zIndex)
Sets the Z index of this
UiElement . |
void |
syncWithRenderNode()
Syncs data between the
UiElement and RenderNode |
addActionListener, getLayout, isEnabled, notifyActionListenersOfBeginEvent, notifyActionListenersOfEndEvent, removeActionListener, setEnabled
addEffectListener, addHoverListener, applyEffect, equals, getElementById, getId, getStyleId, getVisibility, getZIndex, hashCode, isDebugEnabled, notifyEffectListenersOnFinished, notifyHoverListenersOnBeginHover, notifyHoverListenersOnEndHover, removeEffectListener, removeHoverListener, setDebugEnabled
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
addHoverListener, getId, notifyHoverListenersOnBeginHover, notifyHoverListenersOnEndHover, removeHoverListener
protected TextButtonRenderNode renderNode
public TextButton()
TextButton
public TextButton(java.lang.String id)
id
- The unique ID for this TextButton
public java.lang.String getText()
TextButton
String
by defaultpublic void setText(java.lang.String text)
TextButton
text
- A non-null String
public void attach(ParentRenderNode<?,?> parentRenderNode)
UiElement
RenderNode
for this element to a parent
RenderNode
attach
in class UiElement
parentRenderNode
- The parent RenderNode
to attach topublic void detach(ParentRenderNode<?,?> parentRenderNode)
UiElement
RenderNode
from a parent
RenderNode
detach
in class UiElement
parentRenderNode
- The parent RenderNode
to detach frompublic void setVisibility(Visibility visibility)
UiElement
Visibility
of this UiElement
setVisibility
in class UiElement
visibility
- The Visibility
to setpublic void setStyleId(java.lang.String styleId)
UiElement
UiElement
setStyleId
in class UiElement
styleId
- The style id to setpublic void setZIndex(int zIndex)
UiElement
UiElement
. Elements will be rendered on
different Z layers in ascending Z order (negatives values first, positive values last)public void syncWithRenderNode()
UiElement
UiElement
and RenderNode
syncWithRenderNode
in class UiElement
public HorizontalAlignment getTextAlignment()
HorizontalAlignment
of the button's textHorizontalAlignment.CENTER
by defaultpublic void setTextAlignment(HorizontalAlignment textAlignment)
HorizontalAlignment
of the button's texttextAlignment
- The text alignment