Package com.vaadin.flow.component.login
Class LoginOverlay
java.lang.Object
com.vaadin.flow.component.Component
com.vaadin.flow.component.login.AbstractLogin
com.vaadin.flow.component.login.LoginOverlay
- All Implemented Interfaces:
AttachNotifier,DetachNotifier,HasElement,HasEnabled,HasStyle,Serializable
@Tag("vaadin-login-overlay")
@NpmPackage(value="@vaadin/login",
version="25.0.0-alpha19")
@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:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classClass for adding and removing components to the custom form area of the overlay.static final classClass for adding and removing components to the footer area of the overlay.Nested classes/interfaces inherited from class com.vaadin.flow.component.login.AbstractLogin
AbstractLogin.ForgotPasswordEvent, AbstractLogin.LoginEvent -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Closes the login overlay.Gets the object from which components can be added or removed from the overlay custom form area.Gets the object from which components can be added or removed from the overlay footer area.getStyle()Gets the style instance for managing inline styles for the element of this component.getTitle()Returns custom title component which was set viasetTitle(Component)Returns the value of the title property or a text content of the title if it was set viasetTitle(Component)booleanisOpened()voidsetDescription(String description) Sets the application description.voidsetOpened(boolean opened) Opens or closes the login overlay.voidSets the application title,nullto remove any previous title and to display title set viasetTitle(String).voidSets the application title.Methods inherited from class com.vaadin.flow.component.login.AbstractLogin
addForgotPasswordListener, addLoginListener, getAction, isError, isForgotPasswordButtonVisible, onEnabledStateChanged, setAction, setError, setForgotPasswordButtonVisible, setI18n, showErrorMessageMethods inherited from class com.vaadin.flow.component.Component
addListener, findAncestor, fireEvent, from, get, getChildren, getElement, getEventBus, getId, getListeners, getLocale, getParent, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getUI, hasListener, isAttached, isTemplateMapped, isVisible, onAttach, onDetach, removeFromParent, scrollIntoView, scrollIntoView, set, setElement, setId, setVisibleMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.vaadin.flow.component.AttachNotifier
addAttachListenerMethods inherited from interface com.vaadin.flow.component.DetachNotifier
addDetachListenerMethods inherited from interface com.vaadin.flow.component.HasElement
getElementMethods inherited from interface com.vaadin.flow.component.HasEnabled
isEnabled, setEnabledMethods inherited from interface com.vaadin.flow.component.HasStyle
addClassName, addClassNames, getClassName, getClassNames, hasClassName, removeClassName, removeClassNames, setClassName, setClassName
-
Constructor Details
-
LoginOverlay
public LoginOverlay() -
LoginOverlay
-
-
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
-
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
UIwhen 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-trueto open the login overlay,falseto close it
-
setTitle
Sets the application title. Detaches the component title if it was set earlier. Note: the method callssetTitle(Component), which will reset the custom title, if it was set. Title is a part of the I18n object. SeeAbstractLogin.setI18n(LoginI18n).- See Also:
-
getTitleAsText
Returns the value of the title property or a text content of the title if it was set viasetTitle(Component)- Returns:
- the string value of title
-
setTitle
Sets the application title,nullto remove any previous title and to display title set viasetTitle(String).- Parameters:
title- the title component to set, ornullto remove any previously set title- See Also:
-
getTitle
Returns custom title component which was set viasetTitle(Component)- Returns:
- the title component,
nullif nothing was set
-
setDescription
Sets the application description. Description is a part of I18n object. SeeAbstractLogin.setI18n(LoginI18n).- Parameters:
description- the description string- See Also:
-
getDescription
- Returns:
- the value of description property
-
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 withLoginOverlay.LoginOverlayContent.add(Component...). Fields that are part of custom form area are not automatically submitted as part of theAbstractLogin.LoginEvent, and are not supported when settingactionas their values will not be part of the login request.- Returns:
- the custom form area object
- Since:
- 24.2
-
getStyle
Description copied from interface:HasStyleGets the style instance for managing inline styles for the element of this component.- Specified by:
getStylein interfaceHasStyle- Returns:
- the style object for the element, not
null - Throws:
UnsupportedOperationException- LoginOverlay does not support adding styles to overlay wrapper
-