@Override
	public void actionPerformed(ActionEvent e) {

		if (e.getSource() == view.ingredientsButton) {
			setUpView(new IngredientView(model.getAllIngredients()));
		}
		if (e.getSource() == view.preparationButton) {
			setUpView(new PreparationView(model));
		}

		if (e.getSource() == view.starter.panelSearch) {

			view.updateDishes(
					model.filterDishesOfType(1,
							view.starter.panelSearch.getText()), 1);

			removeAllDishListeners(); // prevents adding another listener to a component that already have one
			addListenersToDishComponents();
		}
		if (e.getSource() == view.main.panelSearch) {

			view.updateDishes(model.filterDishesOfType(2,
					view.main.panelSearch.getText()), 2);

			removeAllDishListeners();
			addListenersToDishComponents();
		}
		if (e.getSource() == view.desert.panelSearch) {
			view.updateDishes(
					model.filterDishesOfType(3,
							view.desert.panelSearch.getText()), 3);

			removeAllDishListeners();
			addListenersToDishComponents();
		}
		if (e.getSource() == view.btnNewButton[0]) { // 0 == type 1

			removeDish(0);
		}
		if (e.getSource() == view.btnNewButton[1]) { // 1 == type 2

			removeDish(1);
		}
		if (e.getSource() == view.btnNewButton[2]) { // 2 == type 3
			
			removeDish(2);
		}
	}