Class OfficerRegUIHelper

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

public class OfficerRegUIHelper extends Object
Helper class for officer registration related UI operations in the BTO Management System.

This class provides reusable UI components for displaying and managing officer registration data, including: - Displaying lists of officer registrations - Showing detailed information about specific registrations - Formatting registration data for user-friendly display

The helper follows a composition pattern, working with a BaseUI instance for common UI operations and a ProjectController for retrieving project information related to registrations.

  • Constructor Details

    • OfficerRegUIHelper

      public OfficerRegUIHelper(BaseUI baseUI, ProjectController projectController, UserController userController)
      Constructs a new OfficerRegUIHelper with the specified dependencies.
      Parameters:
      baseUI - An instance of BaseUI for console I/O operations
      projectController - Controller to fetch project details
      userController - Controller to fetch user details
      Throws:
      NullPointerException - if either parameter is null
  • Method Details

    • displayOfficerRegList

      public Map<Integer,OfficerRegistration> displayOfficerRegList(List<OfficerRegistration> regs, String title)
      Displays a formatted list of officer registrations and provides a mapping for selection.

      This method displays each registration with its key details including ID, officer, project name, status, and date, and returns a map that associates the display index with the corresponding registration object for easy selection.

      Parameters:
      regs - List of registrations to display
      title - Title for the list header
      Returns:
      Map where key is the displayed number, value is the OfficerRegistration; empty map if list is null/empty
    • displayOfficerRegistrationDetails

      public void displayOfficerRegistrationDetails(OfficerRegistration reg)
      Displays detailed information about a specific officer registration.

      Shows comprehensive information about a single registration, including its ID, associated officer, project details, request date, and current status.

      Parameters:
      reg - The registration object to display details for
    • displayOfficerRegListForViewing

      public void displayOfficerRegListForViewing(List<OfficerRegistration> regs, String title)
      Displays a formatted list of officer registrations for viewing purposes only.

      Unlike displayOfficerRegList, this method is designed for view-only scenarios where user selection is not required. It displays registrations in a tabular format with columns for key details.

      Parameters:
      regs - List of registrations to display
      title - Title for the list header