Interface ButtonManager


public interface ButtonManager
The `ButtonManager` interface provides a centralized management system for buttons, allowing the creation, registration, and retrieval of various types of buttons through designated loaders. Documentation: ButtonManager Documentation

To create a Button, use a ButtonLoader, and then register it with the `ButtonManager`.

Buttons can be managed by plugins using this interface, facilitating dynamic menu creation and interaction.

  • Method Details

    • register

      void register(ButtonLoader button)
      Registers a new ButtonLoader for handling button creation.
      Parameters:
      button - The new ButtonLoader to register.
    • unregister

      void unregister(ButtonLoader button)
      Unregisters a ButtonLoader to stop handling button creation.
      Parameters:
      button - The ButtonLoader to unregister.
    • unregisters

      void unregisters(org.bukkit.plugin.Plugin plugin)
      Unregisters all ButtonLoaders associated with a specific plugin.
      Parameters:
      plugin - The plugin for which to unregister all loaders.
    • getLoaders

      Collection<ButtonLoader> getLoaders()
      Retrieves a collection of all registered ButtonLoaders.
      Returns:
      A collection of ButtonLoaders.
    • getLoaders

      Collection<ButtonLoader> getLoaders(org.bukkit.plugin.Plugin plugin)
      Retrieves a collection of ButtonLoaders associated with a specific plugin.
      Parameters:
      plugin - The plugin for which to retrieve loaders.
      Returns:
      A collection of ButtonLoaders or an empty collection if none are found.
    • getLoader

      Optional<ButtonLoader> getLoader(Class<? extends Button> classz)
      Retrieves a ButtonLoader based on the class of the associated Button.
      Parameters:
      classz - Class of Button.
      Returns:
      An optional ButtonLoader.
    • getLoader

      Optional<ButtonLoader> getLoader(String name)
      Retrieves a ButtonLoader based on the name of the associated Button.
      Parameters:
      name - The name of the ButtonLoader.
      Returns:
      An optional ButtonLoader.
    • registerPermissible

      void registerPermissible(PermissibleLoader permissibleLoader)
      Registers a new PermissibleLoader for handling permissible creation.
      Parameters:
      permissibleLoader - The new PermissibleLoader to register.
    • getPermissibles

      Map<String,PermissibleLoader> getPermissibles()
      Retrieves a map of permissible keys and associated PermissibleLoaders.
      Returns:
      A map of permissible keys to PermissibleLoaders.
    • getPermission

      Optional<PermissibleLoader> getPermission(String key)
      Retrieves an optional PermissibleLoader based on a permissible key.
      Parameters:
      key - The key associated with the permissible.
      Returns:
      An optional PermissibleLoader.
    • registerAction

      void registerAction(ActionLoader actionLoader)
      Registers a new ActionLoader for handling action creation.
      Parameters:
      actionLoader - The new ActionLoader to register.
    • getActionLoader

      Optional<ActionLoader> getActionLoader(String key)
      Retrieves an optional ActionLoader based on an action key.
      Parameters:
      key - The key associated with the action.
      Returns:
      An optional ActionLoader.
    • loadPermissible

      List<fr.maxlego08.menu.api.requirement.Permissible> loadPermissible(List<Map<String,Object>> elements, String path, File file)
      Transforms a list of map elements from a configuration file into a list of permissibles.
      Parameters:
      elements - List of items from the configuration containing the entire configuration of a permissible.
      path - The path to or from the list of permissibles.
      file - The current configuration file.
      Returns:
      A list of Permissibles.
    • loadActions

      List<fr.maxlego08.menu.api.requirement.Action> loadActions(List<Map<String,Object>> elements, String path, File file)
      Transforms a list of map elements from a configuration file into a list of actions. Documentation about actions: Action Documentation
      Parameters:
      elements - List of items from the configuration containing the entire configuration of an action.
      path - The path to or from the list of actions.
      file - The current configuration file.
      Returns:
      A list of Actions.