public class IlxWLabel extends IlxWComponent
IlxWIcon).IlxWTextElement).text-position and icon-text-gap CSS styles.
text-position style determines the position of the
text element relative to the icon. Possible values are:
left: The text element is rendered to the left of the icon.right: The icon is rendered to the right of the
text element.hidden: The icon is hidden, only the text component is
displayed.icon-text-gap style determines the number of white
spaces separating the icon and the text element.
Here is an example of creating and setting up a label:
IlxWLabel label = new IlxWLabel("my caption");
label.setIconPath("/mypackage/myimage.gif");
label.getStyle().set("textPosition", "left");
label.getStyle().set("iconTextGap", "1");
IlxWIcon,
IlxWTextElement,
Serialized FormIlxWComponent.DynamicStyleMaplistenerList| Constructor and Description |
|---|
IlxWLabel()
Creates a label with empty path and text.
|
IlxWLabel(java.lang.String text)
Creates a label with the given text.
|
| Modifier and Type | Method and Description |
|---|---|
IlxWIcon |
getIcon()
Gets the icon component child.
|
java.lang.String |
getIconPath()
Gets the icon path.
|
java.lang.String |
getText()
Gets the text of the label.
|
IlxWTextElement |
getTextElement()
Gets the text element component child.
|
protected void |
printComponent(IlxWPort port)
Prints the HTML code that will display the graphical
representation of this component.
|
void |
setIconPath(java.lang.String resourceName)
Sets the icon path.
|
void |
setText(java.lang.String text)
Sets the text of the label.
|
addPropertyChangeListener, addPropertyChangeListener, detach, doPrint, firePropertyChange, firePropertyChange, getName, getRealHtmlTagName, getStyle, invalidate, isInvalidated, notifyDependencies, print, removePropertyChangeListener, removePropertyChangeListener, setName, validateadd, add, getAttribute, getAttributeNames, getComponent, getComponentCount, getComponentNamed, getComponents, getManager, getParent, getUserAgentRules, indexOf, isAncestorOf, remove, remove, removeAll, removeAttribute, setAttribute, setAuthorRules, setFinalizerpublic IlxWLabel()
public IlxWLabel(java.lang.String text)
public void setText(java.lang.String text)
getText(),
IlxWTextElementpublic java.lang.String getText()
setText(java.lang.String)public void setIconPath(java.lang.String resourceName)
IlxWIconpublic java.lang.String getIconPath()
setIconPath(java.lang.String)public IlxWTextElement getTextElement()
public IlxWIcon getIcon()
protected void printComponent(IlxWPort port) throws java.io.IOException
IlxWComponentIlxWComponent.print(ilog.webui.dhtml.IlxWPort) method.printComponent in class IlxWComponentjava.io.IOExceptionport - The port on which the component will be printed.IlxWComponent.print(ilog.webui.dhtml.IlxWPort)© Copyright IBM Corp. 1987, 2017