Class EnhancedLoginForm
java.lang.Object
com.vaadin.flow.component.Component
com.vaadin.flow.component.login.AbstractLogin
com.vaadin.flow.component.login.LoginForm
io.jmix.flowui.kit.component.loginform.EnhancedLoginForm
- All Implemented Interfaces:
com.vaadin.flow.component.AttachNotifier
,com.vaadin.flow.component.DetachNotifier
,com.vaadin.flow.component.HasElement
,com.vaadin.flow.component.HasEnabled
,com.vaadin.flow.component.HasStyle
,Serializable
- Direct Known Subclasses:
JmixLoginForm
@Tag("jmix-login-form")
@JsModule("./src/login-form/jmix-login-form.js")
public class EnhancedLoginForm
extends com.vaadin.flow.component.login.LoginForm
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionprotected static class
protected static class
static class
An event that is fired when the user selects another locale.static class
An event that is fired when "Remember Me" becomes checked and unchecked.Nested classes/interfaces inherited from class com.vaadin.flow.component.login.AbstractLogin
com.vaadin.flow.component.login.AbstractLogin.ForgotPasswordEvent, com.vaadin.flow.component.login.AbstractLogin.LoginEvent
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptioncom.vaadin.flow.shared.Registration
addLocaleChangedListener
(com.vaadin.flow.component.ComponentEventListener<EnhancedLoginForm.LocaleChangedEvent> listener) Adds listener to handle locale selection changes.com.vaadin.flow.shared.Registration
addRememberMeChangedListener
(com.vaadin.flow.component.ComponentEventListener<EnhancedLoginForm.RememberMeChangedEvent> listener) Adds listener to handle changes in "Remember Me" option.protected String
applyDefaultValueFormat
(Locale locale) protected void
fireLocaleChangedEvent
(Locale oldValue, Locale value, Boolean isFromClient) protected String
generateItemLabel
(Locale locale) protected void
handleLocaleChanged
(boolean isFromClient, Locale newLocale) protected void
handleRememberMeChanged
(boolean isFromClient, boolean newValue) protected boolean
isLocaleChanged
(Locale locale) boolean
boolean
protected boolean
isRememberMeChanged
(boolean rememberMe) boolean
protected Locale
localeFromString
(String locale) protected String
localeToString
(Locale locale) protected void
protected void
void
setLocaleItemLabelGenerator
(Function<Locale, String> localeItemLabelGenerator) Sets label generator for the locale items.void
setLocaleItems
(Collection<Locale> locales) Sets available locales to select.void
setLocalesVisible
(boolean visible) Sets visibility of component with localesvoid
setPassword
(String password) Sets password to the field.void
setRememberMe
(boolean rememberMe) Sets whether "Remember Me" option should be checked or not.void
setRememberMeVisible
(boolean visible) Sets visibility of "Remember Me" component.void
setSelectedLocale
(Locale locale) Selects provided locale if locale options contain it.protected void
setupLocale
(Locale locale) void
setUsername
(String username) Sets username to the field.Methods inherited from class com.vaadin.flow.component.login.AbstractLogin
addForgotPasswordListener, addLoginListener, getAction, isError, isForgotPasswordButtonVisible, onEnabledStateChanged, setAction, setError, setForgotPasswordButtonVisible, setI18n
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, getClassNames, getStyle, hasClassName, removeClassName, removeClassNames, setClassName, setClassName
-
Field Details
-
locales
-
selectedLocale
-
rememberMe
protected boolean rememberMe -
localeItemLabelGenerator
-
-
Constructor Details
-
EnhancedLoginForm
public EnhancedLoginForm()
-
-
Method Details
-
getUsername
- Returns:
- entered username
-
setUsername
Sets username to the field.- Parameters:
username
- username to set
-
getPassword
- Returns:
- entered password
-
setPassword
Sets password to the field.- Parameters:
password
- password to set
-
isRememberMeVisible
@Synchronize("rememberMeVisibility") public boolean isRememberMeVisible()- Returns:
true
if "Remember Me" component is visible
-
setRememberMeVisible
public void setRememberMeVisible(boolean visible) Sets visibility of "Remember Me" component.- Parameters:
visible
- whether component should be visible
-
isLocalesVisible
@Synchronize("localesVisibility") public boolean isLocalesVisible()- Returns:
true
if component with locales is visible
-
setLocalesVisible
public void setLocalesVisible(boolean visible) Sets visibility of component with locales- Parameters:
visible
- whether component should be visible
-
setLocaleItems
Sets available locales to select.- Parameters:
locales
- locale items
-
getSelectedLocale
- Returns:
- selected locale
-
setSelectedLocale
Selects provided locale if locale options contain it.- Parameters:
locale
- locale to select
-
isRememberMe
public boolean isRememberMe()- Returns:
true
if "Remember Me" option is checked
-
setRememberMe
public void setRememberMe(boolean rememberMe) Sets whether "Remember Me" option should be checked or not.- Parameters:
rememberMe
- rememberMe option
-
getLocaleItemLabelGenerator
- Returns:
- label generator for the locale items or
null
if not set
-
addRememberMeChangedListener
public com.vaadin.flow.shared.Registration addRememberMeChangedListener(com.vaadin.flow.component.ComponentEventListener<EnhancedLoginForm.RememberMeChangedEvent> listener) Adds listener to handle changes in "Remember Me" option.- Parameters:
listener
- listener to add- Returns:
- a registration object for removing an event listener
-
addLocaleChangedListener
public com.vaadin.flow.shared.Registration addLocaleChangedListener(com.vaadin.flow.component.ComponentEventListener<EnhancedLoginForm.LocaleChangedEvent> listener) Adds listener to handle locale selection changes.- Parameters:
listener
- listener to add- Returns:
- a registration object for removing an event listener
-
setLocaleItemLabelGenerator
Sets label generator for the locale items.- Parameters:
localeItemLabelGenerator
- item label generator to set
-
onRememberMeChangedEvent
-
handleRememberMeChanged
protected void handleRememberMeChanged(boolean isFromClient, boolean newValue) -
onLocaleChangedEvent
-
handleLocaleChanged
-
fireLocaleChangedEvent
-
setupLocale
-
generateItemLabel
-
applyDefaultValueFormat
-
isRememberMeChanged
protected boolean isRememberMeChanged(boolean rememberMe) -
isLocaleChanged
-
localeToString
-
localeFromString
-