Class ProjectViewer

java.lang.Object
main.boundary.modelviewer.ProjectViewer

public class ProjectViewer extends Object
Displays the project details.
  • Constructor Details

    • ProjectViewer

      public ProjectViewer()
  • Method Details

    • getProjectStatus

      public static ProjectStatus getProjectStatus() throws PageBackException
      Displays a menu to the user to select a project status and returns the selected ProjectStatus enum value. If an invalid option is selected, it prompts the user to retry or go back, and throws a PageBackException if the user chooses to go back.
      Returns:
      the selected ProjectStatus enum value.
      Throws:
      PageBackException - if the user chooses to go back to the previous page.
    • generateDetailsByProjectID

      public static void generateDetailsByProjectID() throws PageBackException
      Prompts the user to enter a project ID and displays the details of the project with the matching ID using the ProjectRepository and Project object's displayProject() method.
      Throws:
      PageBackException - if the user chooses to go back to the previous page.
    • generateDetailsBySupervisorID

      public static void generateDetailsBySupervisorID() throws PageBackException
      Prompts the user to enter a supervisor ID and displays the details of projects supervised by the supervisor with the matching ID. It checks if the supervisor ID is valid using the FacultyRepository and handles cases where the supervisor is not found or the user wants to go back by throwing a PageBackException.
      Throws:
      PageBackException - if the user wants to go back
    • generateDetailsByStudentID

      public static void generateDetailsByStudentID() throws PageBackException
      Prompts the user to enter a student ID and displays the details of projects that require the student with the matching ID. It uses the ProjectRepository to find projects that match the student ID and calls the displayProject() method on each project to display their details. It also handles cases where no projects are found and prompts the user to go back using a PageBackException.
      Throws:
      PageBackException - if the user wants to go back
    • generateDetailsByStatus

      public static void generateDetailsByStatus() throws PageBackException
      Prompts the user to select a project status and displays the details of projects with the matching status. It calls the getProjectStatus() method to get the selected status, and uses the ProjectRepository to find projects that match the status. It handles cases where no projects are found and prompts the user to go back using a PageBackException.
      Throws:
      PageBackException - if the user wants to go back
    • generateProjectDetails

      public static void generateProjectDetails() throws PageBackException
      Provides a menu to the user to select the way to search for project details and calls the corresponding method based on the user's selection. It also handles cases where the user wants to go back by calling the ChangePage.changePage() method and throwing a PageBackException.
      Throws:
      PageBackException - if the user wants to go back
    • viewAvailableProjectList

      public static void viewAvailableProjectList(Student student) throws PageBackException
      Displays the project details.
      Parameters:
      student - the student to display the project details for
      Throws:
      PageBackException - if the user wants to go back
    • viewAllProject

      public static void viewAllProject() throws PageBackException
      Displays the project details.
      Throws:
      PageBackException - if the user wants to go back
    • viewStudentProject

      public static void viewStudentProject(Student student) throws PageBackException
      Displays the project details.
      Parameters:
      student - the student
      Throws:
      PageBackException - if the user wants to go back