Package org.patternfly.component.badge
Class 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.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionstatic Badge
badge
(int count) static Badge
badge
(int count, int limit) bind
(ObservableValue<Integer> ov) Binds an observable value to this component.int
count()
count
(int count) Same as count(count, false)count
(int count, boolean fireEvent) Sets the count of this badge.Use a function to render the text for the value ofcount()
.limit
(int limit) Sets the limit of this badgemaxDisplay
(Function<Integer, String> maxDisplay) Use a function to render the text ifcount()
>limit(int)
.onChange
(ChangeHandler<Badge, Integer> changeHandler) Defines a change handler that is called when thevalue()
of this badge changes.read()
Marks the badge as read.screenReader
(String text) that()
unread()
Marks the badge as unread.value()
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, innerHtml, on, on, on, run, textContent, textNode, toggle, toggle, toggle, uniqueId
-
Method Details
-
badge
-
badge
-
read
Marks the badge as read. -
unread
Marks the badge as unread. -
count
Same as count(count, false) -
count
Sets the count of this badge. -
display
Use a function to render the text for the value ofcount()
. If not setString.valueOf(count)
is used implicitly. -
maxDisplay
Use a function to render the text ifcount()
>limit(int)
. If not setcount + "+"
is used implicitly. -
limit
Sets the limit of this badge -
screenReader
-
bind
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:
bind
in interfaceWithObservableValue<HTMLElement,
Badge, Integer>
-
that
- Specified by:
that
in interfaceTypedBuilder<HTMLElement,
Badge>
-
onChange
Defines a change handler that is called when thevalue()
of this badge changes. -
count
public int count() -
value
-