21 package com.realtime.crossfire.jxclient.gui.commands;
28 import java.awt.Component;
29 import org.jetbrains.annotations.NotNull;
77 final GUIText loginField = gui.getFirstElement(
GUIText.class,
"account_login");
78 final GUIText passwordField = gui.getFirstElement(
GUIText.class,
"account_password");
80 if (loginField == null || passwordField == null) {
84 final String login = loginField.
getText();
85 final String password = passwordField.
getText();
static Gui getGui(@NotNull final Component element)
Returns the Gui an element is part of.
Combines a list of GUIElements to for a gui.
A GUICommand sending an account login request to the server.
void execute()
Executes the command.Does nothing if called while canExecute() returnsfalse .
String getText()
Returns the entered text.
final Component element
The Component to find information for account creation.
AccountLoginCommand(@NotNull final CommandCallback commandCallback, @NotNull final Component button)
Creates a new instance.
Utility class for Gui related functions.
void accountLogin(@NotNull String login, @NotNull String password)
Login to an account.
Interface that defines callback functions needed by commands.
final CommandCallback commandCallback
The CommandCallback to use.
Abstract base class for text input fields.
boolean canExecute()
Returns whether this command may be executed.whether this command may be executed ...