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:
  • Field Details

    • locales

      protected List<Locale> locales
    • selectedLocale

      protected Locale selectedLocale
    • rememberMe

      protected boolean rememberMe
    • localeItemLabelGenerator

      protected Function<Locale,String> localeItemLabelGenerator
  • Constructor Details

    • EnhancedLoginForm

      public EnhancedLoginForm()
  • Method Details

    • getUsername

      @Synchronize("username") public String getUsername()
      Returns:
      entered username
    • setUsername

      public void setUsername(String username)
      Sets username to the field.
      Parameters:
      username - username to set
    • getPassword

      @Synchronize("password") public String getPassword()
      Returns:
      entered password
    • setPassword

      public void setPassword(String password)
      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

      public void setLocaleItems(Collection<Locale> locales)
      Sets available locales to select.
      Parameters:
      locales - locale items
    • getSelectedLocale

      public Locale getSelectedLocale()
      Returns:
      selected locale
    • setSelectedLocale

      public void setSelectedLocale(Locale locale)
      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

      public Function<Locale,String> 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

      public void setLocaleItemLabelGenerator(@Nullable Function<Locale,String> localeItemLabelGenerator)
      Sets label generator for the locale items.
      Parameters:
      localeItemLabelGenerator - item label generator to set
    • onRememberMeChangedEvent

      protected void onRememberMeChangedEvent(EnhancedLoginForm.JmixRememberMeChangedEvent event)
    • handleRememberMeChanged

      protected void handleRememberMeChanged(boolean isFromClient, boolean newValue)
    • onLocaleChangedEvent

      protected void onLocaleChangedEvent(EnhancedLoginForm.JmixLocaleChangedEvent event)
    • handleLocaleChanged

      protected void handleLocaleChanged(boolean isFromClient, Locale newLocale)
    • fireLocaleChangedEvent

      protected void fireLocaleChangedEvent(Locale oldValue, Locale value, Boolean isFromClient)
    • setupLocale

      protected void setupLocale(Locale locale)
    • generateItemLabel

      protected String generateItemLabel(Locale locale)
    • applyDefaultValueFormat

      protected String applyDefaultValueFormat(Locale locale)
    • isRememberMeChanged

      protected boolean isRememberMeChanged(boolean rememberMe)
    • isLocaleChanged

      protected boolean isLocaleChanged(Locale locale)
    • localeToString

      protected String localeToString(Locale locale)
    • localeFromString

      protected Locale localeFromString(String locale)