Interface Icons

All Known Implementing Classes:
IconsImpl

public interface Icons
Central interface to provide UI components representing icons.
  • Method Summary

    Modifier and Type
    Method
    Description
    com.vaadin.flow.component.Component
    get(IconFactory<?> icon)
    Returns a UI Component representing an icon specified by the name of the passed IconFactory.
    com.vaadin.flow.component.Component
    get(String iconName)
    Returns a UI Component representing an icon specified by its name.
  • Method Details

    • get

      com.vaadin.flow.component.Component get(IconFactory<?> icon)
      Returns a UI Component representing an icon specified by the name of the passed IconFactory.

      This method attempts to create a Component for the given icon name. If the icon name contains ':' delimiter then a new Icon is created using icon collection and icon name values. Otherwise, it will attempt to locate and create the icon using predefined icon sets.

      Parameters:
      icon - the IconFactory instance to get the icon name from
      Returns:
      the Component representing the icon
      Throws:
      IllegalArgumentException - if the icon name is null or cannot be resolved as a valid icon component
    • get

      com.vaadin.flow.component.Component get(String iconName)
      Returns a UI Component representing an icon specified by its name.

      This method attempts to create a Component for the given icon name. If the icon name contains ':' delimiter then a new Icon is created using icon collection and icon name values. Otherwise, it will attempt to locate and create the icon using predefined icon sets.

      Parameters:
      iconName - the name of the icon
      Returns:
      the Component representing the icon
      Throws:
      IllegalArgumentException - if the icon name is null or cannot be resolved as a valid icon component