Class AdminDashboardController

java.lang.Object
com.esprit.controllers.users.AdminDashboardController

public class AdminDashboardController extends Object
JavaFX controller class for the RAKCHA application. Handles UI interactions and manages view logic using FXML.
Since:
1.0.0
Version:
1.0.0
Author:
RAKCHA Team
  • Field Details

    • LOGGER

      private static final Logger LOGGER
    • roleTableColumn

      javafx.scene.control.TableColumn<User,String> roleTableColumn
    • photoDeProfilTableColumn

      javafx.scene.control.TableColumn<User,javafx.scene.layout.HBox> photoDeProfilTableColumn
    • lastNameTableColumn

      javafx.scene.control.TableColumn<User,String> lastNameTableColumn
    • passwordTableColumn

      javafx.scene.control.TableColumn<User,String> passwordTableColumn
    • numTelTableColumn

      javafx.scene.control.TableColumn<User,Integer> numTelTableColumn
    • firstNameTableColumn

      javafx.scene.control.TableColumn<User,String> firstNameTableColumn
    • dateDeNaissanceTableColumn

      javafx.scene.control.TableColumn<User,javafx.scene.control.DatePicker> dateDeNaissanceTableColumn
    • adresseTableColumn

      javafx.scene.control.TableColumn<User,String> adresseTableColumn
    • emailTableColumn

      javafx.scene.control.TableColumn<User,String> emailTableColumn
    • deleteTableColumn

      javafx.scene.control.TableColumn<User,javafx.scene.control.Button> deleteTableColumn
    • formValidator

      net.synedra.validatorfx.Validator formValidator
    • tableValidator

      net.synedra.validatorfx.Validator tableValidator
    • formValidatorTooltip

      javafx.scene.control.Tooltip formValidatorTooltip
    • tableValidatorTooltip

      javafx.scene.control.Tooltip tableValidatorTooltip
    • adresseTextField

      private javafx.scene.control.TextField adresseTextField
    • dateDeNaissanceDatePicker

      private javafx.scene.control.DatePicker dateDeNaissanceDatePicker
    • emailTextField

      private javafx.scene.control.TextField emailTextField
    • idTextField

      private javafx.scene.control.TextField idTextField
    • firstNameTextField

      private javafx.scene.control.TextField firstNameTextField
    • phoneNumberTextField

      private javafx.scene.control.TextField phoneNumberTextField
    • passwordTextField

      private javafx.scene.control.TextField passwordTextField
    • photoDeProfilImageView

      private javafx.scene.image.ImageView photoDeProfilImageView
    • lastNameTextField

      private javafx.scene.control.TextField lastNameTextField
    • roleComboBox

      private javafx.scene.control.ComboBox<String> roleComboBox
    • userTableView

      private javafx.scene.control.TableView<User> userTableView
  • Constructor Details

    • AdminDashboardController

      public AdminDashboardController()
  • Method Details

    • initialize

      void initialize()
      Sets up user interface components for a table displaying information about users, including text fields, combo boxes, and validation listeners to ensure data validity.
    • addValidationListener

      private void addValidationListener(javafx.scene.control.TextField textField, Predicate<String> validationPredicate, String errorMessage)
      /** Adds a listener to a `TextField` that validates the inputted string using a provided `Predicate`. If the string is invalid, a tooltip with an error message is displayed near the text field.
      Parameters:
      textField - TextField component whose text value will be validated and whose tooltip will be updated accordingly.
      validationPredicate - function that determines whether or not a given string is valid, and it is used to determine whether an error message should be displayed when the user types something into the text field.
      errorMessage - message to be displayed as a tooltip when the user enters an invalid value in the text field.
    • readUserTable

      void readUserTable()
      Reads data from a User Service and populates the user table view with the retrieved data.
    • addAdmin

      void addAdmin(javafx.event.ActionEvent event)
      /** Allows users to create a new admin account by providing their first name, last name, phone number, password, email, and role. It then validates the input and creates a new admin user using the provided information.
      Parameters:
      event - `addAdmin` action, triggering the execution of the code within the function.
    • setupCellValueFactories

      private void setupCellValueFactories()
      Sets up cell value factories for each column of a table displaying information about users. These factories provide the content for each cell, such as a user's first or last name, phone number, password, role, address, date of birth, email, and photo profile picture.
    • setupCellFactories

      private void setupCellFactories()
      Sets up cell factories for the `adresse` and `email` columns of the user table, which will display a text field for each column. The `cellFactory` method is used to create TableCells that can display text data in a formatted way.
    • setupCellOnEditCommit

      private void setupCellOnEditCommit()
    • clearTextFields

      void clearTextFields(javafx.event.ActionEvent event)
    • delete

      void delete(Long id)
    • importImage

      void importImage(javafx.event.ActionEvent event)
    • update

      void update(User user)
    • generatePDF

      void generatePDF()
    • signOut

      public void signOut(javafx.event.ActionEvent event) throws IOException
      Throws:
      IOException