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
ViewController is an abstract class that implements Initializable interface and handles IPT View Controllers
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate javafx.fxml.FXMLLoaderprivate javafx.scene.Sceneprivate javafx.stage.Stageprivate static final Pattern -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleancheckDatePickersContent(javafx.scene.control.DatePicker... datePickers) Checks if any DatePicker is blankprotected booleancheckTextFieldsContent(javafx.scene.control.TextField... textFields) Checks if any textFields is blankprotected voidclearDatePickersContent(javafx.scene.control.DatePicker... datePickers) Clears any TextFields contentprotected voidclearTextFieldsContent(javafx.scene.control.TextField... textFields) Clears any TextFields contentprotected voidgeneratePayPalAlert(String currentEmail, String currentPassword, javafx.scene.control.TextField emailTextField) Generate a PayPal alert to require a PayPal passwordprotected javafx.fxml.FXMLLoaderprotected javafx.scene.Sceneprotected javafx.stage.StagegetStage()protected abstract voidInitializes View Componentprotected abstract voidonBackButtonClick(javafx.event.ActionEvent event) protected voidonButtonClickNavigateToView(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 viewprotected voidraiseConfirmationAlert(String confirmationMessage) Shows a confirmation alert on screenprotected voidraiseErrorAlert(String errorMessage) Shows an error alert on screenprotected voidraiseInformationAlert(String informationMessage) Shows an information alert on screenprotected voidsetFxmlLoader(javafx.fxml.FXMLLoader fxmlLoader) protected voidsetLocalScene(javafx.scene.Scene scene) protected voidsetStage(javafx.stage.Stage stage) protected booleanvalidateEmail(String emailString) Validates email structureMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface javafx.fxml.Initializable
initialize
-
Field Details
-
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() -
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
Shows an error alert on screen- Parameters:
errorMessage- The text of an error message
-
raiseConfirmationAlert
Shows a confirmation alert on screen- Parameters:
confirmationMessage- The text of a confirmation alert
-
raiseInformationAlert
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 emailcurrentPassword- A string that represents a PayPal passwordemailTextField- The text field that contains PayPal email- See Also:
-
validateEmail
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)
-