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 TypeMethodDescriptionbooleanapply(@NotNull UUID uuid, @NotNull ActionItem actionItem) Apply actions to the action item@Nullable ButtonGet the button@Nullable ButtonGet the fallback buttonGet the view predicatevoidinit()Initialize the element.voidSet the buttonvoidsetFallbackButton(@Nullable Button fallbackButton) Set the fallback buttonvoidsetViewPredicate(@NotNull Predicate<@NotNull UUID> viewPredicate) Set the view predicatevoidstop()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:ButtonApply actions to the action item -
init
public void init()Description copied from interface:ElementInitialize the element. Should be called before adding to the GUI. -
stop
public void stop()Description copied from interface:ElementStop the element. Should be called after removing from the GUI.
-