Class PredefinedIcon

java.lang.Object
org.patternfly.icon.PredefinedIcon
All Implemented Interfaces:
ElementAttributeMethods<SVGElement, PredefinedIcon>, ElementClassListMethods<SVGElement, PredefinedIcon>, ElementConsumerMethods<SVGElement, PredefinedIcon>, ElementEventMethods<SVGElement, PredefinedIcon>, ElementIdMethods<SVGElement, PredefinedIcon>, ElementQueryMethods<SVGElement>, ElementTextMethods<SVGElement, PredefinedIcon>, IsElement<SVGElement>, SVGElementDataMethods<SVGElement, PredefinedIcon>, SVGElementStyleMethods<SVGElement, PredefinedIcon>, TypedBuilder<SVGElement, PredefinedIcon>

The PredefinedIcon class represents a predefined SVG icon. It implements SVG builder interfaces and provides methods for creating and configuring the SVG element for the icon.
  • Field Details

    • iconSpec

      public final IconSpec iconSpec
  • Method Details

    • predefinedIcon

      public static PredefinedIcon predefinedIcon(String name)
      Constructs a predefined SVG icon based on the provided icon name. The method supports multiple icon groups, such as "fab", "far", "fas", and "patternfly". If the name contains a group prefix (e.g., "fab.iconName"), the method will use that group; otherwise, it defaults to the "fas" group.

      Normally you should use the static methods from IconSets to get predefined icons. Only use this method if you need to get an icon based on the icon name provided as string.

      Parameters:
      name - the name of the icon, optionally prefixed with the group name (e.g., "fab.iconName"). If no group is specified, "fas" is used by default.
      Returns:
      a PredefinedIcon instance representing the specified icon.
      Throws:
      IllegalArgumentException - if the group or icon name is unknown.
    • element

      public SVGElement element()
      Specified by:
      element in interface IsElement<SVGElement>
    • that

      public PredefinedIcon that()
      Specified by:
      that in interface TypedBuilder<SVGElement, PredefinedIcon>