Package com.ntu.fdae.group1.bto.views
Class AccountUIHelper
java.lang.Object
com.ntu.fdae.group1.bto.views.AccountUIHelper
Helper class for account-related UI operations in the BTO Management System.
This class provides reusable UI components and methods for account management operations such as password changes. It encapsulates the interaction between the user interface and the authentication controller, providing a clean API for account-related UI workflows.
The helper follows a composition pattern, working with a BaseUI instance for common UI operations and an AuthenticationController for business logic.
-
Constructor Summary
ConstructorsConstructorDescriptionAccountUIHelper
(BaseUI baseUI, AuthenticationController authController) Constructs a new AccountUIHelper with the specified dependencies. -
Method Summary
Modifier and TypeMethodDescriptionboolean
handlePasswordChange
(User currentUser) Handles the interactive workflow for a logged-in user to change their password, including password strength validation via the controller.
-
Constructor Details
-
AccountUIHelper
Constructs a new AccountUIHelper with the specified dependencies.- Parameters:
baseUI
- The base UI component for common UI operationsauthController
- The controller for authentication operations- Throws:
NullPointerException
- if either parameter is null
-
-
Method Details
-
handlePasswordChange
Handles the interactive workflow for a logged-in user to change their password, including password strength validation via the controller.- Parameters:
currentUser
- The user whose password to change- Returns:
- true if the password was successfully changed, false otherwise (due to validation errors, user cancellation, or system errors).
-