|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnextapp.echo.AbstractComponent
nextapp.echo.Label
public class Label
A display area for text, an image, or both.
Field Summary | |
---|---|
static java.lang.String |
HORIZONTAL_ALIGNMENT_CHANGED_PROPERTY
|
static java.lang.String |
HORIZONTAL_TEXT_POSITION_CHANGED_PROPERTY
|
static java.lang.String |
ICON_CHANGED_PROPERTY
|
static java.lang.String |
ICON_TEXT_MARGIN_CHANGED_PROPERTY
|
static java.lang.String |
STYLE_HORIZONTAL_ALIGNMENT
A style constant for the Horizontal Alignment property. |
static java.lang.String |
STYLE_HORIZONTAL_TEXT_POSITION
A style constant for the Horizontal Text Position property. |
static java.lang.String |
STYLE_ICON_TEXT_MARGIN
A style constant for the Icon-Text Margin property. |
static java.lang.String |
STYLE_VERTICAL_ALIGNMENT
A style constant for the Vertical Alignment property. |
static java.lang.String |
STYLE_VERTICAL_TEXT_POSITION
A style constant for the Vertical Text Position property. |
static java.lang.String |
TEXT_CHANGED_PROPERTY
|
static java.lang.String |
VERTICAL_ALIGNMENT_CHANGED_PROPERTY
|
static java.lang.String |
VERTICAL_TEXT_POSITION_CHANGED_PROPERTY
|
Constructor Summary | |
---|---|
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. |
Method Summary | |
---|---|
void |
applyStyle(Style style)
Sets stylistic properties of this component based on a Style
object. |
int |
getHorizontalAlignment()
Returns the horizontal alignment of the text relative to the icon. |
int |
getHorizontalTextPosition()
Returns the horizontal position of the text relative to the icon. |
ImageReference |
getIcon()
Returns the icon. |
int |
getIconTextMargin()
Returns the size of the margin to be displayed between the icon and text The margin is only drawn if both icon and text are present. |
java.lang.String |
getText()
Returns the text. |
int |
getVerticalAlignment()
Returns the vertical alignment of the text relative to the icon. |
int |
getVerticalTextPosition()
Returns the vertical position of the text relative to the icon. |
void |
setHorizontalAlignment(int newValue)
Sets the horizontal alignment of the text relative to the icon. |
void |
setHorizontalTextPosition(int newValue)
Sets the horizontal position of the text relative to the icon. |
void |
setIcon(ImageReference newValue)
Sets the icon to be displayed. |
void |
setIconTextMargin(int newValue)
Sets the size of the margin to be displayed between the icon and text. |
void |
setText(java.lang.String newValue)
Sets the text to be displayed. |
void |
setVerticalAlignment(int newValue)
Sets the vertical alignment of the text relative to the icon. |
void |
setVerticalTextPosition(int newValue)
Sets the vertical position of the text relative to the icon. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String STYLE_HORIZONTAL_ALIGNMENT
public static final java.lang.String STYLE_HORIZONTAL_TEXT_POSITION
public static final java.lang.String STYLE_ICON_TEXT_MARGIN
public static final java.lang.String STYLE_VERTICAL_ALIGNMENT
public static final java.lang.String STYLE_VERTICAL_TEXT_POSITION
public static final java.lang.String HORIZONTAL_ALIGNMENT_CHANGED_PROPERTY
public static final java.lang.String HORIZONTAL_TEXT_POSITION_CHANGED_PROPERTY
public static final java.lang.String ICON_CHANGED_PROPERTY
public static final java.lang.String ICON_TEXT_MARGIN_CHANGED_PROPERTY
public static final java.lang.String TEXT_CHANGED_PROPERTY
public static final java.lang.String VERTICAL_ALIGNMENT_CHANGED_PROPERTY
public static final java.lang.String VERTICAL_TEXT_POSITION_CHANGED_PROPERTY
Constructor Detail |
---|
public Label()
public Label(java.lang.String text)
text
- The text to be displayed.public Label(ImageReference icon)
icon
- The icon to be displayed.public Label(java.lang.String text, ImageReference icon)
text
- The text to be displayed.icon
- The icon to be displayed.Method Detail |
---|
public void applyStyle(Style style)
Component
Style
object. The version of this method in Component
will set
foreground and background colors and the font from the style if they are
present. Components should override this method if they allow more
properties to be set from a style object, and should call
super.applyStyle() if necessary.
applyStyle
in interface Component
applyStyle
in class AbstractComponent
style
- The style object from which to retrieve properties for this
Component
.Component.applyStyle(Style)
public int getHorizontalAlignment()
public int getHorizontalTextPosition()
public ImageReference getIcon()
public int getIconTextMargin()
public java.lang.String getText()
public int getVerticalAlignment()
public int getVerticalTextPosition()
public void setHorizontalAlignment(int newValue)
newValue
- The horizontal alignment of the text relative to the icon,
one of the following values:
public void setHorizontalTextPosition(int newValue)
newValue
- The horizontal position of the text relative to the icon,
one of the following values.
public void setIcon(ImageReference newValue)
newValue
- The icon to be displayed.public void setIconTextMargin(int newValue)
newValue
- The size of the margin between the icon and text, in
pixels.public void setText(java.lang.String newValue)
newValue
- The text to be displayed.public void setVerticalAlignment(int newValue)
newValue
- The vertical alignment of the text relative to the icon,
one of the following values:
public void setVerticalTextPosition(int newValue)
newValue
- The vertical position of the text relative to the icon,
one of the following values.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |