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/polymer-legacy-adapter",version="24.6.3") @NpmPackage(value="@vaadin/login",version="24.6.3")
@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:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final class
Class for adding and removing components to the custom form area of the overlay.static final class
Class 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 TypeMethodDescriptionvoid
close()
Closes the login overlay.Gets the set of CSS class names used for this element.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)
boolean
isOpened()
void
setClassName
(String className) Sets the CSS class names of the login overlay element.void
setDescription
(String description) Sets the application description.void
setOpened
(boolean opened) Opens or closes the login overlay.void
Sets the application title,null
to remove any previous title and to display title set viasetTitle(String)
.void
Sets the application title.Methods inherited from class com.vaadin.flow.component.login.AbstractLogin
addForgotPasswordListener, addLoginListener, getAction, isError, isForgotPasswordButtonVisible, onEnabledStateChanged, setAction, setError, setForgotPasswordButtonVisible, setI18n, showErrorMessage
Methods 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, setVisible
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.vaadin.flow.component.AttachNotifier
addAttachListener
Methods inherited from interface com.vaadin.flow.component.DetachNotifier
addDetachListener
Methods inherited from interface com.vaadin.flow.component.HasElement
getElement
Methods inherited from interface com.vaadin.flow.component.HasEnabled
isEnabled, setEnabled
Methods inherited from interface com.vaadin.flow.component.HasStyle
addClassName, addClassNames, getClassName, hasClassName, removeClassName, removeClassNames, setClassName
-
Constructor Details
-
LoginOverlay
public LoginOverlay() -
LoginOverlay
-
-
Method Details
-
close
public void close()Closes the login overlay.Note: This method also removes the overlay component from the DOM after closing it, unless you have added the component manually.
-
isOpened
-
setOpened
public void setOpened(boolean opened) Opens or closes the login overlay. On open component becomes enabledHasEnabled.setEnabled(boolean)
Note: Overlay will be attached or detached from the DOM automatically, if it was not added manually.
- Parameters:
opened
-true
to open the login overlay,false
to 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. Custom title can be reset only when the overlay is closed. 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,null
to remove any previous title and to display title set viasetTitle(String)
. Note: the title component has to be set when the overlay is closed.- Parameters:
title
- the title component to set, ornull
to remove any previously set title- See Also:
-
getTitle
Returns custom title component which was set viasetTitle(Component)
- Returns:
- the title component,
null
if 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 settingaction
as their values will not be part of the login request.- Returns:
- the custom form area object
- Since:
- 24.2
-
setClassName
Sets the CSS class names of the login overlay element. This method overwrites any previous set class names.- Specified by:
setClassName
in interfaceHasStyle
- Parameters:
className
- a space-separated string of class names to set, ornull
to remove all class names
-
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 theclass
attribute.Despite the name implying a list being returned, the return type is actually a
Set
since the in-browser return value behaves like aSet
in Java.- Specified by:
getClassNames
in interfaceHasStyle
- Returns:
- a list of class names, never
null
- See Also:
-
getStyle
Description copied from interface:HasStyle
Gets the style instance for managing inline styles for the element of this component.- Specified by:
getStyle
in interfaceHasStyle
- Returns:
- the style object for the element, not
null
- Throws:
UnsupportedOperationException
- LoginOverlay does not support adding styles to overlay wrapper
-