Class ItemListFrame

java.lang.Object
edu.ntnu.stud.controller.framecontroller.ItemListFrame
All Implemented Interfaces:
javafx.fxml.Initializable
Direct Known Subclasses:
InventoryFrame, ShoppingListFrame

public abstract class ItemListFrame extends Object implements javafx.fxml.Initializable
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:
  • The Initializable interface is used to ensure the fxml file is loaded correctly.
  • Field Details

    • itemBox

      protected javafx.scene.layout.VBox itemBox
    • tableView

      protected javafx.scene.control.TableView<javafx.util.Pair<String,String>> tableView
    • nameColumn

      protected javafx.scene.control.TableColumn<javafx.util.Pair<String,String>,String> nameColumn
    • amountColumn

      protected javafx.scene.control.TableColumn<javafx.util.Pair<String,String>,String> amountColumn
    • frame

      protected javafx.scene.layout.StackPane frame
  • Constructor Details

    • ItemListFrame

      protected ItemListFrame(String fxmlFilePath)
      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

      public void initialize(URL location, ResourceBundle resources)
      Initializes the table with the columns and sets the items in the table. Implemented from the Initializable interface.
      Specified by:
      initialize in interface javafx.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

      public void updateItems(Collection<javafx.util.Pair<String,String>> items)
      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.