java.lang.Object
com.realtime.crossfire.jxclient.shortcuts.Shortcuts
All Implemented Interfaces:
Iterable<Shortcut>

public class Shortcuts extends Object implements Iterable<Shortcut>
Manages a list of Shortcuts.
  • Constructor Details

    • Shortcuts

      public Shortcuts(@NotNull @NotNull SpellsManager spellsManager)
      Creates a new instance.
      Parameters:
      spellsManager - the instance to watch
  • Method Details

    • clearShortcuts

      public void clearShortcuts()
      Clears all defined shortcuts.
    • getShortcut

      @Nullable public @Nullable Shortcut getShortcut(@NotNull @NotNull ShortcutSlot shortcutSlot)
      Returns a shortcut.
      Parameters:
      shortcutSlot - the shortcut slot
      Returns:
      the shortcut or null if 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 update
      command - the new command to set or an empty string to clear the slot
      saveChanges - whether to save the change to the save file
    • addShortcutsListener

      public void addShortcutsListener(@NotNull @NotNull ShortcutsListener listener)
      Parameters:
      listener - the listener to add
    • removeShortcutsListener

      public void removeShortcutsListener(@NotNull @NotNull ShortcutsListener listener)
      Parameters:
      listener - the listener to remove
    • getFile

      @Nullable public @Nullable Path getFile()
      Returns the backing file.
      Returns:
      the backing file or null if unknown
    • setFile

      public void setFile(@Nullable @Nullable Path file)
      Sets the backing file.
      Parameters:
      file - the backing file or null if unknown
    • iterator

      @NotNull public @NotNull Iterator<Shortcut> iterator()
      Specified by:
      iterator in interface Iterable<Shortcut>