public class GroceryListView extends ViewWithMenu implements AvailabilityChecker
Modifier and Type | Field and Description |
---|---|
private javafx.scene.control.Button |
createProductButton |
private static java.lang.String |
GROCERY_LIST_FXML
The fxml resource for the view
|
private GroceryListController |
groceryListController |
private ListComponent<ProductAmount> |
listComponent |
private javafx.scene.layout.VBox |
listViewContainer |
private javafx.scene.text.Text |
title |
Constructor and Description |
---|
GroceryListView(GroceryListController controller,
javafx.scene.Scene scene,
GroceryList groceryList,
java.util.List<Product> allProductsList) |
Modifier and Type | Method and Description |
---|---|
void |
addNewProduct(Product product)
Adds a new product to the listComponent
|
void |
checkListOfProductsAvailability(java.util.List<Product> products)
Checks if a list of product are available in some shops
|
void |
checkProductAvailability(ProductAmount product)
Cheks if some product are available in some shops
|
void |
enableCreateProductButton() |
java.util.List<ProductAmount> |
getProductAmountsList()
Gets all the products and amounts from the listComponent
|
boolean |
isListModified()
Checks if the listComponent has been modified
|
void |
onCreateProduct(javafx.event.ActionEvent event)
Event listener on the createProductButton
|
void |
onFindShops(javafx.event.ActionEvent event)
Event listener on the find shops button
|
void |
onSaveChanges(javafx.event.ActionEvent event)
Event listener on the save changes button
|
void |
showErrorSavingList()
Tells the user that an error occurred while saving the grocery list
|
boolean |
showSaveMessageBox()
Asks the user if he wants to save the grocery list
|
void |
showSuccessPopup()
Tells the user that the grocery list has been saved successfully
|
createMenu, disableHelpButton, enableHelpButton, getHeader, onEditProfileClick, onHelpClick, onLogoutClick, onMyGroceryListsClick, onMyRecipesClick, onShowMapClick
showDatabaseConnectionError, showDataBaseInternalError
private static final java.lang.String GROCERY_LIST_FXML
private javafx.scene.text.Text title
private javafx.scene.layout.VBox listViewContainer
private javafx.scene.control.Button createProductButton
private ListComponent<ProductAmount> listComponent
private GroceryListController groceryListController
public GroceryListView(GroceryListController controller, javafx.scene.Scene scene, GroceryList groceryList, java.util.List<Product> allProductsList)
public void enableCreateProductButton()
public void showSuccessPopup()
public void showErrorSavingList()
public boolean showSaveMessageBox()
public boolean isListModified()
public void addNewProduct(Product product)
product
- public void checkProductAvailability(ProductAmount product)
checkProductAvailability
in interface AvailabilityChecker
product
- public void checkListOfProductsAvailability(java.util.List<Product> products)
checkListOfProductsAvailability
in interface AvailabilityChecker
products
- public void onCreateProduct(javafx.event.ActionEvent event)
event
- public void onFindShops(javafx.event.ActionEvent event)
event
- public void onSaveChanges(javafx.event.ActionEvent event)
event
- public java.util.List<ProductAmount> getProductAmountsList()