diff --git a/src/main/java/com/bib/essensbestellungsverwaltung/CreateFoodplanController.java b/src/main/java/com/bib/essensbestellungsverwaltung/CreateFoodplanController.java index e7290c7..2dc41f2 100644 --- a/src/main/java/com/bib/essensbestellungsverwaltung/CreateFoodplanController.java +++ b/src/main/java/com/bib/essensbestellungsverwaltung/CreateFoodplanController.java @@ -31,20 +31,28 @@ public class CreateFoodplanController { ChoiceBox secondDessert; private List foods; + private List veganFoods; private List desserts; + private List veganDesserts; private FoodPlan currentPlan; @FXML public void initialize() { + veganFoods = FoodMgr.getVeganFood(false); foods = FoodMgr.getFood(false); + veganDesserts = FoodMgr.getVeganFood(true); desserts = FoodMgr.getFood(true); + ObservableList foodOptions = FXCollections.observableArrayList(foods.stream().map(food -> food.getId() + ": " + food.getName()).toList().toArray(new String[0])); - firstMeal.setItems(foodOptions); + ObservableList veganFoodOptions = FXCollections.observableArrayList(veganFoods.stream().map(food -> food.getId() + ": " + food.getName()).toList().toArray(new String[0])); + ObservableList veganDessertOptions = FXCollections.observableArrayList(veganDesserts.stream().map(dessert -> dessert.getId() + ": " + dessert.getName()).toList().toArray(new String[0])); + ObservableList dessertOptions = FXCollections.observableArrayList(desserts.stream().map(dessert -> dessert.getId() + ": " + dessert.getName()).toList().toArray(new String[0])); + firstMeal.setItems(veganFoodOptions); secondMeal.setItems(foodOptions); - ObservableList dessertOptions = FXCollections.observableArrayList(desserts.stream().map(dessert -> dessert.getId() + ": " + dessert.getName()).toList().toArray(new String[0])); - firstDessert.setItems(dessertOptions); + + firstDessert.setItems(veganDessertOptions); secondDessert.setItems(dessertOptions); date.setValue(LocalDate.now());