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
Modifier and TypeFieldDescriptionprotected com.vaadin.flow.component.textfield.PasswordField
protected com.vaadin.flow.component.textfield.PasswordField
protected MessageBundle
protected MetadataTools
protected Notifications
protected org.springframework.security.crypto.password.PasswordEncoder
protected com.vaadin.flow.component.textfield.PasswordField
protected PasswordValidation
protected org.springframework.security.core.userdetails.UserDetails
protected UserManager
protected String
protected UserRepository
protected ViewValidation
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected OperationResult
changePassword
(String username, String password, String currentPassword) protected String
boolean
void
onBeforeShow
(View.BeforeShowEvent event) void
void
void
setCurrentPasswordRequired
(boolean required) Sets whether a user should enter the current password.void
setUsername
(String username) Sets username for which should be changed password.protected boolean
validate()
protected ValidationErrors
validatePassword
(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
initContent
Methods 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, setViewFacets
Methods inherited from class com.vaadin.flow.component.Composite
getChildren, getContent, getElement
Methods inherited from class com.vaadin.flow.component.Component
addListener, fireEvent, from, get, getEventBus, getLocale, getParent, getTranslation, getTranslation, getTranslation, getUI, hasListener, isAttached, isTemplateMapped, isVisible, onAttach, onEnabledStateChanged, scrollIntoView, set, setElement, 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
-
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:
true
if 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:
getPageTitle
in interfacecom.vaadin.flow.router.HasDynamicTitle
- Overrides:
getPageTitle
in 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
-