Package com.ntu.fdae.group1.bto.views
Class EnquiryUIHelper
java.lang.Object
com.ntu.fdae.group1.bto.views.EnquiryUIHelper
Helper class to manage common UI tasks related to displaying Enquiry
information.
Used via composition by role-specific UI classes (ApplicantUI, HDBManagerUI,
HDBOfficerUI).
-
Constructor Summary
ConstructorsConstructorDescriptionEnquiryUIHelper
(BaseUI baseUI, UserController userController, ProjectController projectController) Constructs a new EnquiryUIHelper with the required UI and controllers. -
Method Summary
Modifier and TypeMethodDescriptionvoid
displayEnquiryDetails
(Enquiry enquiry) Displays the full details of a single Enquiry object.displayEnquiryList
(List<Enquiry> enquiries, String title) Displays a formatted list of enquiries, sorted by unreplied first, and returns a map for selection.selectEnquiryFromList
(List<Enquiry> enquiries, String listTitle) Displays a numbered list of enquiries with summary information and prompts the user to select one.
-
Constructor Details
-
EnquiryUIHelper
public EnquiryUIHelper(BaseUI baseUI, UserController userController, ProjectController projectController) Constructs a new EnquiryUIHelper with the required UI and controllers.- Parameters:
baseUI
- The base UI for displaying common UI componentsuserController
- The controller for user operationsprojectController
- The controller for project operations
-
-
Method Details
-
selectEnquiryFromList
Displays a numbered list of enquiries with summary information and prompts the user to select one.- Parameters:
enquiries
- The list of Enquiry objects to display.listTitle
- The title to display above the list (e.g., "My Enquiries", "Project Enquiries").- Returns:
- The selected Enquiry object, or null if the user chooses to go back or the list is empty.
-
displayEnquiryDetails
Displays the full details of a single Enquiry object.- Parameters:
enquiry
- The Enquiry object whose details are to be displayed.
-
displayEnquiryList
Displays a formatted list of enquiries, sorted by unreplied first, and returns a map for selection.- Parameters:
enquiries
- List of enquiries to display.title
- Title for the list header.- Returns:
- Map where key is the displayed number, value is the Enquiry. Empty map if list is null/empty.
-