Interface Window.Builder<W extends Window,S extends Window.Builder<W,S>>

Type Parameters:
W - The window type
S - 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.
  • Method Details

    • setViewer

      @Contract("_ -> this") @NotNull S setViewer(@NotNull @NotNull org.bukkit.entity.Player viewer)
      Sets the viewer of the Window.
      Parameters:
      viewer - The viewer of the Window
      Returns:
      This Window Builder
    • setTitle

      @Contract("_ -> this") @NotNull S setTitle(@NotNull @NotNull xyz.xenondevs.inventoryaccess.component.ComponentWrapper title)
      Sets the title of the Window.
      Parameters:
      title - The title of the Window
      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 the Window.
      Parameters:
      title - The title of the Window
      Returns:
      This Window Builder
    • setTitle

      @Contract("_ -> this") @NotNull S setTitle(@NotNull @NotNull String title)
      Sets the title of the Window.
      Parameters:
      title - The title of the Window
      Returns:
      This Window Builder
    • setCloseable

      @Contract("_ -> this") @NotNull S setCloseable(boolean closeable)
      Configures if the Window is closeable.
      Parameters:
      closeable - If the Window is closeable
      Returns:
      This Window Builder
    • setOpenHandlers

      @Contract("_ -> this") @NotNull S setOpenHandlers(@Nullable @Nullable List<@NotNull Runnable> openHandlers)
      Sets the open handlers of the Window.
      Parameters:
      openHandlers - The open handlers of the Window
      Returns:
      This Window Builder
    • addOpenHandler

      @Contract("_ -> this") @NotNull S addOpenHandler(@NotNull @NotNull Runnable openHandler)
      Adds an open handler to the Window.
      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 the Window.
      Parameters:
      closeHandlers - The close handlers of the Window
      Returns:
      This Window Builder
    • addCloseHandler

      @Contract("_ -> this") @NotNull S addCloseHandler(@NotNull @NotNull Runnable closeHandler)
      Adds a close handler to the Window.
      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 the Window.
      Parameters:
      outsideClickHandlers - The outside click handlers of the Window
      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 the Window.
      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 the Window.
      Parameters:
      modifiers - The modifiers of the Window
      Returns:
      This Window Builder
    • addModifier

      @Contract("_ -> this") @NotNull S addModifier(@NotNull @NotNull Consumer<@NotNull W> modifier)
      Adds a modifier to the Window.
      Parameters:
      modifier - The modifier to add
      Returns:
      This Window Builder
    • build

      @Contract("-> new") @NotNull W build()
      Builds the Window.
      Returns:
      The built Window
    • build

      @Contract("_ -> new") @NotNull W build(org.bukkit.entity.Player viewer)
      Builds the Window with the specified viewer. If this method is used, the viewer does not need to be set using setViewer(Player).
      Parameters:
      viewer - The Player to build the Window for.
      Returns:
      The built Window.
    • open

      void open(org.bukkit.entity.Player viewer)
      Builds and shows the Window to the specified viewer. If this method is used, the viewer does not need to be set using setViewer(Player).
      Parameters:
      viewer - The Player to show the Window to.
    • clone

      @Contract("-> new") @NotNull S clone()
      Clones the Window Builder.
      Returns:
      The cloned Window Builder