Package com.esprit.controllers.products
Class ListOrderController
java.lang.Object
com.esprit.controllers.products.ListOrderController
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 -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(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
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.
-
Field Details
-
LOGGER
-
idStatu
-
idadresse
-
iddate
-
idnom
-
idnumero
-
idprenom
-
orderTableView
-
SearchBar
private javafx.scene.control.TextField SearchBar -
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
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.
-