 |
Crossfire JXClient, Trunk
|
Go to the documentation of this file.
23 package com.realtime.crossfire.jxclient.commands;
28 import java.util.Map.Entry;
29 import org.jetbrains.annotations.NotNull;
60 public void execute(@NotNull
final String args) {
61 final Iterable<Entry<KeyBinding, String>> bindings =
keybindingsManager.
getBindings(binding -> binding.getCommandString().contains(args)).entrySet();
63 for (Entry<KeyBinding, String> e : bindings) {
73 final StringBuilder sb =
new StringBuilder();
74 sb.append(
"Shows defined keybindings\n");
76 sb.append(
"Usage: bindings\n");
77 sb.append(
"Usage: bindings <command>\n");
79 sb.append(
"The first form shows all currently active keybindings. ");
80 sb.append(
"If <command> is given, shows only keybindings which include the given (partial) command.\n");
81 sb.append(
"The first column shows where the key binding is defined: ");
85 sb.append(
"Note: Bind a key: bind\n");
86 sb.append(
"Note: Unbind a key: unbind\n");
String getCommandString()
Returns the commands as a string.
Implements the "bindings" command, listing currently active keybindings (for both a character and the...
Adds encoding/decoding of crossfire protocol packets to a ServerConnection.
BindingsCommand(@NotNull final CrossfireServerConnection crossfireServerConnection, @NotNull final KeybindingsManager keybindingsManager)
Creates a new instance.
Abstract base class for Command implementations.
static final String DEFAULT
The source identification string for default key bindings.
static final String GLOBAL
The source identification string for global key bindings.
Abstract base class for key bindings.
Map< KeyBinding, String > getBindings(@NotNull final Predicate< KeyBinding > predicate)
Searches bindings having a command text starting with the specified value.
String getHelp()
Returns the help text for this command.
String getBindingDescription()
Return the binding as a human-readable text.
boolean allArguments()
Returns whether all remaining commands should be included as arguments.
final CrossfireServerConnection crossfireServerConnection
The connection instance.
final KeybindingsManager keybindingsManager
Where to find bindings information.
static final String CHARACTER
The source identification string for per-character key bindings.
void drawInfo(@NotNull final String message)
Displays a regular output message.
void execute(@NotNull final String args)
Executes the command with the given arguments.