22 package com.realtime.crossfire.jxclient.commands;
29 import org.jetbrains.annotations.NotNull;
49 super(
"set", crossfireServerConnection);
65 public void execute(@NotNull
final String args) {
67 if (tmp.length != 2) {
68 drawInfoError(
"The set command needs two arguments: set <option> <value>");
72 final String optionName = tmp[0];
73 final String optionArgs = tmp[1];
82 final boolean checked;
93 drawInfoError(
"The '"+optionArgs+
"' for option '"+optionName+
"' is invalid. Valid arguments are 'on' or 'off'.");
boolean allArguments()
Returns whether all remaining commands should be included as arguments.whether all remaining commands...
Abstract base class for Command implementations.
SetCommand(@NotNull final CrossfireServerConnection crossfireServerConnection, @NotNull final OptionManager optionManager)
Creates a new instance.
void setChecked(final boolean checked)
Sets the current state.
void drawInfoError(@NotNull final String message)
Displays an error message.
final CrossfireServerConnection crossfireServerConnection
The connection instance.
Maintains a set of named options.
CheckBoxOption getCheckBoxOption(@NotNull final String optionName)
Returns a check box option.
void execute(@NotNull final String args)
Executes the command with the given arguments.the command arguments
Implements the command "set".
Indicates about an incorrect option.
static final Pattern PATTERN_WHITESPACE
The pattern to split a command from arguments, and to split arguments.
Utility class containing useful Patterns.
Adds encoding/decoding of crossfire protocol packets to a ServerConnection.
final OptionManager optionManager
The option manager instance.
The base class for all check box options.