Decision Center API

ilog.webui.dhtml.components
Class IlxWLabel

java.lang.Object
  extended by ilog.webui.dhtml.IlxWContainer
      extended by ilog.webui.dhtml.IlxWComponent
          extended by ilog.webui.dhtml.components.IlxWLabel
All Implemented Interfaces:
ilog.webui.dhtml.IlxWConstants, ilog.webui.dhtml.IlxWCSSModelProvider, ilog.webui.dhtml.IlxWDependencyProvider, ilog.webui.dhtml.IlxWJSObject, Serializable
Direct Known Subclasses:
IlxWDefaultListCellRenderer

public class IlxWLabel
extends IlxWComponent

A label component. A label component is made up of two children:

The rendering of these components depends on the value of the text-position and icon-text-gap CSS styles.
The text-position style determines the position of the text element relative to the icon. Possible values are:
The 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");

 

See Also:
IlxWIcon, IlxWTextElement, Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class ilog.webui.dhtml.IlxWComponent
IlxWComponent.DynamicStyleMap
 
Field Summary
 
Fields inherited from class ilog.webui.dhtml.IlxWContainer
listenerList
 
Constructor Summary
IlxWLabel()
          Creates a label with empty path and text.
IlxWLabel(String text)
          Creates a label with the given text.
 
Method Summary
 IlxWIcon getIcon()
          Gets the icon component child.
 String getIconPath()
          Gets the icon path.
 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(String resourceName)
          Sets the icon path.
 void setText(String text)
          Sets the text of the label.
 
Methods inherited from class ilog.webui.dhtml.IlxWComponent
addPropertyChangeListener, addPropertyChangeListener, detach, doPrint, firePropertyChange, firePropertyChange, getName, getRealHtmlTagName, getStyle, invalidate, isInvalidated, notifyDependencies, print, removePropertyChangeListener, removePropertyChangeListener, setName, validate
 
Methods inherited from class ilog.webui.dhtml.IlxWContainer
add, add, getAttribute, getAttributeNames, getComponent, getComponentCount, getComponentNamed, getComponents, getManager, getParent, getUserAgentRules, indexOf, isAncestorOf, remove, remove, removeAll, removeAttribute, setAttribute, setAuthorRules, setFinalizer
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IlxWLabel

public IlxWLabel()
Creates a label with empty path and text.


IlxWLabel

public IlxWLabel(String text)
Creates a label with the given text.

Method Detail

setText

public void setText(String text)
Sets the text of the label. This will internally set the "text" CSS style of the text element child.

See Also:
getText(), IlxWTextElement

getText

public String getText()
Gets the text of the label.

See Also:
setText(java.lang.String)

setIconPath

public void setIconPath(String resourceName)
Sets the icon path. This will internally set the "path" CSS style of the icon component child.

See Also:
IlxWIcon

getIconPath

public String getIconPath()
Gets the icon path.

Returns:
The icon path.
See Also:
setIconPath(java.lang.String)

getTextElement

public IlxWTextElement getTextElement()
Gets the text element component child.

Returns:
The text component that is part of the label.

getIcon

public IlxWIcon getIcon()
Gets the icon component child.

Returns:
The icon component that is part of the label.

printComponent

protected void printComponent(IlxWPort port)
                       throws IOException
Description copied from class: IlxWComponent
Prints the HTML code that will display the graphical representation of this component. This method is called by the IlxWComponent.print(ilog.webui.dhtml.IlxWPort) method.

Specified by:
printComponent in class IlxWComponent
Throws:
IOException
Parameters:
port - The port on which the component will be printed.
See Also:
IlxWComponent.print(ilog.webui.dhtml.IlxWPort)

Decision Center API

© Copyright IBM Corp. 1987, 2013