Class StudentMainPage

java.lang.Object
main.boundary.mainpage.StudentMainPage

public class StudentMainPage extends Object
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 Details

    • StudentMainPage

      public StudentMainPage()
  • Method Details

    • studentMainPage

      public static void studentMainPage(User user)
      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

      private static void viewHistoryAndStatusOfMyRequest(Student student) throws PageBackException
      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

      private static void deregisterForProject(Student student) throws PageBackException
      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

      private static String getProjectID() throws PageBackException
      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

      private static void viewHistoryAndStatusOfMyProject(Student student) throws PageBackException
      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

      private static void registerProject(Student student) throws PageBackException
      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

      private static void viewMySupervisor(Student student) throws PageBackException
      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.