Interface HtmlDecoratedLabelBuilder


public interface HtmlDecoratedLabelBuilder
Protocol: the following methods can be used only in this order:
1. link(PortalLink, boolean) or link(HtmlLink, boolean)
2. icon(HtmlLink)
3. append()
4. finished()

Other methods can be used in any order, but each one only once and only before calling finished()
Since:
3.9.0
  • Method Details

    • link

      @NotNull HtmlDecoratedLabelBuilder link(@Nullable PortalLink link, boolean inNewWindow)
      Decorates the label with the <a> tag with href pointing to the specified link when the link is not empty. Can be called only once. Never returns null even when the link was null and will not be used.
      Parameters:
      link - can be null
      inNewWindow - link will be opened in a new window
      Throws:
      IllegalStateException - if it was called in wrong order
    • link

      @NotNull HtmlDecoratedLabelBuilder link(@Nullable HtmlLink link, boolean inNewWindow)
      Decorates the label with the <a> tag with href pointing to the specified link when the link is not empty. Can be called only once. Never returns null even when the link was null and will not be used.
      Parameters:
      link - can be null
      inNewWindow - link will be opened in a new window
      Throws:
      IllegalStateException - if it was called in wrong order
    • icon

      @NotNull HtmlDecoratedLabelBuilder icon(@Nullable HtmlLink iconUrl, @Nullable String tooltip)
      Decorates the label with the icon when the iconUrl is not empty. Can be called several times. Never returns null even when the iconUrl was empty and the icon will not be used.
      Parameters:
      iconUrl - can be null or empty
      tooltip - can be null or empty
      Throws:
      IllegalStateException - if it was called in wrong order
    • icon

      @NotNull HtmlDecoratedLabelBuilder icon(@Nullable HtmlLink iconUrl)
      Decorates the label with the icon when the iconUrl is not empty. Can be called several times. Never returns null even when the iconUrl was empty and the icon will not be used.
      Parameters:
      iconUrl - can be null or empty
      Throws:
      IllegalStateException - if it was called in wrong order
    • iconClassName

      @NotNull HtmlDecoratedLabelBuilder iconClassName(@Nullable String className)
      Sets class name to the icon. Does nothing if the icon(HtmlLink) method was not called or called with null.
    • append

      @NotNull HtmlContentBuilder append()
      Returns builder for appending content.
      Throws:
      IllegalStateException - after finished() was called.
    • tooltip

      @NotNull HtmlDecoratedLabelBuilder tooltip(@Nullable String value)
      Throws:
      IllegalStateException - after finished() was called.
    • styleNoWrap

      @NotNull HtmlDecoratedLabelBuilder styleNoWrap(boolean value)
      Throws:
      IllegalStateException - after finished() was called.
    • finished

      void finished()
      This method will be only for performance improvements in the future, but now it should be called after the client is finished adding content, because it ensures interoperability with some old code.
      Throws:
      IllegalStateException - if already was called before
    • iconBuilders

      @NotNull ReadOnlyStrictList<HtmlTagBuilder> iconBuilders()
      The method returns tag builders for each icon created using method icon(HtmlLink) or icon(HtmlLink, String).
      Since:
      3.9.2