Interface ILabel

All Superinterfaces:
IAnyGroup<ILabel>, IChildrenOfInputgroup<ILabel>, IComponent<ILabel>, IHtmlBasedComponent<ILabel>, IXulElement<ILabel>

public interface ILabel extends IXulElement<ILabel>, IAnyGroup<ILabel>, IChildrenOfInputgroup<ILabel>
Immutable Label component

A label component represents a piece of text.

Author:
jumperchen
See Also:
  • Label
  • Field Details

    • DEFAULT

      static final ILabel DEFAULT
      Constant for default attributes of this immutable component.
  • Method Details

    • getWidgetClass

      default String getWidgetClass()
      Returns the client widget class.

      Default: "zul.wgt.Label"

      Specified by:
      getWidgetClass in interface IComponent<ILabel>
    • getValue

      default String getValue()
      Returns the value.

      Default: "".

    • withValue

      ILabel withValue(String value)
      Returns a copy of this immutable component with the specified value.

      Sets the value of the component

      Parameters:
      value - The value of the component

      Default: "".

      Returns:
      A modified copy of the this object
    • getMaxlength

      default int getMaxlength()
      Returns the maximal length of the label.

      Default: 0 (means no limitation)

    • withMaxlength

      ILabel withMaxlength(int maxlength)
      Returns a copy of this immutable component with the specified maxlength.

      Sets the maximal length of the label.

      Parameters:
      maxlength - The maximal length of the label.

      Default: 0.

      Returns:
      A modified copy of the this object
    • isMultiline

      default boolean isMultiline()
      Returns whether to preserve the new line and the white spaces at the beginning of each line.

      Default: false

    • withMultiline

      ILabel withMultiline(boolean multiline)
      Returns a copy of this immutable component with the specified multiline.

      Sets whether to preserve the new line and the white spaces at the beginning of each line.

      Parameters:
      multiline - Whether to preserve the new line and the white spaces at the beginning of each line.

      Default: false.

      Returns:
      A modified copy of the this object
    • isPre

      default boolean isPre()
      Returns whether to preserve the white spaces, such as space, tab and new line.

      It is the same as style="white-space:pre".

      Note: the new line is preserved either isPre() or isMultiline() returns true.

    • withPre

      ILabel withPre(boolean pre)
      Returns a copy of this immutable component with the specified pre.

      Sets whether to preserve the white spaces, such as space, tab and new line.

      Parameters:
      pre - Whether to preserve the white spaces, such as space, tab and new line.

      Default: false.

      Returns:
      A modified copy of the this object
    • of

      static ILabel of(String value)
      Returns the instance with the given value.
      Parameters:
      value - The value of the component.
    • ofId

      static ILabel ofId(String id)
      Returns the instance with the given id.
      Parameters:
      id - The id to identify this component