public class ImportArticlesController extends ControllerWithMenu implements ProductCreationObserver, ArticleImportationObserver
Modifier and Type | Field and Description |
---|---|
private ProductDB |
productDB |
private Shop |
targetShop
The shop in which the articles need to be imported
|
private ImportArticlesView |
view |
master
Constructor and Description |
---|
ImportArticlesController(ControllerMaster master,
Shop targetShop) |
Modifier and Type | Method and Description |
---|---|
void |
articleImported(Article article)
Tells the view that a new article has been created
|
private java.util.List<Product> |
getImportableProducts() |
void |
importArticles(java.util.List<Article> articlesToImport)
Imports the products added manually be the user
|
void |
importFromCSV()
Import articles from a csv using the ArticleImporterFromFile
|
void |
onCreateNewProduct()
Tells the ControllerMaster that the user wants to create a product
|
void |
onCreateProductClosed()
Tells the view that new products can be created again
|
void |
onProductCreated(Product product)
Tells the view that a new product has been created
|
onHelpViewStatusChanged, onLogout, onShowAllGroceryLists, onShowAllRecipes, onShowEditProfile, onShowHelp, onShowMap, setView
isHelpOpen
private ProductDB productDB
private ImportArticlesView view
private Shop targetShop
public ImportArticlesController(ControllerMaster master, Shop targetShop)
public void onProductCreated(Product product)
onProductCreated
in interface ProductCreationObserver
product
- public void onCreateProductClosed()
onCreateProductClosed
in interface ProductCreationObserver
public void articleImported(Article article)
articleImported
in interface ArticleImportationObserver
article
- private java.util.List<Product> getImportableProducts() throws DatabaseException
DatabaseException
public void importFromCSV()
public void importArticles(java.util.List<Article> articlesToImport)
public void onCreateNewProduct()