private void readCookie() { if (!useCookie) { return; } final Cookie usernameCookie = getCookieByName(SP_LOGIN_USER); if (usernameCookie != null) { final String previousUser = usernameCookie.getValue(); if (isAllowedCookieValue(previousUser)) { username.setValue(previousUser); password.focus(); } } else { username.focus(); } final Cookie tenantCookie = getCookieByName(SP_LOGIN_TENANT); if (tenantCookie != null && multiTenancyIndicator.isMultiTenancySupported()) { final String previousTenant = tenantCookie.getValue(); if (isAllowedCookieValue(previousTenant)) { tenant.setValue(previousTenant.toUpperCase()); } } else if (multiTenancyIndicator.isMultiTenancySupported()) { tenant.focus(); } else { username.focus(); } }
@Override public void buttonClick(ClickEvent event) { if ("".equals(password.getValue())) { password.focus(); return; } error.setCaption(""); if (listener != null && listener.doLogin(username.getValue(),password.getValue())) { signin.removeShortcutListener(enter); } else { // Add new error message error.setCaption(MNls.find(LoginPanel.this, "login.error=Wrong username or password.")); username.focus(); } } });
private void readCookie() { if (!useCookie) { return; } final Cookie usernameCookie = getCookieByName(SP_LOGIN_USER); if (usernameCookie != null) { final String previousUser = usernameCookie.getValue(); if (isAllowedCookieValue(previousUser)) { username.setValue(previousUser); password.focus(); } } else { username.focus(); } final Cookie tenantCookie = getCookieByName(SP_LOGIN_TENANT); if (tenantCookie != null && multiTenancyIndicator.isMultiTenancySupported()) { final String previousTenant = tenantCookie.getValue(); if (isAllowedCookieValue(previousTenant)) { tenant.setValue(previousTenant.toUpperCase()); } } else if (multiTenancyIndicator.isMultiTenancySupported()) { tenant.focus(); } else { username.focus(); } }
@Override protected void initContent(VerticalLayout layout) throws Exception { label = new Label(message); label.setContentMode(ContentMode.HTML); layout.addComponent(label); textField = new PasswordField(); textField.setValue(txtInput); textField.setWidth("100%"); textField.focus(); textField.addShortcutListener(new ShortcutListener("Confirm", ShortcutAction.KeyCode.ENTER, null) { private static final long serialVersionUID = 1L; @Override public void handleAction(Object sender, Object target) { confirm.doAction(PasswordInputDialog.this); } }); layout.addComponent(textField); txtInput = null; }
@Override protected void initContent(VerticalLayout layout) throws Exception { label = new Label(message); label.setContentMode(Label.CONTENT_XHTML); layout.addComponent(label); textField = new PasswordField(); textField.setValue(txtInput); textField.setWidth("100%"); textField.focus(); textField.addShortcutListener(new ShortcutListener("Confirm", ShortcutAction.KeyCode.ENTER, null) { private static final long serialVersionUID = 1L; @Override public void handleAction(Object sender, Object target) { confirm.doAction(PasswordInputDialog.this); } }); textField.setImmediate(true); layout.addComponent(textField); txtInput = null; }
protected void initPasswordFields() { inputGrid = new GridLayout(2, 2); inputGrid.setSpacing(true); layout.addComponent(inputGrid); layout.setComponentAlignment(inputGrid, Alignment.MIDDLE_CENTER); Label newPasswordLabel = new Label(i18nManager.getMessage(Messages.PROFILE_NEW_PASSWORD)); inputGrid.addComponent(newPasswordLabel); passwordField1 = new PasswordField(); passwordField1.setWidth(150, UNITS_PIXELS); inputGrid.addComponent(passwordField1); passwordField1.focus(); Label confirmPasswordLabel = new Label(i18nManager.getMessage(Messages.PROFILE_CONFIRM_PASSWORD)); inputGrid.addComponent(confirmPasswordLabel); passwordField2 = new PasswordField(); passwordField2.setWidth(150, UNITS_PIXELS); inputGrid.addComponent(passwordField2); }