diff --git a/src/main/java/ch/zhaw/gartenverwaltung/MyGardenController.java b/src/main/java/ch/zhaw/gartenverwaltung/MyGardenController.java index 3901377..e54e608 100644 --- a/src/main/java/ch/zhaw/gartenverwaltung/MyGardenController.java +++ b/src/main/java/ch/zhaw/gartenverwaltung/MyGardenController.java @@ -90,10 +90,12 @@ public class MyGardenController { Label label = new Label(plant.name()); label.setMaxWidth(2000); HBox.setHgrow(label, Priority.ALWAYS); + Button details = new Button("Details"); Button delete = new Button("delete"); details.setOnAction(getGoToCropDetailEvent(crop)); delete.setOnAction(getDeleteCropEvent(crop)); + hBox.getChildren().addAll(imageView, label, details, delete); return hBox; } diff --git a/src/main/java/ch/zhaw/gartenverwaltung/MyScheduleController.java b/src/main/java/ch/zhaw/gartenverwaltung/MyScheduleController.java index 417722a..e895480 100644 --- a/src/main/java/ch/zhaw/gartenverwaltung/MyScheduleController.java +++ b/src/main/java/ch/zhaw/gartenverwaltung/MyScheduleController.java @@ -9,9 +9,6 @@ import ch.zhaw.gartenverwaltung.models.GardenSchedule; import ch.zhaw.gartenverwaltung.types.Crop; import ch.zhaw.gartenverwaltung.types.Plant; import ch.zhaw.gartenverwaltung.types.Task; -import javafx.beans.property.ListProperty; -import javafx.beans.property.SimpleListProperty; -import javafx.collections.FXCollections; import javafx.fxml.FXML; import javafx.scene.control.Label; import javafx.scene.control.ListCell; @@ -37,8 +34,6 @@ public class MyScheduleController { @Inject private PlantList plantList; - private final ListProperty cropListProperty = new SimpleListProperty<>(FXCollections.observableArrayList()); - @FXML private Label day1_label; @@ -90,15 +85,8 @@ public class MyScheduleController { @AfterInject @SuppressWarnings("unused") public void init() { - List cropList; - try { - cropList = garden.getCrops(); - cropListProperty.addAll(cropList); - } catch (IOException e) { - e.printStackTrace(); - } setCellFactoryListView(); - scheduledPlants_listview.itemsProperty().bind(cropListProperty); + scheduledPlants_listview.itemsProperty().bind(garden.getPlantedCrops()); lookForSelectedListEntries(); setDayLabels(); information_label.setText("");