Class Shortcuts
java.lang.Object
com.realtime.crossfire.jxclient.shortcuts.Shortcuts
Manages a list of
Shortcuts.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddShortcutsListener(@NotNull ShortcutsListener listener) Adds aShortcutsListener.voidClears all defined shortcuts.@Nullable PathgetFile()Returns the backing file.@Nullable ShortcutgetShortcut(@NotNull ShortcutSlot shortcutSlot) Returns a shortcut.iterator()voidremoveShortcutsListener(@NotNull ShortcutsListener listener) Removes aShortcutsListener.voidSets the backing file.voidsetShortcutString(@NotNull ShortcutSlot shortcutSlot, @NotNull String command, boolean saveChanges) Sets a slot.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
Shortcuts
Creates a new instance.- Parameters:
spellsManager- the instance to watch
-
-
Method Details
-
clearShortcuts
public void clearShortcuts()Clears all defined shortcuts. -
getShortcut
Returns a shortcut.- Parameters:
shortcutSlot- the shortcut slot- Returns:
- the shortcut or
nullif the shortcut is unset
-
setShortcutString
public void setShortcutString(@NotNull @NotNull ShortcutSlot shortcutSlot, @NotNull @NotNull String command, boolean saveChanges) Sets a slot.- Parameters:
shortcutSlot- the shortcut slot to updatecommand- the new command to set or an empty string to clear the slotsaveChanges- whether to save the change to the save file
-
addShortcutsListener
Adds aShortcutsListener.- Parameters:
listener- the listener to add
-
removeShortcutsListener
Removes aShortcutsListener.- Parameters:
listener- the listener to remove
-
getFile
Returns the backing file.- Returns:
- the backing file or
nullif unknown
-
setFile
Sets the backing file.- Parameters:
file- the backing file ornullif unknown
-
iterator
-