Interface IHtml

All Superinterfaces:
IAnyGroup<IHtml>, IComponent<IHtml>, IHtmlBasedComponent<IHtml>, IXulElement<IHtml>

public interface IHtml extends IXulElement<IHtml>, IAnyGroup<IHtml>
Immutable Html component

A component used to embed the browser native content (i.e., HTML tags) into the output sent to the browser. The browser native content is specified by withContent(java.lang.String).

Notice that Html generates HTML SPAN to enclose the embedded HTML tags. Thus, you can specify the style (IHtmlBasedComponent.getStyle()), tooltip IXulElement.getTooltip() and so on.

Author:
katherine
See Also:
  • Html
  • Field Details

    • DEFAULT

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

    • getWidgetClass

      default String getWidgetClass()
      Returns the client widget class.

      Default: "zul.wgt.Html"

      Specified by:
      getWidgetClass in interface IComponent<IHtml>
    • getContent

      default String getContent()
      Returns the embedded content (i.e., HTML tags).
    • withContent

      IHtml withContent(String content)
      Returns a copy of this immutable component with the specified content.

      Sets the embedded content (i.e., HTML tags).

      Security Note

      Unlike other methods, the content assigned to this method is generated directly to the browser without escaping. Thus, it is better not to have something input by the user to avoid any XSS attach.

      Parameters:
      content - The HTML content.

      Default: "".

      Returns:
      A modified copy of the this object
    • of

      static IHtml of(String content)
      Returns the instance with the given content.
      Parameters:
      content - The HTML content
    • ofId

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