Class TransactionController
java.lang.Object
edu.ntnu.idi.idatt.view.components.AbstractController<TransactionModel>
edu.ntnu.idi.idatt.view.primary.transactions.TransactionController
Controller class of the Transaction MVC.
-
Nested Class Summary
Nested Classes -
Field Summary
Fields inherited from class AbstractController
model -
Constructor Summary
ConstructorsConstructorDescriptionConstructor of TransactionController. -
Method Summary
Modifier and TypeMethodDescriptionvoidMethod for handeling the searchbar.voidMethod for initializing controller.voidsetTransactionModel(List<Transaction> list) Setter for the transactions in the model.voidMethod for sorting transactions.
-
Constructor Details
-
TransactionController
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
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
Method for sorting transactions.Sort transactions after defined sorting methods.
- Parameters:
action- - Instance of SortAction enum.
-