Class ChangePasswordView
java.lang.Object
com.vaadin.flow.component.Component
com.vaadin.flow.component.Composite<T>
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.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,Serializable
@ViewController("changePasswordView")
@ViewDescriptor("change-password-view.xml")
@DialogMode(width="AUTO",
height="AUTO")
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.QueryParametersChangeEvent, View.ReadyEvent -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected com.vaadin.flow.component.textfield.PasswordFieldprotected com.vaadin.flow.component.textfield.PasswordFieldprotected MessageBundleprotected MetadataToolsprotected Notificationsprotected 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, String currentPassword) protected StringbooleanvoidonBeforeShow(View.BeforeShowEvent event) voidvoidvoidsetCurrentPasswordRequired(boolean required) Sets whether a user should enter the current password.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.StandardView
initContentMethods inherited from class io.jmix.flowui.view.View
addAfterCloseListener, addBeforeCloseListener, addBeforeShowListener, addInitListener, addReadyListener, afterNavigation, beforeEnter, beforeLeave, close, close, closeWithDefaultAction, getApplicationContext, getId, getReturnParameters, getViewActions, getViewAttributes, getViewData, getViewFacets, getViewSupport, onDetach, setApplicationContext, setId, setViewActions, setViewData, setViewFacetsMethods inherited from class com.vaadin.flow.component.Composite
getChildren, getContent, getElementMethods inherited from class com.vaadin.flow.component.Component
addListener, findAncestor, fireEvent, from, get, getEventBus, getListeners, getLocale, getParent, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getUI, hasListener, isAttached, isTemplateMapped, isVisible, onAttach, onEnabledStateChanged, scrollIntoView, set, setElement, 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
addDetachListener
-
Field Details
-
passwordField
-
confirmPasswordField
-
currentPasswordField
-
messageBundle
-
userManager
-
notifications
-
viewValidation
-
passwordEncoder
@Autowired protected org.springframework.security.crypto.password.PasswordEncoder passwordEncoder -
passwordValidation
-
userRepository
-
metadataTools
-
username
-
user
protected org.springframework.security.core.userdetails.UserDetails user
-
-
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
-
onBeforeShow
-
getPageTitle
- Specified by:
getPageTitlein interfacecom.vaadin.flow.router.HasDynamicTitle- Overrides:
getPageTitlein classView<ViewLayout>
-
onSaveActionPerformed
-
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
-