Class Badge

All Implemented Interfaces:
ElementAttributeMethods<HTMLElement, Badge>, ElementClassListMethods<HTMLElement, Badge>, ElementConsumerMethods<HTMLElement, Badge>, ElementContainerMethods<HTMLElement, Badge>, ElementEventMethods<HTMLElement, Badge>, ElementIdMethods<HTMLElement, Badge>, ElementQueryMethods<HTMLElement>, HTMLElementAttributeMethods<HTMLElement, Badge>, HTMLElementDataMethods<HTMLElement, Badge>, HTMLElementStyleMethods<HTMLElement, Badge>, HTMLElementVisibilityMethods<HTMLElement, Badge>, IsElement<HTMLElement>, TypedBuilder<HTMLElement, Badge>, Component, HasObservableValue<HTMLElement, Badge, Integer>, HasValue<Integer>, org.patternfly.core.OuiaSupport<HTMLElement, Badge>

A badge is used to annotate other information like a label or an object name.
See Also:
  • Method Details

    • badge

      public static Badge badge(int count)
    • badge

      public static Badge badge(int count, int limit)
    • read

      public Badge read()
      Marks the badge as read.
    • unread

      public Badge unread()
      Marks the badge as unread.
    • count

      public Badge count(int count)
    • count

      public Badge count(int count, boolean fireEvent)
      Sets the count of this badge.
    • display

      public Badge display(Function<Integer,String> display)
      Use a function to render the text for the value of count(). If not set String.valueOf(count) is used implicitly.
    • maxDisplay

      public Badge maxDisplay(Function<Integer,String> maxDisplay)
      Use a function to render the text if count() > limit(int). If not set count + "+" is used implicitly.
    • limit

      public Badge limit(int limit)
      Sets the limit of this badge
    • screenReader

      public Badge screenReader(String text)
    • bind

      public Badge bind(org.patternfly.core.ObservableValue<Integer> ov)
      Binds an observable value to this component. If you're using an observable value, you must not use count(int) or count(int, boolean) to set the value. Use ObservableValue.set(Object) instead.
      Specified by:
      bind in interface HasObservableValue<HTMLElement, Badge, Integer>
    • that

      public Badge that()
      Specified by:
      that in interface TypedBuilder<HTMLElement, Badge>
    • onChange

      public Badge onChange(org.patternfly.handler.ChangeHandler<Badge,Integer> changeHandler)
      Defines a change handler that is called when the value() of this badge changes.
    • count

      public int count()
    • value

      public Integer value()
      Specified by:
      value in interface HasValue<Integer>