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>
public class Badge
extends BaseComponent<HTMLElement, Badge>
implements HasObservableValue<HTMLElement, Badge, Integer>, HasValue<Integer>
A badge is used to annotate other information like a label or an object name.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionstatic Badgebadge(int count) static Badgebadge(int count, int limit) bind(ObservableValue<Integer> ov) Binds an observable value to this component.intcount()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 BaseComponent
componentType, element, registerComponentMethods inherited from class Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ElementAttributeMethods
aria, aria, aria, attr, attr, attr, role, roleMethods inherited from interface ElementClassListMethods
classList, classList, css, toggle, toggle, toggleMethods inherited from interface ElementConsumerMethods
apply, runMethods inherited from interface ElementContainerMethods
add, add, add, add, addAll, addAll, addAll, addAll, addAll, addAllMethods inherited from interface ElementEventMethods
on, on, onMethods inherited from interface ElementIdMethods
id, uniqueIdMethods inherited from interface ElementQueryMethods
closest, querySelector, querySelectorAllMethods inherited from interface HTMLElementAttributeMethods
titleMethods inherited from interface HTMLElementDataMethods
data, dataMethods inherited from interface HTMLElementVisibilityMethods
hidden
-
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
-
maxDisplay
-
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:
bindin interfaceHasObservableValue<HTMLElement, Badge, Integer>
-
that
- Specified by:
thatin interfaceTypedBuilder<HTMLElement, Badge>
-
onChange
Defines a change handler that is called when thevalue()of this badge changes. -
count
public int count() -
value
-