com.vaadin.ui.

Class LoginForm

    • Constructor Detail

      • LoginForm

        public LoginForm()
    • Method Detail

      • createUsernameField

        protected TextField createUsernameField()

        Customize the user name field. Only for overriding, do not call.

        Returns:

        the user name field

        Since:

        7.7

      • setUsernameCaption

        public void setUsernameCaption(String cap)

        Set the caption of the user name field. Note that the caption can only be set with this method before the login form has been initialized (attached).

        As an alternative to calling this method, the method createUsernameField() can be overridden.

        Parameters:

        cap - new caption

      • createPasswordField

        protected PasswordField createPasswordField()

        Customize the password field. Only for overriding, do not call.

        Returns:

        the password field

        Since:

        7.7

      • setPasswordCaption

        public void setPasswordCaption(String cap)

        Set the caption of the password field. Note that the caption can only be set with this method before the login form has been initialized (attached).

        As an alternative to calling this method, the method createPasswordField() can be overridden.

        Parameters:

        cap - new caption

      • createLoginButton

        protected Button createLoginButton()

        Customize the login button. Only for overriding, do not call.

        Returns:

        the login button

        Since:

        7.7

      • setLoginButtonCaption

        public void setLoginButtonCaption(String cap)

        Set the caption of the login button. Note that the caption can only be set with this method before the login form has been initialized (attached).

        As an alternative to calling this method, the method createLoginButton() can be overridden.

        Parameters:

        cap - new caption

      • getState

        protected LoginFormState getState()

        Description copied from class: AbstractComponent

        Returns the shared state bean with information to be sent from the server to the client. Subclasses should override this method and set any relevant fields of the state returned by super.getState().

        Overrides:

        getState in class AbstractComponent

        Returns:

        updated component shared state

      • attach

        public void attach()

        Description copied from interface: ClientConnector

        Notifies the connector that it is connected to a VaadinSession (and therefore also to a UI).

        The caller of this method is #setParent(ClientConnector) if the parent is itself already attached to the session. If not, the parent will call the ClientConnector.attach() for all its children when it is attached to the session. This method is always called before the connector's data is sent to the client-side for the first time.

        The attachment logic is implemented in AbstractClientConnector.

        Specified by:

        attach in interface ClientConnector

        Specified by:

        attach in interface Component

        Overrides:

        attach in class AbstractComponent

      • createContent

        protected Component createContent(TextField userNameField,
                                          PasswordField passwordField,
                                          Button loginButton)

        Create the content for the login form with the supplied user name field, password field and the login button. You cannot use any other text fields or buttons for this purpose. To replace these components with your own implementations, override createUsernameField(), createPasswordField() and createLoginButton(). If you only want to change the default captions, override #getUsernameFieldCaption(), #getPasswordFieldCaption() and getLoginButtonCaption(). You do not have to use the login button in your layout.

        Parameters:

        userNameField - the user name text field

        passwordField - the password field

        loginButton - the login button

        Returns:

        content component

        Since:

        7.7

      • addLoginListener

        public void addLoginListener(LoginForm.LoginListener listener)

        Adds LoginListener to handle login logic

        Parameters:

        listener -

      • removeLoginListener

        public void removeLoginListener(LoginForm.LoginListener listener)

        Removes LoginListener

        Parameters:

        listener -