com.vaadin.flow.component.login.

Class LoginOverlay

All Implemented Interfaces:

AttachNotifier, DetachNotifier, HasElement, HasEnabled, HasStyle, Serializable

@Tag("vaadin-login-overlay") @NpmPackage(value="@vaadin/polymer-legacy-adapter",version="24.7.7") @NpmPackage(value="@vaadin/login",version="24.7.7") @JsModule("@vaadin/polymer-legacy-adapter/style-modules.js") @JsModule("@vaadin/login/src/vaadin-login-overlay.js") public class LoginOverlay extends AbstractLogin implements HasStyle

Server-side component for the <vaadin-login-overlay> component. On AbstractLogin.LoginEvent component becomes disabled. Disabled component stops to process login events, however the AbstractLogin.ForgotPasswordEvent event is processed anyway. To enable use the HasEnabled.setEnabled(boolean) method. Setting error AbstractLogin.setError(boolean) true makes component automatically enabled for the next login attempt.

Author:

Vaadin Ltd

See Also:

  • Constructor Details

    • LoginOverlay

      public LoginOverlay()
    • LoginOverlay

      public LoginOverlay(LoginI18n i18n)
  • Method Details

    • close

      public void close()

      Closes the login overlay.

      This automatically removes the overlay from the UI, unless it was manually added to a parent component.

    • isOpened

      @Synchronize(property="opened", value="opened-changed") public boolean isOpened()
    • setOpened

      public void setOpened(boolean opened)

      Opens or closes the login overlay. Opening the overlay automatically enables it in case it was disabled.

      If an overlay was not added manually to a parent component, it will be automatically added to the UI when opened, and automatically removed from the UI when closed. Note that the overlay is then scoped to the UI, and not the current view. As such, when navigating away from a view, the overlay will still be opened or stay open. In order to close the overlay when navigating away from a view, it should either be explicitly added as a child to the view, or it should be explicitly closed when leaving the view.

      Parameters:

      opened - true to open the login overlay, false to close it

    • setTitle

      public void setTitle(String title)

      Sets the application title. Detaches the component title if it was set earlier. Note: the method calls setTitle(Component), which will reset the custom title, if it was set. Custom title can be reset only when the overlay is closed. Title is a part of the I18n object. See AbstractLogin.setI18n(LoginI18n).

      See Also:

    • getTitleAsText

      @Synchronize(property="title", value="title-changed") public String getTitleAsText()

      Returns the value of the title property or a text content of the title if it was set via setTitle(Component)

      Returns:

      the string value of title

    • setTitle

      public void setTitle(Component title)

      Sets the application title, null to remove any previous title and to display title set via setTitle(String). Note: the title component has to be set when the overlay is closed.

      Parameters:

      title - the title component to set, or null to remove any previously set title

      See Also:

    • getTitle

      public Component getTitle()

      Returns custom title component which was set via setTitle(Component)

      Returns:

      the title component, null if nothing was set

    • setDescription

      public void setDescription(String description)

      Sets the application description. Description is a part of I18n object. See AbstractLogin.setI18n(LoginI18n).

      Parameters:

      description - the description string

      See Also:

    • getDescription

      @Synchronize(property="description", value="description-changed") public String getDescription()

      Returns:

      the value of description property

    • getCustomFormArea

      public LoginOverlay.LoginOverlayCustomFormArea getCustomFormArea()

      Gets the object from which components can be added or removed from the overlay custom form area. This area is displayed only if there's at least one component added with LoginOverlay.LoginOverlayContent.add(Component...). Fields that are part of custom form area are not automatically submitted as part of the AbstractLogin.LoginEvent, and are not supported when setting action as their values will not be part of the login request.

      Returns:

      the custom form area object

      Since:

      24.2

    • getFooter

      public LoginOverlay.LoginOverlayFooter getFooter()

      Gets the object from which components can be added or removed from the overlay footer area. This area is displayed only if there's at least one component added with LoginOverlay.LoginOverlayContent.add(Component...).

      Returns:

      the footer object

      Since:

      24.2

    • setClassName

      public void setClassName(String className)

      Sets the CSS class names of the login overlay element. This method overwrites any previous set class names.

      Specified by:

      setClassName in interface HasStyle

      Parameters:

      className - a space-separated string of class names to set, or null to remove all class names

    • getClassNames

      public ClassList getClassNames()

      Description copied from interface: HasStyle

      Gets the set of CSS class names used for this element. The returned set can be modified to add or remove class names. The contents of the set is also reflected in the value of the class attribute.

      Despite the name implying a list being returned, the return type is actually a Set since the in-browser return value behaves like a Set in Java.

      Specified by:

      getClassNames in interface HasStyle

      Returns:

      a list of class names, never null

      See Also:

    • getStyle

      public Style getStyle()

      Description copied from interface: HasStyle

      Gets the style instance for managing inline styles for the element of this component.

      Specified by:

      getStyle in interface HasStyle

      Returns:

      the style object for the element, not null

      Throws:

      UnsupportedOperationException - LoginOverlay does not support adding styles to overlay wrapper