Class StaticClickHandler

java.lang.Object
de.clickism.clickgui.menu.handler.StaticClickHandler
All Implemented Interfaces:
ClickHandler

public class StaticClickHandler extends Object implements ClickHandler
A click handler that does not allow changing the inventory of a menu in any way.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates a new static click handler.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    handleClick(org.bukkit.event.inventory.InventoryClickEvent event)
    Handles a click on a menu.
    void
    handleDrag(org.bukkit.event.inventory.InventoryDragEvent event)
    Handles the drag on the menu.
    protected boolean
    isIllegalDoubleClick(org.bukkit.event.inventory.InventoryClickEvent event)
    Checks if the given click is an illegal double click, resulting in items being taken away from the menu.
    protected boolean
    isIllegalShiftClick(org.bukkit.event.inventory.InventoryClickEvent event)
    Checks if the given click is an illegal shift click, resulting in items being taken away from the menu.
    boolean
    isValidClick(org.bukkit.event.inventory.InventoryClickEvent event)
    Checks if a given click is valid.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • StaticClickHandler

      public StaticClickHandler()
      Creates a new static click handler.
  • Method Details

    • handleClick

      public boolean handleClick(org.bukkit.event.inventory.InventoryClickEvent event)
      Description copied from interface: ClickHandler
      Handles a click on a menu. If the given click was processed by the handler and should not be passed onto the menu, it should return true. Otherwise, it should return false.
      Specified by:
      handleClick in interface ClickHandler
      Parameters:
      event - event to handle
      Returns:
      true if the click was handled, false otherwise
    • handleDrag

      public void handleDrag(org.bukkit.event.inventory.InventoryDragEvent event)
      Description copied from interface: ClickHandler
      Handles the drag on the menu.
      Specified by:
      handleDrag in interface ClickHandler
      Parameters:
      event - event to handle
    • isValidClick

      public boolean isValidClick(org.bukkit.event.inventory.InventoryClickEvent event)
      Description copied from interface: ClickHandler
      Checks if a given click is valid.
      Specified by:
      isValidClick in interface ClickHandler
      Parameters:
      event - event to validate
      Returns:
      true if click is valid, false otherwise
    • isIllegalShiftClick

      protected boolean isIllegalShiftClick(org.bukkit.event.inventory.InventoryClickEvent event)
      Checks if the given click is an illegal shift click, resulting in items being taken away from the menu.
      Parameters:
      event - event to check
      Returns:
      true if the click is an illegal shift click, false otherwise
    • isIllegalDoubleClick

      protected boolean isIllegalDoubleClick(org.bukkit.event.inventory.InventoryClickEvent event)
      Checks if the given click is an illegal double click, resulting in items being taken away from the menu.
      Parameters:
      event - event to check
      Returns:
      true if the click is an illegal double click, false otherwise