Package org.patternfly.component.badge
Class Badge
- java.lang.Object
-
- org.patternfly.component.BaseComponent<HTMLElement,Badge>
-
- org.patternfly.component.badge.Badge
-
- All Implemented Interfaces:
Container<HTMLElement,Badge>,Finder<HTMLElement>,HasElement<HTMLElement,Badge>,HasHTMLElement<HTMLElement,Badge>,IsElement<HTMLElement>,TypedBuilder<HTMLElement,Badge>,Component,HasValue<Integer>,WithObservableValue<HTMLElement,Badge,Integer>
public class Badge extends BaseComponent<HTMLElement,Badge> implements HasValue<Integer>, WithObservableValue<HTMLElement,Badge,Integer>
A badge is used to annotate other information like a label or an object name.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Badgebadge(int count)static Badgebadge(int count, int limit)Badgebind(ObservableValue<Integer> ov)Binds an observable value to this component.intcount()Badgecount(int count)Same as count(count, false)Badgecount(int count, boolean fireEvent)Sets the count of this badge.Badgedisplay(Function<Integer,String> display)Use a function to render the text for the value ofcount().Badgelimit(int limit)Sets the limit of this badgeBadgemaxDisplay(Function<Integer,String> maxDisplay)Use a function to render the text ifcount()>limit(int).BadgeonChange(ChangeHandler<Badge,Integer> changeHandler)Defines a change handler that is called when thevalue()of this badge changes.Badgeread()Marks the badge as read.BadgescreenReader(String text)Badgethat()Badgeunread()Marks the badge as unread.Integervalue()-
Methods inherited from class org.patternfly.component.BaseComponent
componentType, element
-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.jboss.elemento.Container
add, add, add, addAll, addAll, addAll, addAll, addAll, addAll
-
Methods inherited from interface org.jboss.elemento.HasElement
add, apply, aria, aria, aria, attr, attr, attr, classList, classList, css, id, id, innerHtml, on, run, textContent, textNode, toggle, toggle, toggle, uniqueId
-
-
-
-
Method Detail
-
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)
Same as count(count, false)
-
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 ofcount(). If not setString.valueOf(count)is used implicitly.
-
maxDisplay
public Badge maxDisplay(Function<Integer,String> maxDisplay)
Use a function to render the text ifcount()>limit(int). If not setcount + "+"is used implicitly.
-
limit
public Badge limit(int limit)
Sets the limit of this badge
-
bind
public Badge bind(ObservableValue<Integer> ov)
Binds an observable value to this component. If you're using an observable value, you must not usecount(int)orcount(int, boolean)to set the value. UseObservableValue.set(Object)instead.- Specified by:
bindin interfaceWithObservableValue<HTMLElement,Badge,Integer>
-
that
public Badge that()
- Specified by:
thatin interfaceTypedBuilder<HTMLElement,Badge>
-
onChange
public Badge onChange(ChangeHandler<Badge,Integer> changeHandler)
Defines a change handler that is called when thevalue()of this badge changes.
-
count
public int count()
-
-