 |
Crossfire JXClient, Trunk
|
Go to the documentation of this file.
23 package com.realtime.crossfire.jxclient.gui.commands;
33 import org.jetbrains.annotations.NotNull;
88 if (currentPasswordField ==
null || newPasswordField ==
null || confirmPasswordField ==
null) {
92 final String currentPassword = currentPasswordField.
getText();
93 final String newPassword = newPasswordField.
getText();
94 final String confirmPassword = confirmPasswordField.
getText();
96 if (newPassword.isEmpty()) {
99 error.
setText(
"Can't have an empty password!");
103 if (!confirmPassword.equals(newPassword)) {
106 error.
setText(
"Passwords don't match!");
Abstract base class for text input fields.
Combines a list of GUIElements to for a gui.
Gui getGui(@NotNull final AbstractGUIElement element)
Returns the Gui an element is part of.
void execute()
Executes the command.
final CommandCallback commandCallback
The CommandCallback to use.
A GUICommand sending an account password change request.
Abstract base class for GUI elements to be shown in Guis.
Abstract base class for all label classes.
void accountPassword(@NotNull String currentPassword, @NotNull String newPassword)
Change the account password.
final GuiFactory guiFactory
The global GuiFactory instance.
AccountPasswordCommand(@NotNull final CommandCallback commandCallback, @NotNull final AbstractGUIElement button, @NotNull final GuiFactory guiFactory)
Creates a new instance.
void setText(@NotNull final String text)
Sets the label text.
boolean canExecute()
Returns whether this command may be executed.
Factory for creating Gui instances.
A GUIHTMLLabel that displays the last received "failure" message.
Interface that defines callback functions needed by commands.
public< T extends GUIElement > T getFirstElement(@NotNull final Class< T > class_)
Returns the first gui element of this gui belonging to the given class.
String getText()
Returns the entered text.
final AbstractGUIElement element
The AbstractGUIElement to find the Gui containing the fields.