fixed errors with detailed view on deletions and edits
This commit is contained in:
parent
f9db7cf370
commit
c7b651e266
1 changed files with 11 additions and 6 deletions
|
|
@ -137,14 +137,20 @@ public class FoodpalApplicationCtrl implements LocaleAware {
|
||||||
}
|
}
|
||||||
|
|
||||||
// till the all the code from everyone is implemented for now to not have errors
|
// till the all the code from everyone is implemented for now to not have errors
|
||||||
private void showRecipeDetails(Recipe newRecipe) {
|
private void showRecipeDetails(Recipe recipe) {
|
||||||
recipeNameLabel.setText(newRecipe.getName());
|
if (recipe == null) {
|
||||||
ingredientsListView.getItems().setAll(newRecipe.getIngredients());
|
recipeNameLabel.setText("");
|
||||||
preparationListView.getItems().setAll(newRecipe.getPreparationSteps());
|
ingredientsListView.getItems().clear();
|
||||||
|
preparationListView.getItems().clear();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
recipeNameLabel.setText(recipe.getName());
|
||||||
|
ingredientsListView.getItems().setAll(recipe.getIngredients());
|
||||||
|
preparationListView.getItems().setAll(recipe.getPreparationSteps());
|
||||||
}
|
}
|
||||||
|
|
||||||
// Button handlers
|
// Button handlers
|
||||||
|
|
||||||
@FXML
|
@FXML
|
||||||
public void refresh() {
|
public void refresh() {
|
||||||
// TODO: someone else doing this
|
// TODO: someone else doing this
|
||||||
|
|
@ -165,7 +171,6 @@ public class FoodpalApplicationCtrl implements LocaleAware {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Adds a recipe, by going to a different scene, there you insert the title and bam recipe created
|
* Adds a recipe, by going to a different scene, there you insert the title and bam recipe created
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue