Package main.boundary.mainpage
Class StudentMainPage
java.lang.Object
main.boundary.mainpage.StudentMainPage
This is a Java class that represents the main page of a student in a system or application. It contains several methods for displaying different functionalities of the student main page, such as viewing the user profile, changing the password, viewing project lists, registering/deregistering for projects, changing project title, viewing project history and status, and logging out.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprivate static void
changeTitleForProject
(Student student) This private method is called when the student wants to change the title of their project.private static void
deregisterForProject
(Student student) This private method is called when the student wants to deregister from a project.private static String
This private method is called to get the project ID from the user.private static void
registerProject
(Student student) This private method is called when the student wants to register for a project.static void
studentMainPage
(User user) This method displays the main page of a student.private static void
viewHistoryAndStatusOfMyProject
(Student student) This private method is called to view the history and status of the student's project.private static void
viewHistoryAndStatusOfMyRequest
(Student student) private static void
viewMySupervisor
(Student student) This private method is called to view the supervisor of the student's project.
-
Constructor Details
-
StudentMainPage
public StudentMainPage()
-
-
Method Details
-
studentMainPage
This method displays the main page of a student. It takes a User object as a parameter and displays a menu of options for the student to choose from. The user's choice is then processed using a switch statement, which calls different methods based on the choice.- Parameters:
user
- The user object of the student.
-
viewHistoryAndStatusOfMyRequest
- Throws:
PageBackException
-
changeTitleForProject
private static void changeTitleForProject(Student student) throws PageBackException, ModelNotFoundException This private method is called when the student wants to change the title of their project. It displays the history and status of the student's project, prompts the student to enter a new title, and sends a request to change the title to the system. If an error occurs, the student is given the option to go back or retry.- Parameters:
student
- the student.- Throws:
PageBackException
- if the user wants to go back.ModelNotFoundException
-
deregisterForProject
This private method is called when the student wants to deregister from a project. It prompts the student to enter the project ID, sends a request to deregister from the project, and displays a success message. If an error occurs, the student is given the option to go back or retry.- Parameters:
student
- the student.- Throws:
PageBackException
- if the user wants to go back.
-
getProjectID
This private method is called to get the project ID from the user. It prompts the user to enter the project ID and returns it as a string. If the user wants to go back, a PageBackException is thrown.- Returns:
- the project ID.
- Throws:
PageBackException
- if the user wants to go back.
-
viewHistoryAndStatusOfMyProject
This private method is called to view the history and status of the student's project. It displays the project's information.- Parameters:
student
- the student.- Throws:
PageBackException
- if the user wants to go back.
-
registerProject
This private method is called when the student wants to register for a project. It prompts the student to enter the project ID, sends a request to register for the project, and displays a success message. If an error occurs, the student is given the option to go back or retry.- Parameters:
student
- the student.- Throws:
PageBackException
- if the user wants to go back.
-
viewMySupervisor
This private method is called to view the supervisor of the student's project. It displays the supervisor's information.- Parameters:
student
- the student.- Throws:
PageBackException
- if the user wants to go back.
-