Package com.ntu.fdae.group1.bto.views
Class MainMenuUI
java.lang.Object
com.ntu.fdae.group1.bto.views.BaseUI
com.ntu.fdae.group1.bto.views.MainMenuUI
MainMenuUI class for handling the main menu of the BTO Management System.
This class is responsible for displaying the main menu options to the user. It provides options for logging in or exiting the application. The main menu serves as the entry point to the system.
The class extends BaseUI to leverage common UI components and input handling methods, providing a consistent user experience.
-
Field Summary
Fields inherited from class com.ntu.fdae.group1.bto.views.BaseUI
DATE_FORMATTER, scanner
-
Constructor Summary
ConstructorsConstructorDescriptionMainMenuUI
(AuthenticationController authController, Scanner scanner) Constructs a new MainMenuUI with the specified authentication controller and scanner. -
Method Summary
Modifier and TypeMethodDescriptionDisplays the main menu and handles user input.Methods inherited from class com.ntu.fdae.group1.bto.views.BaseUI
clearConsole, displayError, displayHeader, displayList, displayMessage, formatDateSafe, formatEnumName, pause, promptForConfirmation, promptForDate, promptForDouble, promptForEnum, promptForInput, promptForInt, promptForPassword, promptForPasswordWithToggle
-
Constructor Details
-
MainMenuUI
Constructs a new MainMenuUI with the specified authentication controller and scanner.- Parameters:
authController
- The controller for handling authentication operationsscanner
- The scanner for reading user input- Throws:
IllegalArgumentException
- if authController is null
-
-
Method Details
-
displayMainMenu
Displays the main menu and handles user input.- Returns:
- The authenticated User object if login is successful, or null if the user chooses to exit.
-