Class ToggleGUIButton
java.lang.Object
de.placeblock.betterinventories.content.GUISection
de.placeblock.betterinventories.content.item.GUIItem
de.placeblock.betterinventories.content.item.GUIButton
de.placeblock.betterinventories.content.item.impl.ToggleGUIButton
- All Implemented Interfaces:
Sizeable
GUIButton which toggles between on and off
-
Field Summary
Fields inherited from class de.placeblock.betterinventories.content.item.GUIItem
BUTTON_SIZE, itemStackFields inherited from class de.placeblock.betterinventories.content.GUISection
maxSize, minSize -
Constructor Summary
ConstructorsConstructorDescriptionToggleGUIButton(GUI gui) Creates a new ToggleGUIButtonToggleGUIButton(GUI gui, boolean toggled) Creates a new ToggleGUIButtonToggleGUIButton(GUI gui, String permission) Creates a new ToggleGUIButtonToggleGUIButton(GUI gui, String permission, boolean toggled) Creates a new ToggleGUIButton -
Method Summary
Methods inherited from class de.placeblock.betterinventories.content.item.GUIButton
applyCooldown, click, hasPermission, onClick, onLeftClick, onRightClick, onShiftClick, onShiftLeftClick, onShiftRightClick, setCooldownMethods inherited from class de.placeblock.betterinventories.content.item.GUIItem
getSectionAt, getSectionAt, renderMethods inherited from class de.placeblock.betterinventories.content.GUISection
getEmptyContentList, getHeight, getSlots, getWidth, setSize, slotToVector, vectorToSlotMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface de.placeblock.betterinventories.Sizeable
clampSize, getMaxSize, getMinSize, getSize
-
Constructor Details
-
ToggleGUIButton
Creates a new ToggleGUIButton- Parameters:
gui- The GUI
-
ToggleGUIButton
Creates a new ToggleGUIButton- Parameters:
gui- The GUItoggled- The default value of the toggled-state
-
ToggleGUIButton
Creates a new ToggleGUIButton- Parameters:
gui- The GUIpermission- The permission required to toggle
-
ToggleGUIButton
Creates a new ToggleGUIButton- Parameters:
gui- The GUIpermission- The permission required to toggletoggled- The default value of the toggled-state
-
-
Method Details
-
toggle
public void toggle()Toggles the state of the Button -
getEnabledItem
protected abstract org.bukkit.inventory.ItemStack getEnabledItem()- Returns:
- The Item for the enabled-state
-
getDisabledItem
protected abstract org.bukkit.inventory.ItemStack getDisabledItem()- Returns:
- The Item for the disabled-state
-
onToggle
protected abstract void onToggle(boolean toggled) Gets called when the Button gets toggled- Parameters:
toggled- The current state
-