ilog.webui.dhtml.components

Class IlxWLabel

  • All Implemented Interfaces:
    ilog.webui.dhtml.IlxWConstants, ilog.webui.dhtml.IlxWCSSModelProvider, ilog.webui.dhtml.IlxWDependencyProvider, ilog.webui.dhtml.IlxWJSObject, java.io.Serializable
    Direct Known Subclasses:
    IlxWDefaultListCellRenderer


    public class IlxWLabel
    extends IlxWComponent
    A label component. A label component is made up of two children:
    • An icon component (IlxWIcon).
    • A text element component (IlxWTextElement).
    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:
    • 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.

    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
    • Constructor Detail

      • IlxWLabel

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

        public IlxWLabel(java.lang.String text)
        Creates a label with the given text.
    • Method Detail

      • setText

        public void setText(java.lang.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
      • setIconPath

        public void setIconPath(java.lang.String resourceName)
        Sets the icon path. This will internally set the "path" CSS style of the icon component child.
        See Also:
        IlxWIcon
      • 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.

© Copyright IBM Corp. 1987, 2017