Class ListOrderController

java.lang.Object
com.esprit.controllers.products.ListOrderController

public class ListOrderController extends Object
Is responsible for handling user interactions related to order data display and manipulation. The controller initiates the display of the order table, enables cell selection, and implements a search function using an observable list. Additionally, it provides a delete column and handles deletion events. Finally, it offers an option to open a new stage with an analysis interface for further examination of the command data.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private javafx.scene.control.TableColumn<Order,Void>
     
    private javafx.scene.control.TableColumn<Order,String>
     
    private javafx.scene.control.TableColumn<Order,Date>
     
    private javafx.scene.control.TableColumn<Order,String>
     
    private javafx.scene.control.TableColumn<Order,Integer>
     
    private javafx.scene.control.TableColumn<Order,String>
     
    private javafx.scene.control.TableColumn<Order,String>
     
    private static final Logger
     
    private javafx.scene.control.TableView<Order>
     
    private javafx.scene.control.TextField
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    (package private) void
    Displays the details of a command in a table, including the client's first and last name, address, phone number, and order date, using a `PropertyValueFactory` to generate cell values based on the command object.
    private void
    Sets up a custom cell factory for a delete button in a table view, which when clicked deletes the item in the table and updates the view.
    (package private) void
    Sets up events for the `SearchBar` text property, triggering the `search` method when the text changes.
    private void
    search(String keyword)
    Receives a keyword and filters the `Order` objects based on their addresses, client names, or statuses containing the keyword.
    (package private) void
    statOrder(javafx.event.ActionEvent event)
    Loads a new FXML interface, creates a new scene and stage, and attaches the scene to the stage.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • LOGGER

      private static final Logger LOGGER
    • idStatu

      private javafx.scene.control.TableColumn<Order,String> idStatu
    • idadresse

      private javafx.scene.control.TableColumn<Order,String> idadresse
    • iddate

      private javafx.scene.control.TableColumn<Order,Date> iddate
    • idnom

      private javafx.scene.control.TableColumn<Order,String> idnom
    • idnumero

      private javafx.scene.control.TableColumn<Order,Integer> idnumero
    • idprenom

      private javafx.scene.control.TableColumn<Order,String> idprenom
    • orderTableView

      private javafx.scene.control.TableView<Order> orderTableView
    • deleteColumn

      private javafx.scene.control.TableColumn<Order,Void> deleteColumn
  • Constructor Details

    • ListOrderController

      public ListOrderController()
  • Method Details

    • initialize

      void initialize()
      Sets up events for the `SearchBar` text property, triggering the `search` method when the text changes. It also calls `afficheOrder()` and initializes a delete column.
    • afficheOrder

      void afficheOrder()
      Displays the details of a command in a table, including the client's first and last name, address, phone number, and order date, using a `PropertyValueFactory` to generate cell values based on the command object. It also sets up an observable list to store the commands and enables cell selection for easy navigation.
    • search

      private void search(String keyword)
      Receives a keyword and filters the `Order` objects based on their addresses, client names, or statuses containing the keyword. It then adds the filtered objects to an observable list and sets it as the items of a table view.
      Parameters:
      keyword - search query used to filter the list of Commands displayed in the `orderTableView`.
    • initDeleteColumn

      private void initDeleteColumn()
      Sets up a custom cell factory for a delete button in a table view, which when clicked deletes the item in the table and updates the view.
    • statOrder

      void statOrder(javafx.event.ActionEvent event)
      Loads a new FXML interface, creates a new scene and stage, and attaches the scene to the stage. When the stage is closed, the original stage is shown.
      Parameters:
      event - ActionEvent object that triggered the function execution and provides access to the source node of the event, which is the button in this case.

      - `event`: An `ActionEvent` object representing the event triggered by the user's action on the UI element.

      The `event` object provides information about the source of the event, the type of event, and other details that can be used to handle the event appropriately.