refactor: annotation-based dependency-injection
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
package ch.zhaw.gartenverwaltung;
|
||||
|
||||
import ch.zhaw.gartenverwaltung.bootstrap.Inject;
|
||||
import ch.zhaw.gartenverwaltung.io.PlantList;
|
||||
import ch.zhaw.gartenverwaltung.models.Garden;
|
||||
import ch.zhaw.gartenverwaltung.io.HardinessZoneNotSetException;
|
||||
@@ -9,7 +10,6 @@ import ch.zhaw.gartenverwaltung.types.Crop;
|
||||
import ch.zhaw.gartenverwaltung.types.Pest;
|
||||
import ch.zhaw.gartenverwaltung.types.Plant;
|
||||
import ch.zhaw.gartenverwaltung.types.Task;
|
||||
import javafx.event.ActionEvent;
|
||||
import javafx.fxml.FXML;
|
||||
import javafx.geometry.Pos;
|
||||
import javafx.scene.control.Button;
|
||||
@@ -26,18 +26,16 @@ import java.util.logging.Logger;
|
||||
|
||||
public class CropDetailController {
|
||||
private Crop crop;
|
||||
|
||||
@Inject
|
||||
private PlantList plantList;
|
||||
@Inject
|
||||
private GardenSchedule gardenSchedule;
|
||||
@Inject
|
||||
private Garden garden;
|
||||
|
||||
private static final Logger LOG = Logger.getLogger(CropDetailController.class.getName());
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public void injectDependencies(Garden garden, PlantList plantList, GardenSchedule gardenSchedule) {
|
||||
this.garden = garden;
|
||||
this.plantList = plantList;
|
||||
this.gardenSchedule = gardenSchedule;
|
||||
}
|
||||
@FXML
|
||||
private ImageView imageView;
|
||||
|
||||
@@ -75,23 +73,23 @@ public class CropDetailController {
|
||||
private Label spacing_label;
|
||||
|
||||
@FXML
|
||||
void editTaskList(ActionEvent event) {
|
||||
void editTaskList() {
|
||||
|
||||
}
|
||||
|
||||
@FXML
|
||||
void goBack(ActionEvent event) {
|
||||
void goBack() {
|
||||
Stage stage = (Stage) imageView.getScene().getWindow();
|
||||
stage.close();
|
||||
}
|
||||
|
||||
@FXML
|
||||
void setArea(ActionEvent event) {
|
||||
void setArea() {
|
||||
|
||||
}
|
||||
|
||||
@FXML
|
||||
void setLocation(ActionEvent event) {
|
||||
void setLocation() {
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user