public class Label extends Component
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
PROPERTY_FORMAT_WHITESPACE |
static java.lang.String |
PROPERTY_ICON |
static java.lang.String |
PROPERTY_ICON_TEXT_MARGIN |
static java.lang.String |
PROPERTY_LINE_WRAP |
static java.lang.String |
PROPERTY_TEXT |
static java.lang.String |
PROPERTY_TEXT_ALIGNMENT |
static java.lang.String |
PROPERTY_TEXT_POSITION |
static java.lang.String |
PROPERTY_TOOL_TIP_TEXT |
CHILD_VISIBLE_CHANGED_PROPERTY, CHILDREN_CHANGED_PROPERTY, ENABLED_CHANGED_PROPERTY, FOCUS_NEXT_ID_CHANGED_PROPERTY, FOCUS_PREVIOUS_ID_CHANGED_PROPERTY, LAYOUT_DIRECTION_CHANGED_PROPERTY, LOCALE_CHANGED_PROPERTY, PROPERTY_BACKGROUND, PROPERTY_FONT, PROPERTY_FOREGROUND, PROPERTY_LAYOUT_DATA, STYLE_CHANGED_PROPERTY, STYLE_NAME_CHANGED_PROPERTY, VISIBLE_CHANGED_PROPERTY| Constructor and Description |
|---|
Label()
Creates a label with no text or icon.
|
Label(ImageReference icon)
Creates a label with an icon.
|
Label(java.lang.String text)
Creates a label with text.
|
Label(java.lang.String text,
ImageReference icon)
Creates a label with text and an icon.
|
| Modifier and Type | Method and Description |
|---|---|
ImageReference |
getIcon()
Returns the icon of the label.
|
Extent |
getIconTextMargin()
Returns the margin size between the icon and the text.
|
java.lang.String |
getText()
Returns the text of the label.
|
Alignment |
getTextAlignment()
Returns the alignment of the text relative to the icon.
|
Alignment |
getTextPosition()
Returns the position of the text relative to the icon.
|
java.lang.String |
getToolTipText()
Returns the tool tip text (displayed when the mouse cursor is hovered
over the component).
|
boolean |
isFormatWhitespace()
Determines if the text of the label should be formatted in case the
target renderer does not preserve whitespace.
|
boolean |
isLineWrap()
Determines if the text of the label should wrap in the event that
horizontal space is limited.
|
boolean |
isValidChild(Component component)
This component does not support children.
|
void |
setFormatWhitespace(boolean newValue)
Sets whether the text of the label should be formatted in case the target
renderer does not preserve whitespace.
|
void |
setIcon(ImageReference newValue)
Sets the icon to be displayed.
|
void |
setIconTextMargin(Extent newValue)
Sets the margin size between the icon and the text.
|
void |
setLineWrap(boolean newValue)
Sets whether the text of the label should wrap in the event that
horizontal space is limited.
|
void |
setText(java.lang.String newValue)
Sets the text to be displayed.
|
void |
setTextAlignment(Alignment newValue)
Sets the alignment of the text relative to the icon.
|
void |
setTextPosition(Alignment newValue)
Sets the position of the text relative to the icon.
|
void |
setToolTipText(java.lang.String newValue)
Sets the tool tip text (displayed when the mouse cursor is hovered
over the component).
|
add, add, addPropertyChangeListener, addPropertyChangeListener, dispose, firePropertyChange, get, getApplicationInstance, getBackground, getComponent, getComponent, getComponentCount, getComponents, getEventListenerList, getFocusNextId, getFocusPreviousId, getFont, getForeground, getId, getIndex, getLayoutData, getLayoutDirection, getLocale, getLocalStyle, getParent, getRenderId, getRenderIndexedProperty, getRenderIndexedProperty, getRenderLocale, getRenderProperty, getRenderProperty, getStyle, getStyleName, getVisibleComponent, getVisibleComponentCount, getVisibleComponents, hasEventListenerList, indexOf, init, isAncestorOf, isEnabled, isFocusTraversalParticipant, isRegistered, isRenderEnabled, isRenderVisible, isValidParent, isVisible, processInput, remove, remove, removeAll, removePropertyChangeListener, removePropertyChangeListener, set, setBackground, setComponents, setEnabled, setFocusNextId, setFocusPreviousId, setFocusTraversalParticipant, setFont, setForeground, setId, setIndex, setLayoutData, setLayoutDirection, setLocale, setRenderId, setStyle, setStyleName, setVisible, validate, verifyInput, visibleIndexOfpublic static final java.lang.String PROPERTY_FORMAT_WHITESPACE
public static final java.lang.String PROPERTY_ICON
public static final java.lang.String PROPERTY_ICON_TEXT_MARGIN
public static final java.lang.String PROPERTY_LINE_WRAP
public static final java.lang.String PROPERTY_TEXT
public static final java.lang.String PROPERTY_TEXT_ALIGNMENT
public static final java.lang.String PROPERTY_TEXT_POSITION
public static final java.lang.String PROPERTY_TOOL_TIP_TEXT
public Label()
public Label(java.lang.String text)
text - the text to be displayedpublic Label(ImageReference icon)
icon - the icon to be displayedpublic Label(java.lang.String text,
ImageReference icon)
text - the text to be displayedicon - the icon to be displayedpublic ImageReference getIcon()
public Extent getIconTextMargin()
public java.lang.String getText()
public Alignment getTextAlignment()
public Alignment getTextPosition()
public java.lang.String getToolTipText()
public boolean isFormatWhitespace()
public boolean isLineWrap()
public boolean isValidChild(Component component)
isValidChild in class Componentcomponent - the Component to evaluate as a childComponent is a valid childComponent.isValidChild(nextapp.echo.app.Component)public void setFormatWhitespace(boolean newValue)
newValue - the new format whitespace statepublic void setIcon(ImageReference newValue)
newValue - the icon to be displayedpublic void setIconTextMargin(Extent newValue)
newValue - the margin sizepublic void setLineWrap(boolean newValue)
newValue - the new line wrap statepublic void setText(java.lang.String newValue)
newValue - the text to be displayedpublic void setTextAlignment(Alignment newValue)
Alignment's
settings should be non-default.newValue - the new text positionpublic void setTextPosition(Alignment newValue)
Alignment's
settings should be non-default.newValue - the new text positionpublic void setToolTipText(java.lang.String newValue)
newValue - the new tool tip text