Constructor and Description |
---|
Shortcuts(@NotNull SpellsManager spellsManager)
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
void |
addShortcutsListener(@NotNull ShortcutsListener listener)
Adds a
ShortcutsListener . |
void |
clearShortcuts()
Clears all defined shortcuts.
|
@Nullable java.nio.file.Path |
getFile()
Returns the backing file.
|
@Nullable Shortcut |
getShortcut(@NotNull ShortcutSlot shortcutSlot)
Returns a shortcut.
|
@NotNull java.util.Iterator<Shortcut> |
iterator() |
void |
removeShortcutsListener(@NotNull ShortcutsListener listener)
Removes a
ShortcutsListener . |
void |
setFile(@Nullable java.nio.file.Path file)
Sets the backing file.
|
void |
setShortcutString(@NotNull ShortcutSlot shortcutSlot,
@NotNull java.lang.String command,
boolean saveChanges)
Sets a slot.
|
public Shortcuts(@NotNull @NotNull SpellsManager spellsManager)
spellsManager
- the instance to watchpublic void clearShortcuts()
@Nullable public @Nullable Shortcut getShortcut(@NotNull @NotNull ShortcutSlot shortcutSlot)
shortcutSlot
- the shortcut slotnull
if the shortcut is unsetpublic void setShortcutString(@NotNull @NotNull ShortcutSlot shortcutSlot, @NotNull @NotNull java.lang.String command, boolean saveChanges)
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 filepublic void addShortcutsListener(@NotNull @NotNull ShortcutsListener listener)
ShortcutsListener
.listener
- the listener to addpublic void removeShortcutsListener(@NotNull @NotNull ShortcutsListener listener)
ShortcutsListener
.listener
- the listener to remove@Nullable public @Nullable java.nio.file.Path getFile()
null
if unknownpublic void setFile(@Nullable @Nullable java.nio.file.Path file)
file
- the backing file or null
if unknown