Package main.boundary.modelviewer
Class ProjectViewer
java.lang.Object
main.boundary.modelviewer.ProjectViewer
Displays the project details.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
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.static void
Prompts the user to select a project status and displays the details of projects with the matching status.static void
Prompts the user to enter a student ID and displays the details of projects that require the student with the matching ID.static void
Prompts the user to enter a supervisor ID and displays the details of projects supervised by the supervisor with the matching ID.static void
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.static ProjectStatus
Displays a menu to the user to select a project status and returns the selected ProjectStatus enum value.static void
Displays the project details.static void
viewAvailableProjectList
(Student student) Displays the project details.static void
viewStudentProject
(Student student) Displays the project details.
-
Constructor Details
-
ProjectViewer
public ProjectViewer()
-
-
Method Details
-
getProjectStatus
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
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
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
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
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
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
Displays the project details.- Parameters:
student
- the student to display the project details for- Throws:
PageBackException
- if the user wants to go back
-
viewAllProject
Displays the project details.- Throws:
PageBackException
- if the user wants to go back
-
viewStudentProject
Displays the project details.- Parameters:
student
- the student- Throws:
PageBackException
- if the user wants to go back
-