Package space.maxus.flare.ui.compose
Interface Checkbox
- All Superinterfaces:
Composable,ComposableLike,Configurable<Checkbox>,Disable,ProviderRendered
A checkbox is a clickable component that is toggled on click.
See more in Flare docs: Checkbox
See more in Flare docs: Checkbox
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface space.maxus.flare.ui.compose.Configurable
Configurable.Configurator<S> -
Method Summary
Modifier and TypeMethodDescriptionstatic @NotNull Checkbox.Builderbuilder()Creates a new Checkbox builder.static @NotNull ItemStackBuildercheckedBuilder(String message, String description) Standard item builder for unchecked checkboxstatic @NotNull ItemProvidercheckedItem(String message, String description) Standard item provider for checked checkboxReturns the reactive toggle state of the checkbox.voidclick(@NotNull org.bukkit.event.inventory.InventoryClickEvent e) Called each time this item is clicked, no matter if it is a right click, left click, middle click, etc.Returns the reactive disabled state of the elementdefault booleanGets whether the checkbox is checked.static @NotNull Checkboxof(ItemProvider checkedProvider, ItemProvider uncheckedProvider) Creates a new Checkbox with the given checked and unchecked item providers.static @NotNull Checkboxof(ItemProvider checkedProvider, ItemProvider uncheckedProvider, boolean isChecked) Creates a new Checkbox with the given checked and unchecked item providers.default voidsetChecked(boolean checked) Sets whether the checkbox is checked.default voidtoggle()Toggles the checkbox.static @NotNull ItemStackBuilderuncheckedBuilder(String message, String description) Standard item builder for checked checkboxstatic @NotNull ItemProvideruncheckedItem(String message, String description) Standard item provider for unchecked checkboxMethods inherited from interface space.maxus.flare.ui.Composable
asComposable, bind, context, contextOrNull, destroy, drag, injectRoot, inside, into, leftClick, markDirty, restore, rightClick, root, shiftFrom, shiftInto, viewerMethods inherited from interface space.maxus.flare.ui.compose.Configurable
configure, configureTypedMethods inherited from interface space.maxus.flare.ui.compose.Disable
isDisabled, isNotDisabled, setDisabledMethods inherited from interface space.maxus.flare.ui.compose.ProviderRendered
getProvider, renderAt
-
Method Details
-
checkedItem
@Contract("_, _ -> new") @NotNull static @NotNull ItemProvider checkedItem(String message, String description) Standard item provider for checked checkbox- Parameters:
message- Message in the item namedescription- Description of the item- Returns:
- Standard item provider for checked checkbox
-
uncheckedItem
@Contract("_, _ -> new") @NotNull static @NotNull ItemProvider uncheckedItem(String message, String description) Standard item provider for unchecked checkbox- Parameters:
message- Message in the item namedescription- Description of the item- Returns:
- Standard item provider for unchecked checkbox
-
uncheckedBuilder
Standard item builder for checked checkbox- Parameters:
message- Message in the item namedescription- Description of the item- Returns:
- Standard item builder for checked checkbox
-
checkedBuilder
@Contract("_, _ -> new") @NotNull static @NotNull ItemStackBuilder checkedBuilder(String message, String description) Standard item builder for unchecked checkbox- Parameters:
message- Message in the item namedescription- Description of the item- Returns:
- Standard item builder for unchecked checkbox
-
builder
Creates a new Checkbox builder.- Returns:
- Checkbox builder
-
of
@Contract("_, _ -> new") @NotNull static @NotNull Checkbox of(ItemProvider checkedProvider, ItemProvider uncheckedProvider) Creates a new Checkbox with the given checked and unchecked item providers.- Parameters:
checkedProvider- Item provider for checked checkboxuncheckedProvider- Item provider for unchecked checkbox- Returns:
- Checkbox with the given checked and unchecked item providers.
-
of
@Contract("_, _, _ -> new") @NotNull static @NotNull Checkbox of(ItemProvider checkedProvider, ItemProvider uncheckedProvider, boolean isChecked) Creates a new Checkbox with the given checked and unchecked item providers.- Parameters:
checkedProvider- Item provider for checked checkboxuncheckedProvider- Item provider for unchecked checkboxisChecked- Whether the checkbox is toggled on by default- Returns:
- Checkbox with the given checked and unchecked item providers.
-
click
void click(@NotNull @NotNull org.bukkit.event.inventory.InventoryClickEvent e) Description copied from interface:ComposableCalled each time this item is clicked, no matter if it is a right click, left click, middle click, etc.- Specified by:
clickin interfaceComposable- Parameters:
e- The click event
-
toggle
default void toggle()Toggles the checkbox. -
isChecked
default boolean isChecked()Gets whether the checkbox is checked.- Returns:
- Whether the checkbox is checked.
-
setChecked
default void setChecked(boolean checked) Sets whether the checkbox is checked.- Parameters:
checked- Whether the checkbox is checked.
-
disabledState
ReactiveState<Boolean> disabledState()Description copied from interface:DisableReturns the reactive disabled state of the element- Specified by:
disabledStatein interfaceDisable- Returns:
- The reactive disabled state of the element
-
checkedState
ReactiveState<Boolean> checkedState()Returns the reactive toggle state of the checkbox.- Returns:
- The reactive toggle state of the checkbox.
-