Package xyz.xenondevs.invui.window
Interface Window.Builder<W extends Window,S extends Window.Builder<W,S>>
- Type Parameters:
W- The window typeS- The builder type
- All Superinterfaces:
Cloneable
- All Known Subinterfaces:
AnvilWindow.Builder<S>,AnvilWindow.Builder.Single,AnvilWindow.Builder.Split,CartographyWindow.Builder<S>,CartographyWindow.Builder.Single,CartographyWindow.Builder.Split,Window.Builder.Double<W,,S> Window.Builder.Normal<V,,S> Window.Builder.Normal.Merged,Window.Builder.Normal.Single,Window.Builder.Normal.Split,Window.Builder.Single<W,S>
- All Known Implementing Classes:
AbstractSingleWindow.AbstractBuilder,AbstractSplitWindow.AbstractBuilder,AbstractWindow.AbstractBuilder
- Enclosing interface:
Window
public static interface Window.Builder<W extends Window,S extends Window.Builder<W,S>>
extends Cloneable
A
Window builder.-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceWindow.Builder.Double<W extends Window,S extends Window.Builder.Double<W, S>> A doubleWindowbuilder.static interfaceWindow.Builder.Normal<V,S extends Window.Builder.Normal<V, S>> static interfaceWindow.Builder.Single<W extends Window,S extends Window.Builder.Single<W, S>> A singleWindowbuilder. -
Method Summary
Modifier and TypeMethodDescriptionaddCloseHandler(@NotNull Runnable closeHandler) Adds a close handler to theWindow.addModifier(@NotNull Consumer<@NotNull W> modifier) Adds a modifier to theWindow.addOpenHandler(@NotNull Runnable openHandler) Adds an open handler to theWindow.addOutsideClickHandler(@NotNull Consumer<@NotNull org.bukkit.event.inventory.InventoryClickEvent> outsideClickHandler) Adds an outside click handler to theWindow.build()Builds theWindow.build(org.bukkit.entity.Player viewer) Builds theWindowwith the specified viewer.clone()Clones theWindow Builder.voidopen(org.bukkit.entity.Player viewer) Builds and shows theWindowto the specified viewer.setCloseable(boolean closeable) Configures if theWindowis closeable.setCloseHandlers(@Nullable List<@NotNull Runnable> closeHandlers) Sets the close handlers of theWindow.setModifiers(@Nullable List<@NotNull Consumer<@NotNull W>> modifiers) Sets the modifiers of theWindow.setOpenHandlers(@Nullable List<@NotNull Runnable> openHandlers) Sets the open handlers of theWindow.setOutsideClickHandlers(@NotNull List<@NotNull Consumer<@NotNull org.bukkit.event.inventory.InventoryClickEvent>> outsideClickHandlers) Sets the outside click handlers of theWindow.Sets the title of theWindow.setTitle(@NotNull net.md_5.bungee.api.chat.BaseComponent @NotNull [] title) Sets the title of theWindow.setTitle(@NotNull xyz.xenondevs.inventoryaccess.component.ComponentWrapper title) Sets the title of theWindow.setViewer(@NotNull org.bukkit.entity.Player viewer) Sets the viewer of theWindow.
-
Method Details
-
setViewer
Sets the viewer of theWindow.- Parameters:
viewer- The viewer of theWindow- Returns:
- This
Window Builder
-
setTitle
@Contract("_ -> this") @NotNull S setTitle(@NotNull @NotNull xyz.xenondevs.inventoryaccess.component.ComponentWrapper title) Sets the title of theWindow.- Parameters:
title- The title of theWindow- Returns:
- This
Window Builder
-
setTitle
@Contract("_ -> this") @NotNull S setTitle(@NotNull @NotNull net.md_5.bungee.api.chat.BaseComponent @NotNull [] title) Sets the title of theWindow.- Parameters:
title- The title of theWindow- Returns:
- This
Window Builder
-
setTitle
Sets the title of theWindow.- Parameters:
title- The title of theWindow- Returns:
- This
Window Builder
-
setCloseable
Configures if theWindowis closeable.- Parameters:
closeable- If theWindowis closeable- Returns:
- This
Window Builder
-
setOpenHandlers
@Contract("_ -> this") @NotNull S setOpenHandlers(@Nullable @Nullable List<@NotNull Runnable> openHandlers) Sets the open handlers of theWindow.- Parameters:
openHandlers- The open handlers of theWindow- Returns:
- This
Window Builder
-
addOpenHandler
Adds an open handler to theWindow.- Parameters:
openHandler- The open handler to add- Returns:
- This
Window Builder
-
setCloseHandlers
@Contract("_ -> this") @NotNull S setCloseHandlers(@Nullable @Nullable List<@NotNull Runnable> closeHandlers) Sets the close handlers of theWindow.- Parameters:
closeHandlers- The close handlers of theWindow- Returns:
- This
Window Builder
-
addCloseHandler
Adds a close handler to theWindow.- Parameters:
closeHandler- The close handler to add- Returns:
- This
Window Builder
-
setOutsideClickHandlers
@Contract("_ -> this") @NotNull S setOutsideClickHandlers(@NotNull @NotNull List<@NotNull Consumer<@NotNull org.bukkit.event.inventory.InventoryClickEvent>> outsideClickHandlers) Sets the outside click handlers of theWindow.- Parameters:
outsideClickHandlers- The outside click handlers of theWindow- Returns:
- This
Window Builder
-
addOutsideClickHandler
@Contract("_ -> this") @NotNull S addOutsideClickHandler(@NotNull @NotNull Consumer<@NotNull org.bukkit.event.inventory.InventoryClickEvent> outsideClickHandler) Adds an outside click handler to theWindow.- Parameters:
outsideClickHandler- The outside click handler to add- Returns:
- This
Window Builder
-
setModifiers
@Contract("_ -> this") @NotNull S setModifiers(@Nullable @Nullable List<@NotNull Consumer<@NotNull W>> modifiers) Sets the modifiers of theWindow.- Parameters:
modifiers- The modifiers of theWindow- Returns:
- This
Window Builder
-
addModifier
Adds a modifier to theWindow.- Parameters:
modifier- The modifier to add- Returns:
- This
Window Builder
-
build
Builds theWindow.- Returns:
- The built
Window
-
build
Builds theWindowwith the specified viewer. If this method is used, the viewer does not need to be set usingsetViewer(Player). -
open
void open(org.bukkit.entity.Player viewer) Builds and shows theWindowto the specified viewer. If this method is used, the viewer does not need to be set usingsetViewer(Player).- Parameters:
viewer- ThePlayerto show theWindowto.
-
clone
Clones theWindow Builder.- Returns:
- The cloned
Window Builder
-