Class TransactionController

java.lang.Object
edu.ntnu.idi.idatt.view.components.AbstractController<TransactionModel>
edu.ntnu.idi.idatt.view.primary.transactions.TransactionController

public class TransactionController extends AbstractController<TransactionModel>
Controller class of the Transaction MVC.
  • Constructor Details

    • TransactionController

      public TransactionController(TransactionModel model)
      Constructor of TransactionController.

      Loads initial transactions to the model's observable list.

      Parameters:
      model - - Reference to the TransactionModel instance.
  • Method Details

    • initController

      public void initController()
      Method for initializing controller.

      Activates listener to searchbar query.

    • setTransactionModel

      public void setTransactionModel(List<Transaction> list)
      Setter for the transactions in the model.

      Converts Transaction into TransactionComponent.

      Parameters:
      list - - List of transactions to be set.
    • handleSearchQuery

      public void handleSearchQuery()
      Method for handeling the searchbar.

      Sets transaction in the model based on query property.

    • sortTransactionsBy

      public void sortTransactionsBy(TransactionController.SortAction action)
      Method for sorting transactions.

      Sort transactions after defined sorting methods.

      Parameters:
      action - - Instance of SortAction enum.