Package sc2002.FCS1.grp2
Class BTOManagementApplication
Object
BTOManagementApplication
Main entry for our project's CLI application.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static BTOManagementSystemSystem object, for easy access. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static voidShow change filter options and ask what user wantprivate static voidShow change listing sort options and ask what user wantprivate static voidprivate static voidDisplays the main menu of the application.private static StringDifferent greetings depending on time of day.private static voidhandleAction(int index) Handles the option selected by user.private static voidhandleUserResponse(String response) Handle what the user has inputed.private static voidlogin()User login flow.static voidEntry point for CLI application, read and write.private static StringprepareHeader(String title) Use this to prepare a string that centers text and places hyphens left and right of it.private static voidOnce called, this method will always ask the user to do something, again and again, unless requested by the user to exit or logout.
-
Field Details
-
system
System object, for easy access.
-
-
Constructor Details
-
BTOManagementApplication
public BTOManagementApplication()
-
-
Method Details
-
main
Entry point for CLI application, read and write.- Parameters:
args-
-
prepareHeader
Use this to prepare a string that centers text and places hyphens left and right of it.- Parameters:
title- The title to be centered.- Returns:
- string ready for display.
-
displayMenu
private static void displayMenu()Displays the main menu of the application. -
startResponseLoop
private static void startResponseLoop()Once called, this method will always ask the user to do something, again and again, unless requested by the user to exit or logout. -
handleUserResponse
Handle what the user has inputed.- Parameters:
response- To be converted
-
handleAction
Handles the option selected by user. Will pass this along to relevant action classes- Parameters:
index- The index provided by user.- Throws:
Exception
-
changePassword
private static void changePassword() -
changeListingSort
private static void changeListingSort()Show change listing sort options and ask what user want -
changeListingFilter
private static void changeListingFilter()Show change filter options and ask what user want -
getGreetings
Different greetings depending on time of day.- Returns:
- the greetings.
-
login
private static void login()User login flow.
-