Class PredicateButton
java.lang.Object
io.github.projectunified.craftux.button.PredicateButton
The conditional button that chooses a button based on a specific predicate
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
apply
(@NotNull UUID uuid, @NotNull ActionItem actionItem) Apply actions to the action item@Nullable Button
Get the button@Nullable Button
Get the fallback buttonGet the view predicatevoid
init()
Initialize the element.void
Set the buttonvoid
setFallbackButton
(@Nullable Button fallbackButton) Set the fallback buttonvoid
setViewPredicate
(@NotNull Predicate<@NotNull UUID> viewPredicate) Set the view predicatevoid
stop()
Stop the element.
-
Constructor Details
-
PredicateButton
public PredicateButton()
-
-
Method Details
-
getViewPredicate
Get the view predicate- Returns:
- the view predicate
-
setViewPredicate
Set the view predicate- Parameters:
viewPredicate
- the view predicate
-
getButton
Get the button- Returns:
- the button
-
setButton
Set the button- Parameters:
button
- the button
-
getFallbackButton
Get the fallback button- Returns:
- the fallback button
-
setFallbackButton
Set the fallback button- Parameters:
fallbackButton
- the fallback button
-
apply
Description copied from interface:Button
Apply actions to the action item -
init
public void init()Description copied from interface:Element
Initialize the element. Should be called before adding to the GUI. -
stop
public void stop()Description copied from interface:Element
Stop the element. Should be called after removing from the GUI.
-