22 package com.realtime.crossfire.jxclient.commands;
30 import org.jetbrains.annotations.NotNull;
57 super(
"bind", crossfireServerConnection);
74 public void execute(@NotNull
final String args) {
75 final String commandList;
76 final boolean perCharacterBinding;
77 if (args.equals(
"-c")) {
78 perCharacterBinding =
true;
80 }
else if (args.startsWith(
"-c ")) {
81 perCharacterBinding =
true;
84 perCharacterBinding =
false;
88 if (commandList.isEmpty()) {
96 drawInfoError(
"Cannot use bind -c since no character is logged in.");
boolean allArguments()
Returns whether all remaining commands should be included as arguments.whether all remaining commands...
Abstract base class for Command implementations.
Utility class for string manipulation.
void drawInfoError(@NotNull final String message)
Displays an error message.
Implements the "bind" command.
final CrossfireServerConnection crossfireServerConnection
The connection instance.
boolean createKeyBinding(boolean perCharacter, @NotNull CommandList commandList)
Adds a key binding.
void add(@NotNull final GUICommand guiCommand)
Adds a command to the end of this command list.
GUICommand createCommand(@NotNull final String commandString)
Creates a new GUICommand instance from string representation.
Interface that defines callback functions needed by commands.
Factory for creating GUICommand instances from string representation.
final GUICommandFactory guiCommandFactory
The GUICommandFactory for creating commands.
final CommandCallback commandCallback
The CommandCallback to use.
AND
List is executed if all entries can execute.
Adds encoding/decoding of crossfire protocol packets to a ServerConnection.
A list of GUICommand instances.
BindCommand(@NotNull final CrossfireServerConnection crossfireServerConnection, @NotNull final CommandCallback commandCallback, @NotNull final GUICommandFactory guiCommandFactory)
Creates a new instance.
static String trimLeading(@NotNull final CharSequence str)
Removes leading whitespace from a string.
void execute(@NotNull final String args)
Executes the command with the given arguments.the command arguments