Class AccountUIHelper

java.lang.Object
com.ntu.fdae.group1.bto.views.AccountUIHelper

public class AccountUIHelper extends Object
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 Details

    • AccountUIHelper

      public AccountUIHelper(BaseUI baseUI, AuthenticationController authController)
      Constructs a new AccountUIHelper with the specified dependencies.
      Parameters:
      baseUI - The base UI component for common UI operations
      authController - The controller for authentication operations
      Throws:
      NullPointerException - if either parameter is null
  • Method Details

    • handlePasswordChange

      public boolean handlePasswordChange(User currentUser)
      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).