Cloneing recipes is possible
This commit is contained in:
parent
1414393aad
commit
0525885979
2 changed files with 15 additions and 1 deletions
|
|
@ -219,6 +219,20 @@ public class FoodpalApplicationCtrl {
|
|||
public Recipe getSelectedRecipe() {
|
||||
return recipeList.getSelectionModel().getSelectedItem();
|
||||
}
|
||||
|
||||
/**
|
||||
* Clones a recipe, when clicking on the button "clone"
|
||||
*/
|
||||
public void cloneRecipe() throws IOException, InterruptedException {
|
||||
Recipe selected = recipeList.getSelectionModel().getSelectedItem();
|
||||
if (selected == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
server.cloneRecipe(selected.getId());
|
||||
refresh();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -94,7 +94,7 @@
|
|||
<HBox spacing="10">
|
||||
<Button fx:id="AddRecipeButton" onAction="#addRecipe" text="Add Recipe" />
|
||||
<Button fx:id="RemoveRecipeButton" onAction="#removeSelectedRecipe" text="Remove Recipe" />
|
||||
<Button mnemonicParsing="false" text="Clone" />
|
||||
<Button fx:id= "CloneREcipeButton" mnemonicParsing="false" onAction="#cloneRecipe" text="Clone" />
|
||||
</HBox>
|
||||
</VBox>
|
||||
</left>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue