Class SupervisorMainPage

java.lang.Object
main.boundary.mainpage.SupervisorMainPage

public class SupervisorMainPage extends Object
The SupervisorMainPage class is a boundary class that represents the main page for a supervisor in a system. It provides methods to display the main page options and handle user input for different actions, such as viewing the supervisor's profile, changing the supervisor's password, creating a project, modifying project titles, viewing pending student requests, approving or rejecting student requests, submitting requests for transferring, viewing all incoming/outgoing request history and status, and logging out.
  • Constructor Details

    • SupervisorMainPage

      public SupervisorMainPage()
  • Method Details

    • supervisorMainPage

      public static void supervisorMainPage(User user)
      This method displays the main page options to the supervisor and handles user input to perform corresponding actions based on the selected option.
      Parameters:
      user - the supervisor.
    • supervisorViewAllProjects

      private static void supervisorViewAllProjects(Supervisor supervisor) throws PageBackException
      Throws:
      PageBackException
    • supervisorViewAllRequestHistory

      private static void supervisorViewAllRequestHistory(Supervisor supervisor) throws PageBackException
      This method displays all request history for the supervisor.
      Parameters:
      supervisor - the supervisor.
      Throws:
      PageBackException
    • supervisorApproveOrRejectRequest

      private static void supervisorApproveOrRejectRequest(Supervisor supervisor) throws PageBackException
      This method allows the supervisor to approve or reject a request by entering the request ID and the desired status.
      Parameters:
      supervisor - the supervisor.
      Throws:
      PageBackException - if the user wants to go back to the previous page.
    • supervisorCreateProject

      private static void supervisorCreateProject(Supervisor supervisor) throws PageBackException
      This method allows the supervisor to create a project by entering the required details such as project title, project description, and project capacity.
      Parameters:
      supervisor - the supervisor.
      Throws:
      PageBackException - if the user wants to go back to the previous page.
    • supervisorChangeProjectTitle

      private static void supervisorChangeProjectTitle(Supervisor supervisor) throws ModelAlreadyExistsException, ModelNotFoundException, PageBackException
      This method allows the supervisor to modify the title of an existing project by entering the project ID and the new title.
      Parameters:
      supervisor - the supervisor.
      Throws:
      ModelAlreadyExistsException - if the project already exists.
      ModelNotFoundException - if the project is not found.
      PageBackException - if the user wants to go back to the previous page.
    • supervisorRequestForTransfer

      private static void supervisorRequestForTransfer(Supervisor supervisor) throws PageBackException
      This method allows the supervisor to submit a request for transferring a project by entering the project ID and the student ID.
      Parameters:
      supervisor - the supervisor.
      Throws:
      PageBackException - if the user wants to go back to the previous page.
    • getRequestToProcess

      private static String getRequestToProcess(List<Request> requests) throws PageBackException
      This method allows the supervisor to view all the requests that are pending for approval.
      Parameters:
      requests - the list of requests.
      Returns:
      the request ID.
      Throws:
      PageBackException - if the user wants to go back to the previous page.
    • supervisorViewAllPendingRequest

      private static void supervisorViewAllPendingRequest(Supervisor supervisor) throws PageBackException
      This method displays all pending student requests for the supervisor.
      Parameters:
      supervisor - the supervisor.
      Throws:
      PageBackException - if the user wants to go back to the previous page.