Interface HtmlAttributes

All Known Implementing Classes:
HtmlAttributesImpl

public interface HtmlAttributes
Sets DOM and CSS attributes to UI component widgets.
See Also:
  • Field Details

  • Method Details

    • setDomAttribute

      void setDomAttribute(Component component, String attributeName, String value)
      Sets DOM attribute on the top most element of UI component.
      Parameters:
      component - UI component
      attributeName - DOM attribute name, e.g. "title"
      value - attribute value
      See Also:
    • setDomAttribute

      void setDomAttribute(Component component, String querySelector, String attributeName, String value)
      Sets DOM attribute for all nested elements of UI component corresponding to the given query selector.
      Parameters:
      component - UI component
      querySelector - a string containing one or more selectors to match. This string must be a valid CSS selector string
      attributeName - DOM attribute name, e.g. "title"
      value - attribute value
      See Also:
    • getDomAttribute

      @Nullable String getDomAttribute(Component component, String attributeName)
      Gets DOM attribute value assigned using HtmlAttributes. Does not reflect a real value from DOM.
      Parameters:
      component - UI component
      attributeName - DOM attribute name
      Returns:
      previously assigned DOM attribute value
      See Also:
    • getDomAttribute

      @Nullable String getDomAttribute(Component component, String querySelector, String attributeName)
      Gets DOM attribute value assigned using HtmlAttributes. Does not reflect a real value from DOM.
      Parameters:
      component - UI component
      querySelector - a string containing one or more selectors to match. This string must be a valid CSS selector string
      attributeName - DOM attribute name
      Returns:
      previously assigned DOM attribute value
      See Also:
    • removeDomAttribute

      void removeDomAttribute(Component component, String attributeName)
      Removes DOM attribute from the top most element of UI component.
      Parameters:
      component - UI component
      attributeName - DOM attribute name
      See Also:
    • removeDomAttribute

      void removeDomAttribute(Component component, String querySelector, String attributeName)
      Removes DOM attribute for all nested elements of UI component corresponding to the given query selector.
      Parameters:
      component - UI component
      querySelector - a string containing one or more selectors to match. This string must be a valid CSS selector string
      attributeName - DOM attribute name
      See Also:
    • setCssProperty

      void setCssProperty(Component component, String propertyName, String value)
      Sets CSS property value on the top most element of UI component.
      Parameters:
      component - UI component
      propertyName - CSS property name, e.g. "border-color"
      value - property value
      See Also:
    • setCssProperty

      void setCssProperty(Component component, String querySelector, String propertyName, String value)
      Sets CSS property value for all nested elements of UI component corresponding to the given query selector.
      Parameters:
      component - UI component
      querySelector - a string containing one or more selectors to match. This string must be a valid CSS selector string
      propertyName - CSS property name, e.g. "border-color"
      value - property value
      See Also:
    • getCssProperty

      @Nullable String getCssProperty(Component component, String propertyName)
      Gets CSS property value assigned using HtmlAttributes. Does not reflect a real value from DOM.
      Parameters:
      component - UI component
      propertyName - CSS property name
      Returns:
      previously assigned CSS property value
      See Also:
    • getCssProperty

      @Nullable String getCssProperty(Component component, String querySelector, String propertyName)
      Gets CSS property value assigned using HtmlAttributes. Does not reflect a real value from DOM.
      Parameters:
      component - UI component
      querySelector - a string containing one or more selectors to match. This string must be a valid CSS selector string
      propertyName - CSS property name
      Returns:
      previously assigned CSS property value
      See Also:
    • removeCssProperty

      void removeCssProperty(Component component, String propertyName)
      Clears CSS property value from the top most element of UI component.
      Parameters:
      component - UI component
      propertyName - CSS property name
      See Also:
    • removeCssProperty

      void removeCssProperty(Component component, String querySelector, String propertyName)
      Clears CSS property value for all nested elements of UI component corresponding to the given query selector.
      Parameters:
      component - UI component
      querySelector - a string containing one or more selectors to match. This string must be a valid CSS selector string
      propertyName - CSS property name
      See Also:
    • applyCss

      void applyCss(Component component, String css)
      Apply CSS properties from CSS string;
      Parameters:
      component - UI component
      css - CSS string
      See Also:
    • applyCss

      void applyCss(Component component, String querySelector, String css)
      Apply CSS properties from CSS string;
      Parameters:
      component - UI component
      querySelector - a string containing one or more selectors to match. This string must be a valid CSS selector string
      css - CSS string
      See Also: