Class ChangePasswordView
java.lang.Object
com.vaadin.flow.component.Component
com.vaadin.flow.component.Composite<ViewLayout>
io.jmix.flowui.view.View<ViewLayout>
io.jmix.flowui.view.StandardView
io.jmix.securityflowui.view.changepassword.ChangePasswordView
- All Implemented Interfaces:
com.vaadin.flow.component.AttachNotifier,com.vaadin.flow.component.DetachNotifier,com.vaadin.flow.component.HasElement,com.vaadin.flow.component.HasStyle,com.vaadin.flow.router.AfterNavigationObserver,com.vaadin.flow.router.BeforeEnterObserver,com.vaadin.flow.router.BeforeLeaveObserver,com.vaadin.flow.router.HasDynamicTitle,com.vaadin.flow.router.internal.AfterNavigationHandler,com.vaadin.flow.router.internal.BeforeEnterHandler,com.vaadin.flow.router.internal.BeforeLeaveHandler,FacetOwner,FragmentOwner,Serializable
@ViewController("changePasswordView")
@ViewDescriptor("change-password-view.xml")
public class ChangePasswordView
extends StandardView
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class io.jmix.flowui.view.View
View.AfterCloseEvent, View.BeforeCloseEvent, View.BeforeShowEvent, View.InitEvent, View.PostReadyEvent, View.QueryParametersChangeEvent, View.ReadyEvent, View.RestoreComponentsStateEvent -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Actionprotected com.vaadin.flow.component.textfield.PasswordFieldprotected CurrentAuthenticationprotected com.vaadin.flow.component.textfield.PasswordFieldprotected booleanprotected MessageBundleprotected MetadataToolsprotected Notificationsprotected PasswordChangeRequiredSupportprotected org.springframework.security.crypto.password.PasswordEncoderprotected com.vaadin.flow.component.textfield.PasswordFieldprotected PasswordValidationprotected org.springframework.security.core.userdetails.UserDetailsprotected UserManagerprotected Stringprotected UserRepositoryprotected ViewValidation -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected OperationResultchangePassword(String username, String password, @Nullable String currentPassword) protected @Nullable StringbooleanbooleanisForced()voidvoidonBeforeShow(View.BeforeShowEvent event) voidvoidprotected voidvoidsetCurrentPasswordRequired(boolean required) Sets whether a user should enter the current password.voidsetForced(boolean forced) Sets the forced mode.voidsetUsername(String username) Sets username for which should be changed password.protected booleanvalidate()protected ValidationErrorsvalidatePassword(com.vaadin.flow.component.textfield.PasswordField passwordField, com.vaadin.flow.component.textfield.PasswordField confirmPasswordField, com.vaadin.flow.component.textfield.PasswordField currentPasswordField) Methods inherited from class io.jmix.flowui.view.View
addAfterCloseListener, addApplicationListeners, addBeforeCloseListener, addBeforeShowListener, addInitListener, addQueryParametersChangeListener, addReadyListener, addRestoreComponentsStateEventListener, afterNavigation, beforeEnter, beforeLeave, close, close, closeWithDefaultAction, configureDialogWindowFooter, configureDialogWindowHeader, getApplicationContext, getEventBus, getId, getReturnParameters, getViewActions, getViewAttributes, getViewData, getViewFacets, getViewSupport, isPreventBrowserTabClosing, onAttach, onAttachInternal, onDetach, onDetachInternal, processBeforeEnterInternal, removeApplicationListeners, removeViewAttributes, setAfterNavigationHandler, setApplicationContext, setId, setPageTitle, setPreventBrowserTabClosing, setViewActions, setViewData, setViewFacets, unregisterBackNavigationMethods inherited from class com.vaadin.flow.component.Composite
getChildren, getContent, getElement, initContentMethods inherited from class com.vaadin.flow.component.Component
addListener, bindVisible, findAncestor, fireEvent, from, get, getListeners, getLocale, getParent, getTestId, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getUI, hasListener, isAttached, isTemplateMapped, isVisible, onEnabledStateChanged, removeFromParent, scrollIntoView, scrollIntoView, set, setElement, setTestId, 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.HasStyle
addClassName, addClassNames, bindClassName, bindClassNames, getClassName, getClassNames, getStyle, hasClassName, removeClassName, removeClassNames, setClassName, setClassName
-
Field Details
-
passwordField
-
confirmPasswordField
-
currentPasswordField
-
closeAction
-
messageBundle
-
userManager
-
notifications
-
viewValidation
-
passwordEncoder
@Autowired protected org.springframework.security.crypto.password.PasswordEncoder passwordEncoder -
passwordValidation
-
userRepository
-
metadataTools
-
currentAuthentication
-
passwordChangeRequiredSupport
-
username
-
user
protected org.springframework.security.core.userdetails.UserDetails user -
forced
protected boolean forced
-
-
Constructor Details
-
ChangePasswordView
public ChangePasswordView()
-
-
Method Details
-
getUsername
- Returns:
- username for which should be changed password
-
setUsername
Sets username for which should be changed password.- Parameters:
username- username
-
isCurrentPasswordRequired
public boolean isCurrentPasswordRequired()- Returns:
trueif a user should enter the current password
-
setCurrentPasswordRequired
public void setCurrentPasswordRequired(boolean required) Sets whether a user should enter the current password.Default value is
false.- Parameters:
required- required option
-
isForced
public boolean isForced()- Returns:
trueif the dialog is opened in the forced mode
-
setForced
public void setForced(boolean forced) Sets the forced mode. In the forced mode the user cannot close the dialog without changing the password.Default value is
false.- Parameters:
forced- forced mode flag
-
onBeforeShow
-
onBeforeClose
-
getPageTitle
- Specified by:
getPageTitlein interfacecom.vaadin.flow.router.HasDynamicTitle- Overrides:
getPageTitlein classView<ViewLayout>
-
onSaveActionPerformed
-
refreshCurrentUserPasswordChangeRequiredFlag
protected void refreshCurrentUserPasswordChangeRequiredFlag() -
onCloseActionPerformed
-
validate
protected boolean validate() -
validatePassword
protected ValidationErrors validatePassword(com.vaadin.flow.component.textfield.PasswordField passwordField, com.vaadin.flow.component.textfield.PasswordField confirmPasswordField, com.vaadin.flow.component.textfield.PasswordField currentPasswordField) -
changePassword
protected OperationResult changePassword(String username, String password, @Nullable String currentPassword) -
getPassword
-