 |
Crossfire JXClient, Trunk
|
Go to the documentation of this file.
23 package com.realtime.crossfire.jxclient.commands;
27 import org.jetbrains.annotations.NotNull;
57 public void execute(@NotNull
final String args) {
58 final CharSequence commands;
59 final boolean perCharacterBinding;
60 if (args.equals(
"-c")) {
61 perCharacterBinding =
true;
63 }
else if (args.startsWith(
"-c ")) {
64 perCharacterBinding =
true;
65 commands = args.substring(3).trim();
67 perCharacterBinding =
false;
71 if (!commands.isEmpty()) {
77 drawInfoError(
"Cannot use unbind -c since no character is logged in.");
87 final StringBuilder sb =
new StringBuilder();
88 sb.append(
"Unbinds a command from a key\n");
90 sb.append(
"Usage: unbind\n");
91 sb.append(
"Usage: unbind -c\n");
93 sb.append(
"Asks the user for a key, then de-associates the key from its bound command.\n");
94 sb.append(
"If the option -c is used, the key is unbound only from the current character. Otherwise the key is unbound from all characters on all Crossfire servers.\n");
95 sb.append(
"To abort an unbind command, press ESC.\n");
96 sb.append(
"Note: Bind a key: bind\n");
Implements the "unbind" command.
UnbindCommand(@NotNull final CommandCallback commandCallback, @NotNull final CrossfireServerConnection crossfireServerConnection)
Creates a new instance.
boolean allArguments()
Returns whether all remaining commands should be included as arguments.
Adds encoding/decoding of crossfire protocol packets to a ServerConnection.
String getHelp()
Returns the help text for this command.
Abstract base class for Command implementations.
final CommandCallback commandCallback
The CommandCallback to use.
void drawInfoError(@NotNull final String message)
Displays an error message.
boolean removeKeyBinding(boolean perCharacter)
Removes a key binding.
final CrossfireServerConnection crossfireServerConnection
The connection instance.
Interface that defines callback functions needed by commands.
void execute(@NotNull final String args)
Executes the command with the given arguments.