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
Modifier and TypeFieldDescriptionprivate javafx.fxml.FXMLLoader
private javafx.scene.Scene
private javafx.stage.Stage
private static final Pattern
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
checkDatePickersContent
(javafx.scene.control.DatePicker... datePickers) Checks if any DatePicker is blankprotected boolean
checkTextFieldsContent
(javafx.scene.control.TextField... textFields) Checks if any textFields is blankprotected void
clearDatePickersContent
(javafx.scene.control.DatePicker... datePickers) Clears any TextFields contentprotected void
clearTextFieldsContent
(javafx.scene.control.TextField... textFields) Clears any TextFields contentprotected void
generatePayPalAlert
(String currentEmail, String currentPassword, javafx.scene.control.TextField emailTextField) Generate a PayPal alert to require a PayPal passwordprotected javafx.fxml.FXMLLoader
protected javafx.scene.Scene
protected javafx.stage.Stage
getStage()
protected abstract void
Initializes View Componentprotected abstract void
onBackButtonClick
(javafx.event.ActionEvent event) 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 viewprotected void
raiseConfirmationAlert
(String confirmationMessage) Shows a confirmation alert on screenprotected void
raiseErrorAlert
(String errorMessage) Shows an error alert on screenprotected void
raiseInformationAlert
(String informationMessage) Shows an information alert on screenprotected void
setFxmlLoader
(javafx.fxml.FXMLLoader fxmlLoader) protected void
setLocalScene
(javafx.scene.Scene scene) protected void
setStage
(javafx.stage.Stage stage) protected boolean
validateEmail
(String emailString) Validates email structureMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods 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)
-