public void selectAll() { textfield.selectAll(); }
public void onAuthenticationFailure(final Throwable ex) { this.usernameField.focus(); this.usernameField.selectAll(); NotificationBuilder.showNotification("Unable to authenticate", (ex != null ? ex.getMessage() : "The user name and password provided is incorrect."), 20000); }
public void buttonClick(ClickEvent event) { Button button = event.getButton(); button.setEnabled(false); try { String username = (String) nameField.getValue(); String password = (String) passwordField.getValue(); if (m_loginFunction.login(username, password)) { m_log.log(LOG_INFO, "Apache Ace WebUI succesfull login by user: " + username); closeWindow(); } else { m_log.log(LOG_WARNING, "Apache Ace WebUI invalid username or password entered."); m_additionalInfo.setValue("Invalid username or password!"); nameField.focus(); nameField.selectAll(); } } finally { button.setEnabled(true); } } });
/** * Handles adding a key. Calls the registered listener and wraps it's method in some GUI adjustments. */ void handleAddKey() { String key = m_addKeyInput.getValue(); if (m_listener.handleAddKey(key)) { Notification.show( key.isEmpty() ? m_messages.key(Messages.GUI_NOTIFICATION_MESSAGEBUNDLEEDITOR_EMPTY_KEY_SUCCESSFULLY_ADDED_0) : m_messages.key(Messages.GUI_NOTIFICATION_MESSAGEBUNDLEEDITOR_KEY_SUCCESSFULLY_ADDED_1, key)); } else { CmsMessageBundleEditorTypes.showWarning( m_messages.key(Messages.GUI_NOTIFICATION_MESSAGEBUNDLEEDITOR_KEY_ALREADEY_EXISTS_CAPTION_0), m_messages.key(Messages.GUI_NOTIFICATION_MESSAGEBUNDLEEDITOR_KEY_ALREADEY_EXISTS_DESCRIPTION_1, key)); } m_addKeyInput.focus(); m_addKeyInput.selectAll(); }
public LoginPanel() { setSpacing(true); setMargin(true); setClosable(false); setSizeFull(); m_name = new TextField("Name", ""); m_password = new PasswordField("Password", ""); m_loginButton = new Button("Login"); addComponent(m_name); addComponent(m_password); addComponent(m_loginButton); setComponentAlignment(m_loginButton, Alignment.BOTTOM_CENTER); m_name.focus(); m_name.selectAll(); m_loginButton.addListener(new Button.ClickListener() { public void buttonClick(ClickEvent event) { if (login((String) m_name.getValue(), (String) m_password.getValue())) { closeWindow(); } else { // TODO provide some feedback, login failed, for now don't close the login window m_loginButton.setComponentError(new UserError("Invalid username or password.")); } } }); } }
m_inputField.selectAll(); m_inputField.setImmediate(true);