Class ViewController

java.lang.Object
com.prog3.ipt.Controller.ViewController
All Implemented Interfaces:
javafx.fxml.Initializable
Direct Known Subclasses:
EditProfileViewController, GoogleMapsViewController, HomeViewController, InfoViewController, LoadingViewController, LoginRegisterViewController, NoticesViewController, SearchPathViewController, TravelDocumentsManagementViewController

public abstract class ViewController extends Object implements javafx.fxml.Initializable
ViewController is an abstract class that implements Initializable interface and handles IPT View Controllers
  • Field Details

    • VALID_EMAIL_ADDRESS_REGEX

      private static final Pattern VALID_EMAIL_ADDRESS_REGEX
    • fxmlLoader

      private javafx.fxml.FXMLLoader fxmlLoader
    • localScene

      private javafx.scene.Scene localScene
    • stage

      private javafx.stage.Stage stage
  • Constructor Details

    • ViewController

      public ViewController()
  • Method Details

    • setFxmlLoader

      protected void setFxmlLoader(javafx.fxml.FXMLLoader fxmlLoader)
    • setLocalScene

      protected void setLocalScene(javafx.scene.Scene scene)
    • setStage

      protected void setStage(javafx.stage.Stage stage)
    • getFxmlLoader

      protected javafx.fxml.FXMLLoader getFxmlLoader()
    • getLocalScene

      protected javafx.scene.Scene getLocalScene()
    • getStage

      protected javafx.stage.Stage getStage()
    • onButtonClickNavigateToView

      protected void onButtonClickNavigateToView(javafx.scene.control.Button clickedButton, String destinationView)
      Loads a .fxml file, creates a scene and set up a stage for a clicked button and a destination view
      Parameters:
      clickedButton - A reference to a Button JavaFX object
      destinationView - A string that represents the filename of the destination view
      See Also:
      • FXMLLoader
      • Scene
      • Stage
    • checkTextFieldsContent

      protected boolean checkTextFieldsContent(javafx.scene.control.TextField... textFields)
      Checks if any textFields is blank
      Parameters:
      textFields - A collection of TextField objects
      Returns:
      True if there is no blank text field, otherwise false
      See Also:
    • checkDatePickersContent

      protected boolean checkDatePickersContent(javafx.scene.control.DatePicker... datePickers)
      Checks if any DatePicker is blank
      Parameters:
      datePickers - A collection of DatePicker objects
      Returns:
      True if there is no blank text field, otherwise false
      See Also:
    • clearTextFieldsContent

      protected void clearTextFieldsContent(javafx.scene.control.TextField... textFields)
      Clears any TextFields content
      Parameters:
      textFields - A collection of TextField objects
    • clearDatePickersContent

      protected void clearDatePickersContent(javafx.scene.control.DatePicker... datePickers)
      Clears any TextFields content
      Parameters:
      datePickers - A collection of DataPicker objects
    • initializeViewComponents

      protected abstract void initializeViewComponents()
      Initializes View Component
    • raiseErrorAlert

      protected void raiseErrorAlert(String errorMessage)
      Shows an error alert on screen
      Parameters:
      errorMessage - The text of an error message
    • raiseConfirmationAlert

      protected void raiseConfirmationAlert(String confirmationMessage)
      Shows a confirmation alert on screen
      Parameters:
      confirmationMessage - The text of a confirmation alert
    • raiseInformationAlert

      protected void raiseInformationAlert(String informationMessage)
      Shows an information alert on screen
      Parameters:
      informationMessage - The text of an information alert
    • generatePayPalAlert

      protected void generatePayPalAlert(String currentEmail, String currentPassword, javafx.scene.control.TextField emailTextField)
      Generate a PayPal alert to require a PayPal password
      Parameters:
      currentEmail - A string that represents a PayPal email
      currentPassword - A string that represents a PayPal password
      emailTextField - The text field that contains PayPal email
      See Also:
    • validateEmail

      protected boolean validateEmail(String emailString)
      Validates email structure
      Parameters:
      emailString - A string that represents an email
      Returns:
      True if it is valid, otherwise false
      See Also:
    • onBackButtonClick

      protected abstract void onBackButtonClick(javafx.event.ActionEvent event)