Class ItemListFrame
java.lang.Object
edu.ntnu.stud.controller.framecontroller.ItemListFrame
- All Implemented Interfaces:
javafx.fxml.Initializable
- Direct Known Subclasses:
InventoryFrame
,ShoppingListFrame
An abstract class which represents a basic table frame used for the Inventory and Shopping List.
The class implements the Initializable interface and provides a method for updating the items in
the table.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected javafx.scene.layout.StackPane
protected javafx.scene.layout.VBox
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
ItemListFrame
(String fxmlFilePath) Takes in the file name for the .fxml file for the class extending the ItemListFrame class. -
Method Summary
Modifier and TypeMethodDescriptionjavafx.scene.layout.StackPane
getFrame()
Returns the frame of the ItemListFrame.void
initialize
(URL location, ResourceBundle resources) Initializes the table with the columns and sets the items in the table.void
updateItems
(Collection<javafx.util.Pair<String, String>> items) Updates the items in the table.
-
Field Details
-
itemBox
protected javafx.scene.layout.VBox itemBox -
tableView
-
nameColumn
-
amountColumn
-
frame
protected javafx.scene.layout.StackPane frame
-
-
Constructor Details
-
ItemListFrame
Takes in the file name for the .fxml file for the class extending the ItemListFrame class.- Parameters:
fxmlFilePath
- The file path to the .fxml file.
-
-
Method Details
-
initialize
Initializes the table with the columns and sets the items in the table. Implemented from the Initializable interface.- Specified by:
initialize
in interfacejavafx.fxml.Initializable
- Parameters:
location
- The location used to resolve relative paths for the root object, or null if the location is not known.resources
- The resources used to localize the root object, or null if the root object was not localized.
-
updateItems
Updates the items in the table.- Parameters:
items
- The items to be updated in the table.
-
getFrame
public javafx.scene.layout.StackPane getFrame()Returns the frame of the ItemListFrame.- Returns:
- The frame of the ItemListFrame.
-