Package xyz.xenondevs.invui.window
Class AbstractWindow.AbstractBuilder<W extends Window,S extends Window.Builder<W,S>>
java.lang.Object
xyz.xenondevs.invui.window.AbstractWindow.AbstractBuilder<W,S>
- Type Parameters:
W- The type of the window.S- The type of the builder.
- All Implemented Interfaces:
Cloneable,Window.Builder<W,S>
- Direct Known Subclasses:
AbstractSingleWindow.AbstractBuilder,AbstractSplitWindow.AbstractBuilder
- Enclosing class:
AbstractWindow
public abstract static class AbstractWindow.AbstractBuilder<W extends Window,S extends Window.Builder<W,S>>
extends Object
implements Window.Builder<W,S>
Builder for a
AbstractWindow.
This class should only be used directly if you're creating a custom AbstractWindow.AbstractBuilder for a custom
AbstractWindow implementation. Otherwise, use the static builder functions in the Window interfaces,
such as Window.single() to obtain a builder.
-
Nested Class Summary
Nested classes/interfaces inherited from interface xyz.xenondevs.invui.window.Window.Builder
Window.Builder.Double<W extends Window,S extends Window.Builder.Double<W, S>>, Window.Builder.Normal<V, S extends Window.Builder.Normal<V, S>>, Window.Builder.Single<W extends Window, S extends Window.Builder.Single<W, S>> -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanprotected xyz.xenondevs.inventoryaccess.component.ComponentWrapperprotected org.bukkit.entity.Player -
Constructor Summary
Constructors -
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.protected voidapplyModifiers(W window) build()Builds theWindow.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.Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface xyz.xenondevs.invui.window.Window.Builder
build
-
Field Details
-
viewer
protected org.bukkit.entity.Player viewer -
title
protected xyz.xenondevs.inventoryaccess.component.ComponentWrapper title -
closeable
protected boolean closeable -
openHandlers
-
closeHandlers
-
outsideClickHandlers
-
modifiers
-
-
Constructor Details
-
AbstractBuilder
public AbstractBuilder()
-
-
Method Details
-
setViewer
Description copied from interface:Window.BuilderSets the viewer of theWindow.- Specified by:
setViewerin interfaceWindow.Builder<W extends Window,S extends Window.Builder<W, S>> - Parameters:
viewer- The viewer of theWindow- Returns:
- This
Window Builder
-
setTitle
@NotNull public S setTitle(@NotNull @NotNull xyz.xenondevs.inventoryaccess.component.ComponentWrapper title) Description copied from interface:Window.BuilderSets the title of theWindow.- Specified by:
setTitlein interfaceWindow.Builder<W extends Window,S extends Window.Builder<W, S>> - Parameters:
title- The title of theWindow- Returns:
- This
Window Builder
-
setTitle
@NotNull public S setTitle(@NotNull @NotNull net.md_5.bungee.api.chat.BaseComponent @NotNull [] title) Description copied from interface:Window.BuilderSets the title of theWindow.- Specified by:
setTitlein interfaceWindow.Builder<W extends Window,S extends Window.Builder<W, S>> - Parameters:
title- The title of theWindow- Returns:
- This
Window Builder
-
setTitle
Description copied from interface:Window.BuilderSets the title of theWindow.- Specified by:
setTitlein interfaceWindow.Builder<W extends Window,S extends Window.Builder<W, S>> - Parameters:
title- The title of theWindow- Returns:
- This
Window Builder
-
setCloseable
Description copied from interface:Window.BuilderConfigures if theWindowis closeable.- Specified by:
setCloseablein interfaceWindow.Builder<W extends Window,S extends Window.Builder<W, S>> - Parameters:
closeable- If theWindowis closeable- Returns:
- This
Window Builder
-
setOpenHandlers
Description copied from interface:Window.BuilderSets the open handlers of theWindow.- Specified by:
setOpenHandlersin interfaceWindow.Builder<W extends Window,S extends Window.Builder<W, S>> - Parameters:
openHandlers- The open handlers of theWindow- Returns:
- This
Window Builder
-
addOpenHandler
Description copied from interface:Window.BuilderAdds an open handler to theWindow.- Specified by:
addOpenHandlerin interfaceWindow.Builder<W extends Window,S extends Window.Builder<W, S>> - Parameters:
openHandler- The open handler to add- Returns:
- This
Window Builder
-
setCloseHandlers
Description copied from interface:Window.BuilderSets the close handlers of theWindow.- Specified by:
setCloseHandlersin interfaceWindow.Builder<W extends Window,S extends Window.Builder<W, S>> - Parameters:
closeHandlers- The close handlers of theWindow- Returns:
- This
Window Builder
-
addCloseHandler
Description copied from interface:Window.BuilderAdds a close handler to theWindow.- Specified by:
addCloseHandlerin interfaceWindow.Builder<W extends Window,S extends Window.Builder<W, S>> - Parameters:
closeHandler- The close handler to add- Returns:
- This
Window Builder
-
setOutsideClickHandlers
@NotNull public S setOutsideClickHandlers(@NotNull @NotNull List<@NotNull Consumer<@NotNull org.bukkit.event.inventory.InventoryClickEvent>> outsideClickHandlers) Description copied from interface:Window.BuilderSets the outside click handlers of theWindow.- Specified by:
setOutsideClickHandlersin interfaceWindow.Builder<W extends Window,S extends Window.Builder<W, S>> - Parameters:
outsideClickHandlers- The outside click handlers of theWindow- Returns:
- This
Window Builder
-
addOutsideClickHandler
@NotNull public S addOutsideClickHandler(@NotNull @NotNull Consumer<@NotNull org.bukkit.event.inventory.InventoryClickEvent> outsideClickHandler) Description copied from interface:Window.BuilderAdds an outside click handler to theWindow.- Specified by:
addOutsideClickHandlerin interfaceWindow.Builder<W extends Window,S extends Window.Builder<W, S>> - Parameters:
outsideClickHandler- The outside click handler to add- Returns:
- This
Window Builder
-
setModifiers
Description copied from interface:Window.BuilderSets the modifiers of theWindow.- Specified by:
setModifiersin interfaceWindow.Builder<W extends Window,S extends Window.Builder<W, S>> - Parameters:
modifiers- The modifiers of theWindow- Returns:
- This
Window Builder
-
addModifier
Description copied from interface:Window.BuilderAdds a modifier to theWindow.- Specified by:
addModifierin interfaceWindow.Builder<W extends Window,S extends Window.Builder<W, S>> - Parameters:
modifier- The modifier to add- Returns:
- This
Window Builder
-
applyModifiers
-
build
Description copied from interface:Window.BuilderBuilds theWindow.- Specified by:
buildin interfaceWindow.Builder<W extends Window,S extends Window.Builder<W, S>> - Returns:
- The built
Window
-
open
public void open(org.bukkit.entity.Player viewer) Description copied from interface:Window.BuilderBuilds and shows theWindowto the specified viewer. If this method is used, the viewer does not need to be set usingWindow.Builder.setViewer(Player).- Specified by:
openin interfaceWindow.Builder<W extends Window,S extends Window.Builder<W, S>> - Parameters:
viewer- ThePlayerto show theWindowto.
-
clone
Description copied from interface:Window.BuilderClones theWindow Builder.- Specified by:
clonein interfaceWindow.Builder<W extends Window,S extends Window.Builder<W, S>> - Overrides:
clonein classObject- Returns:
- The cloned
Window Builder
-