Merge branch 'feature/locale' into 'main'

feature/locale

See merge request cse1105/2025-2026/teams/csep-team-76!12
This commit is contained in:
Oskar Rasieński 2025-12-04 14:43:33 +01:00
commit be82031c1e
19 changed files with 497 additions and 166 deletions

View file

@ -53,6 +53,6 @@ public class Main extends Application {
var addStep = FXML.load(AddStepsCtrl.class, "client", "scenes", "AddSteps.fxml");
var mainCtrl = INJECTOR.getInstance(MainCtrl.class);
mainCtrl.initialize(primaryStage, addName, foodpal, addIngredient, addStep);
mainCtrl.setup(primaryStage, addName, foodpal, addIngredient, addStep);
}
}

View file

@ -16,6 +16,7 @@
package client;
import client.scenes.FoodpalApplicationCtrl;
import client.utils.LocaleManager;
import com.google.inject.Binder;
import com.google.inject.Module;
import com.google.inject.Scopes;
@ -30,5 +31,7 @@ public class MyModule implements Module {
binder.bind(MainCtrl.class).in(Scopes.SINGLETON);
binder.bind(AddNameCtrl.class).in(Scopes.SINGLETON);
binder.bind(FoodpalApplicationCtrl.class).in(Scopes.SINGLETON);
binder.bind(LocaleManager.class).in(Scopes.SINGLETON);
}
}

View file

@ -15,33 +15,61 @@
*/
package client.scenes;
import client.utils.LocaleAware;
import client.utils.LocaleManager;
import client.utils.ServerUtils;
import com.google.inject.Inject;
import commons.Recipe;
import jakarta.ws.rs.WebApplicationException;
import javafx.fxml.FXML;
import javafx.scene.control.Alert;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
import javafx.scene.control.TextField;
import javafx.scene.input.KeyEvent;
import javafx.stage.Modality;
import java.io.IOException;
public class AddIngredientCtrl {
public class AddIngredientCtrl implements LocaleAware {
private final ServerUtils server;
private final MainCtrl mainCtrl;
private final FoodpalApplicationCtrl foodpalCtrl;
private final LocaleManager localeManager;
@FXML
public TextField ingredient;
@FXML
public Button okButton;
@FXML
public Button cancelButton;
@FXML
public Label ingredientLabel;
@Inject
public AddIngredientCtrl(ServerUtils server, MainCtrl mainCtrl, FoodpalApplicationCtrl foodpalCtrl) {
public AddIngredientCtrl(ServerUtils server, MainCtrl mainCtrl,
FoodpalApplicationCtrl foodpalCtrl, LocaleManager localeManager) {
this.mainCtrl = mainCtrl;
this.server = server;
this.foodpalCtrl = foodpalCtrl;
this.localeManager = localeManager;
}
@Override
public void updateText() {
ingredientLabel.setText(getLocaleString("add.ingredient.label"));
okButton.setText(getLocaleString("button.ok"));
cancelButton.setText(getLocaleString("button.cancel"));
}
@Override
public LocaleManager getLocaleManager() {
return localeManager;
}
public void cancel() throws IOException, InterruptedException {
@ -83,4 +111,5 @@ public class AddIngredientCtrl {
break;
}
}
}

View file

@ -15,28 +15,58 @@
*/
package client.scenes;
import client.utils.LocaleAware;
import client.utils.LocaleManager;
import client.utils.ServerUtils;
import com.google.inject.Inject;
import jakarta.ws.rs.WebApplicationException;
import javafx.fxml.FXML;
import javafx.scene.control.Alert;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
import javafx.scene.control.TextField;
import javafx.scene.input.KeyEvent;
import javafx.stage.Modality;
import java.io.IOException;
public class AddNameCtrl {
public class AddNameCtrl implements LocaleAware {
private final ServerUtils server;
private final MainCtrl mainCtrl;
private final LocaleManager localeManager;
@FXML
public TextField recipeName;
@FXML
public Label recipeNameLabel;
@FXML
public Button cancelButton;
@FXML
public Button okButton;
@Inject
public AddNameCtrl(ServerUtils server, MainCtrl mainCtrl) {
public AddNameCtrl(ServerUtils server, MainCtrl mainCtrl, LocaleManager localeManager) {
this.mainCtrl = mainCtrl;
this.server = server;
this.localeManager = localeManager;
}
@Override
public void updateText() {
recipeNameLabel.setText(getLocaleString("add.recipe.label"));
okButton.setText(getLocaleString("button.ok"));
cancelButton.setText(getLocaleString("button.cancel"));
}
@Override
public LocaleManager getLocaleManager() {
return localeManager;
}
public void cancel() throws IOException, InterruptedException {
@ -78,4 +108,5 @@ public class AddNameCtrl {
break;
}
}
}

View file

@ -15,33 +15,60 @@
*/
package client.scenes;
import client.utils.LocaleAware;
import client.utils.LocaleManager;
import client.utils.ServerUtils;
import com.google.inject.Inject;
import commons.Recipe;
import jakarta.ws.rs.WebApplicationException;
import javafx.fxml.FXML;
import javafx.scene.control.Alert;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
import javafx.scene.control.TextField;
import javafx.scene.input.KeyEvent;
import javafx.stage.Modality;
import java.io.IOException;
public class AddStepsCtrl {
public class AddStepsCtrl implements LocaleAware {
private final ServerUtils server;
private final MainCtrl mainCtrl;
private final FoodpalApplicationCtrl foodpalCtrl;
private final LocaleManager localeManager;
@FXML
public TextField preparationStep;
@FXML
public Button okButton;
@FXML
public Button cancelButton;
@FXML
public Label preparationStepLabel;
@Inject
public AddStepsCtrl(ServerUtils server, MainCtrl mainCtrl, FoodpalApplicationCtrl foodpalCtrl) {
public AddStepsCtrl(ServerUtils server, MainCtrl mainCtrl,
FoodpalApplicationCtrl foodpalCtrl, LocaleManager localeManager) {
this.mainCtrl = mainCtrl;
this.server = server;
this.foodpalCtrl = foodpalCtrl;
this.localeManager = localeManager;
}
@Override
public void updateText() {
preparationStepLabel.setText(getLocaleString("add.step.label"));
okButton.setText(getLocaleString("button.ok"));
cancelButton.setText(getLocaleString("button.cancel"));
}
@Override
public LocaleManager getLocaleManager() {
return localeManager;
}
public void cancel() throws IOException, InterruptedException {
@ -83,4 +110,5 @@ public class AddStepsCtrl {
break;
}
}
}

View file

@ -2,24 +2,28 @@ package client.scenes;
import java.io.IOException;
import java.util.Collections;
import java.util.List;
import java.util.Locale;
import client.utils.LocaleAware;
import client.utils.LocaleManager;
import client.utils.ServerUtils;
import commons.Recipe;
import jakarta.inject.Inject;
import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
import javafx.scene.control.ListCell;
import javafx.scene.control.ListView;
public class FoodpalApplicationCtrl {
public class FoodpalApplicationCtrl implements LocaleAware {
private final MainCtrl mainCtrl;
private final ServerUtils server;
private final LocaleManager localeManager;
// all of these aren't used with only my part of the code
// everything in the top bar ===
@FXML
private Button flagEnButton; //already here for advanced stuff
@ -30,19 +34,10 @@ public class FoodpalApplicationCtrl {
@FXML
private Button flagPlButton; //already here for advanced stuff
@FXML
private Button refreshButton;
@FXML
private Button closeButton; //already here for advanced stuff
@FXML
private Button maximizeButton; //already here for advanced stuff
@FXML
private Button minimizeButton; //already here for advanced stuff
// everything in the left lane
@FXML
public Label recipesLabel;
@FXML
private ListView<Recipe> recipeList;
@ -52,6 +47,9 @@ public class FoodpalApplicationCtrl {
@FXML
private Button removeRecipeButton;
@FXML
public Button cloneRecipeButton;
// === CENTER: RECIPE DETAILS ===
@FXML
private Label recipeNameLabel;
@ -59,6 +57,18 @@ public class FoodpalApplicationCtrl {
@FXML
private Button editRecipeTitleButton;
@FXML
public Button removeRecipeButton2;
@FXML
public Button printRecipeButton;
@FXML
public Label ingredientsLabel;
@FXML
public Label preparationLabel;
@FXML
private ListView<String> ingredientsListView;
@ -72,13 +82,14 @@ public class FoodpalApplicationCtrl {
private Button addPreparationStepButton;
@Inject
public FoodpalApplicationCtrl(MainCtrl mainCtrl, ServerUtils server) {
public FoodpalApplicationCtrl(MainCtrl mainCtrl, ServerUtils server, LocaleManager localeManager) {
this.mainCtrl = mainCtrl;
this.server = server;
this.localeManager = localeManager;
}
@FXML
private void initialize() throws IOException, InterruptedException {
@Override
public void initializeComponents() {
// Show recipe name in the list
recipeList.setCellFactory(list -> new ListCell<>() {
@Override
@ -104,20 +115,56 @@ public class FoodpalApplicationCtrl {
refresh();
}
// till the all the code from everyone is implemented for now to not have errors
private void showRecipeDetails(Recipe newRecipe) {
recipeNameLabel.setText(newRecipe.getName());
ingredientsListView.getItems().setAll(newRecipe.getIngredients());
preparationListView.getItems().setAll(newRecipe.getPreparationSteps());
@Override
public void updateText() {
addRecipeButton.setText(getLocaleString("menu.button.add.recipe"));
removeRecipeButton.setText(getLocaleString("menu.button.remove.recipe"));
cloneRecipeButton.setText(getLocaleString("menu.button.clone"));
editRecipeTitleButton.setText(getLocaleString("menu.button.edit"));
removeRecipeButton2.setText(getLocaleString("menu.button.remove.recipe"));
printRecipeButton.setText(getLocaleString("menu.button.print"));
recipesLabel.setText(getLocaleString("menu.label.recipes"));
ingredientsLabel.setText(getLocaleString("menu.label.ingredients"));
preparationLabel.setText(getLocaleString("menu.label.preparation"));
addIngredientButton.setText(getLocaleString("menu.button.add.ingredient"));
addPreparationStepButton.setText(getLocaleString("menu.button.add.step"));
}
@Override
public LocaleManager getLocaleManager() {
return localeManager;
}
// till the all the code from everyone is implemented for now to not have errors
private void showRecipeDetails(Recipe recipe) {
if (recipe == null) {
recipeNameLabel.setText("");
ingredientsListView.getItems().clear();
preparationListView.getItems().clear();
return;
}
recipeNameLabel.setText(recipe.getName());
ingredientsListView.getItems().setAll(recipe.getIngredients());
preparationListView.getItems().setAll(recipe.getPreparationSteps());
}
// Button handlers
@FXML
public void refresh() throws IOException, InterruptedException {
public void refresh() {
// TODO: someone else doing this
List<Recipe> recipes = server.getRecipes();
List<Recipe> recipes;
try {
recipes = server.getRecipes();
} catch (IOException | InterruptedException e) {
recipes = Collections.emptyList();
System.err.println("Failed to load recipes: " + e.getMessage());
}
recipeList.getItems().setAll(recipes);
// Select first recipe in the list by default
@ -126,7 +173,6 @@ public class FoodpalApplicationCtrl {
}
}
/**
* Adds a recipe, by going to a different scene, there you insert the title and bam recipe created
*/
@ -190,22 +236,12 @@ public class FoodpalApplicationCtrl {
// Language buttons
@FXML
private void switchToEnglish() {
System.out.println("Switch language to EN");
private void switchLocale(ActionEvent event) {
Button button = (Button)event.getSource();
String lang = (String)button.getUserData();
localeManager.setLocale(Locale.of(lang));
}
@FXML
private void switchToDutch() {
System.out.println("Switch language to NL");
}
@FXML
private void switchToPolish() {
System.out.println("Switch language to PL");
}
//without caused errors
@FXML
private void makePrintable() {
System.out.println("Recipe printed");
@ -232,6 +268,7 @@ public class FoodpalApplicationCtrl {
refresh();
}
}

View file

@ -15,6 +15,10 @@
*/
package client.scenes;
import client.utils.LocaleAware;
import client.utils.LocaleManager;
import jakarta.inject.Inject;
import javafx.fxml.FXML;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.stage.Stage;
@ -22,28 +26,42 @@ import javafx.util.Pair;
import java.io.IOException;
public class MainCtrl {
public class MainCtrl implements LocaleAware {
private final LocaleManager localeManager;
@FXML
private Stage primaryStage;
@FXML
private AddNameCtrl addNameCtrl;
private Scene addName;
@FXML
private FoodpalApplicationCtrl foodpalCtrl;
private Scene foodpal;
@FXML
private AddIngredientCtrl addIngredientCtrl;
private Scene addIngredient;
@FXML
private AddStepsCtrl addStepsCtrl;
private Scene addStep;
public void initialize(Stage primaryStage,
private String addNameTitle = "add.name.title";
private String addIngredientTitle = "add.step.title";
private String addStepTitle = "add.ingredient.title";
@Inject
public MainCtrl(LocaleManager localeManager) {
this.localeManager = localeManager;
}
public void setup(Stage primaryStage,
Pair<AddNameCtrl, Parent> addName,
Pair<FoodpalApplicationCtrl, Parent> foodpal,
Pair<AddIngredientCtrl, Parent> addIngredient,
Pair<AddStepsCtrl, Parent> addStep
) throws IOException, InterruptedException {
Pair<AddStepsCtrl, Parent> addStep) throws IOException, InterruptedException {
this.primaryStage = primaryStage;
@ -59,14 +77,26 @@ public class MainCtrl {
this.addStepsCtrl = addStep.getKey();
this.addStep = new Scene(addStep.getValue());
showFoodpal();
primaryStage.show();
initialize(); // Initialize LocaleManager stuff manually since MainCtrl isn't loaded from FXML.
}
@Override
public void updateText() {
addNameTitle = getLocaleString("add.recipe.title");
addStepTitle = getLocaleString("add.step.title");
addIngredientTitle = getLocaleString("add.ingredient.title");
}
@Override
public LocaleManager getLocaleManager() {
return localeManager;
}
public void showAddName() {
primaryStage.setTitle("Naming recipes");
primaryStage.setTitle(addNameTitle);
primaryStage.setScene(addName);
addName.setOnKeyPressed(e -> {
try {
@ -77,14 +107,14 @@ public class MainCtrl {
});
}
public void showFoodpal() throws IOException, InterruptedException {
public void showFoodpal() {
primaryStage.setTitle("FoodPal");
primaryStage.setScene(foodpal);
foodpalCtrl.refresh();
}
public void showAddIngredient() {
primaryStage.setTitle("To add ingredients");
primaryStage.setTitle(addIngredientTitle);
primaryStage.setScene(addIngredient);
addIngredient.setOnKeyPressed(e -> {
try {
@ -97,7 +127,7 @@ public class MainCtrl {
}
public void showAddSteps() {
primaryStage.setTitle("To add preparation steps");
primaryStage.setTitle(addStepTitle);
primaryStage.setScene(addStep);
addStep.setOnKeyPressed(e -> {
try {

View file

@ -0,0 +1,42 @@
package client.utils;
import javafx.fxml.Initializable;
import java.net.URL;
import java.util.ResourceBundle;
public interface LocaleAware extends Initializable {
/**
* Updates all text when locale changes.
* Must be implemented by each controller.
*/
void updateText();
/**
* Returns the injected LocaleManager.
* Must be implemented by each controller.
*/
LocaleManager getLocaleManager();
@Override
default void initialize(URL location, ResourceBundle resources) {
updateText();
getLocaleManager().getBundleProperty().addListener((_, _, _) -> updateText());
initializeComponents();
}
default void initialize() {
initialize(null, null);
}
default String getLocaleString(String key) {
return getLocaleManager().getBundle().getString(key);
}
/**
* Optional function for initialization of components. Runs after localization.
*/
default void initializeComponents() {}
}

View file

@ -0,0 +1,47 @@
package client.utils;
import javafx.beans.property.ObjectProperty;
import javafx.beans.property.SimpleObjectProperty;
import java.util.Locale;
import java.util.ResourceBundle;
public class LocaleManager {
private final ObjectProperty<Locale> currentLocale = new SimpleObjectProperty<>(Locale.ENGLISH);
private final ObjectProperty<ResourceBundle> currentBundle = new SimpleObjectProperty<>();
private static final String RESOURCE_BUNDLE_PATH = "locale/lang";
public LocaleManager() {
// TODO: Set currentLocale to config value instead of EN default.
updateBundle();
currentLocale.addListener((_, _, _) -> updateBundle());
}
private void updateBundle() {
ResourceBundle bundle = ResourceBundle.getBundle(RESOURCE_BUNDLE_PATH,
currentLocale.get(),
ResourceBundle.Control.getControl(ResourceBundle.Control.FORMAT_PROPERTIES)
);
currentBundle.set(bundle);
}
@SuppressWarnings("unused")
public void setLocale(Locale locale) {
currentLocale.set(locale);
}
@SuppressWarnings("unused")
public Locale getLocale() {
return currentLocale.get();
}
@SuppressWarnings("unused")
public ResourceBundle getBundle() {
return currentBundle.get();
}
@SuppressWarnings("unused")
public ObjectProperty<ResourceBundle> getBundleProperty() {
return currentBundle;
}
}

View file

@ -7,9 +7,9 @@
<AnchorPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="94.0" prefWidth="470.0" xmlns="http://javafx.com/javafx/23.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="client.scenes.AddIngredientCtrl">
<children>
<Button layoutX="417.0" layoutY="54.0" mnemonicParsing="false" onAction="#ok" text="Ok" />
<Button layoutX="349.0" layoutY="54.0" mnemonicParsing="false" onAction="#cancel" text="Cancel" />
<Button fx:id="okButton" layoutX="417.0" layoutY="54.0" mnemonicParsing="false" onAction="#ok" text="Ok" />
<Button fx:id="cancelButton" layoutX="349.0" layoutY="54.0" mnemonicParsing="false" onAction="#cancel" text="Cancel" />
<TextField fx:id="ingredient" layoutX="120.0" layoutY="24.0" prefHeight="18.0" prefWidth="292.0" />
<Label layoutX="28.0" layoutY="29.0" text="Ingredient Name" />
<Label fx:id="ingredientLabel" layoutX="28.0" layoutY="29.0" text="Ingredient Name" />
</children>
</AnchorPane>

View file

@ -7,9 +7,9 @@
<AnchorPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="94.0" prefWidth="470.0" xmlns="http://javafx.com/javafx/23.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="client.scenes.AddNameCtrl">
<children>
<Button layoutX="417.0" layoutY="54.0" mnemonicParsing="false" onAction="#ok" text="Ok" />
<Button layoutX="349.0" layoutY="54.0" mnemonicParsing="false" onAction="#cancel" text="Cancel" />
<Button fx:id="okButton" layoutX="417.0" layoutY="54.0" mnemonicParsing="false" onAction="#ok" text="Ok" />
<Button fx:id="cancelButton" layoutX="349.0" layoutY="54.0" mnemonicParsing="false" onAction="#cancel" text="Cancel" />
<TextField fx:id="recipeName" layoutX="109.0" layoutY="24.0" prefHeight="18.0" prefWidth="292.0" />
<Label layoutX="28.0" layoutY="29.0" text="Recipe Name" />
<Label fx:id="recipeNameLabel" layoutX="28.0" layoutY="29.0" text="Recipe Name" />
</children>
</AnchorPane>

View file

@ -7,9 +7,9 @@
<AnchorPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="94.0" prefWidth="470.0" xmlns="http://javafx.com/javafx/23.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="client.scenes.AddStepsCtrl">
<children>
<Button layoutX="417.0" layoutY="54.0" mnemonicParsing="false" onAction="#ok" text="Ok" />
<Button layoutX="349.0" layoutY="54.0" mnemonicParsing="false" onAction="#cancel" text="Cancel" />
<Button fx:id="okButton" layoutX="417.0" layoutY="54.0" mnemonicParsing="false" onAction="#ok" text="Ok" />
<Button fx:id="cancelButton" layoutX="349.0" layoutY="54.0" mnemonicParsing="false" onAction="#cancel" text="Cancel" />
<TextField fx:id="preparationStep" layoutX="120.0" layoutY="24.0" prefHeight="18.0" prefWidth="292.0" />
<Label layoutX="28.0" layoutY="29.0" text="Preparation step" />
<Label fx:id="preparationStepLabel" layoutX="28.0" layoutY="29.0" text="Preparation step" />
</children>
</AnchorPane>

View file

@ -44,9 +44,9 @@
<buttons>
<ToolBar prefHeight="35.0" prefWidth="123.0">
<items>
<Button fx:id="flagEnButton" minWidth="33.0" onAction="#switchToEnglish" prefHeight="25.0" prefWidth="33.0" text="EN" />
<Button fx:id="flagNlButton" onAction="#switchToDutch" text="NL" />
<Button fx:id="flagPlButton" onAction="#switchToPolish" text="PL" />
<Button fx:id="flagEnButton" minWidth="33.0" onAction="#switchLocale" userData="en" prefHeight="25.0" prefWidth="33.0" text="EN" />
<Button fx:id="flagNlButton" onAction="#switchLocale" userData="nl" text="NL" />
<Button fx:id="flagPlButton" onAction="#switchLocale" userData="pl" text="PL" />
</items>
</ToolBar>
</buttons>
@ -84,7 +84,7 @@
<Insets bottom="10" left="10" right="10" top="10" />
</padding>
<Label text="Recipes">
<Label fx:id="recipesLabel" text="Recipes">
<font>
<Font name="System Bold" size="15.0" />
</font></Label>
@ -92,9 +92,9 @@
<ListView fx:id="recipeList" />
<HBox spacing="10">
<Button fx:id="AddRecipeButton" onAction="#addRecipe" text="Add Recipe" />
<Button fx:id="RemoveRecipeButton" onAction="#removeSelectedRecipe" text="Remove Recipe" />
<Button fx:id= "CloneREcipeButton" mnemonicParsing="false" onAction="#cloneRecipe" text="Clone" />
<Button fx:id="addRecipeButton" onAction="#addRecipe" text="Add Recipe" />
<Button fx:id="removeRecipeButton" onAction="#removeSelectedRecipe" text="Remove Recipe" />
<Button fx:id= "cloneRecipeButton" mnemonicParsing="false" onAction="#cloneRecipe" text="Clone" />
</HBox>
</VBox>
</left>
@ -113,13 +113,13 @@
<Font name="System Bold" size="14.0" />
</font></Label>
<Button fx:id="editRecipeTitleButton" onAction="#editRecipeTitle" text="Edit" />
<Button fx:id="RemoveRecipeButton2" mnemonicParsing="false" onAction="#removeSelectedRecipe" text="Remove Recipe" />
<Button fx:id="printRecipe" mnemonicParsing="false" onAction="#makePrintable" text="Print Recipe" />
<Button fx:id="removeRecipeButton2" mnemonicParsing="false" onAction="#removeSelectedRecipe" text="Remove Recipe" />
<Button fx:id="printRecipeButton" mnemonicParsing="false" onAction="#makePrintable" text="Print Recipe" />
</HBox>
<!-- Ingredients -->
<VBox spacing="10">
<Label text="Ingredients">
<Label fx:id="ingredientsLabel" text="Ingredients">
<font>
<Font name="System Bold" size="14.0" />
</font>
@ -129,7 +129,7 @@
</VBox>
<!-- Preparation -->
<Label text="Preparation">
<Label fx:id="preparationLabel" text="Preparation">
<font>
<Font name="System Bold" size="14.0" />
</font>

View file

@ -1,20 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.scene.control.Button?>
<?import javafx.scene.control.TableColumn?>
<?import javafx.scene.control.TableView?>
<?import javafx.scene.layout.AnchorPane?>
<AnchorPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="400.0" prefWidth="600.0" xmlns="http://javafx.com/javafx/17" xmlns:fx="http://javafx.com/fxml/1" fx:controller="client.scenes.QuoteOverviewCtrl">
<children>
<Button layoutX="503.0" layoutY="360.0" mnemonicParsing="false" onAction="#addQuote" text="Add Quote" />
<Button layoutX="431.0" layoutY="360.0" mnemonicParsing="false" onAction="#refresh" text="Refresh" />
<TableView fx:id="table" layoutX="14.0" layoutY="14.0" prefHeight="337.0" prefWidth="572.0">
<columns>
<TableColumn fx:id="colFirstName" prefWidth="113.0" text="First Name" />
<TableColumn fx:id="colLastName" prefWidth="114.0" text="Last Name" />
<TableColumn fx:id="colQuote" prefWidth="344.0" text="Quote" />
</columns>
</TableView>
</children>
</AnchorPane>

View file

@ -0,0 +1,26 @@
add.ingredient.title=Add Ingredient
add.recipe.title=Create recipe
add.step.title=Add Step
add.ingredient.label=Ingredient
add.recipe.label=Recipe Name
add.step.label=Step
button.ok=Ok
button.cancel=Cancel
menu.label.recipes=Recipes
menu.label.ingredients=Ingredients
menu.label.preparation=Preparation
menu.button.add.recipe=Add Recipe
menu.button.add.ingredient=Add Ingredient
menu.button.add.step=Add Step
menu.button.remove.recipe=Remove Recipe
menu.button.remove.ingredient=Remove Ingredient
menu.button.remove.step=Remove Step
menu.button.edit=Edit
menu.button.clone=Clone
menu.button.print=Print recipe

View file

@ -0,0 +1,26 @@
add.ingredient.title=Add Ingredient
add.recipe.title=Create recipe
add.step.title=Add Step
add.ingredient.label=Ingredient
add.recipe.label=Recipe Name
add.step.label=Step
button.ok=Ok
button.cancel=Cancel
menu.label.recipes=Recipes
menu.label.ingredients=Ingredients
menu.label.preparation=Preparation
menu.button.add.recipe=Add Recipe
menu.button.add.ingredient=Add Ingredient
menu.button.add.step=Add Step
menu.button.remove.recipe=Remove Recipe
menu.button.remove.ingredient=Remove Ingredient
menu.button.remove.step=Remove Step
menu.button.edit=Edit
menu.button.clone=Clone
menu.button.print=Print recipe

View file

@ -0,0 +1,26 @@
add.ingredient.title=Ingredient toevoegen
add.recipe.title=Recept aanmaken
add.step.title=Stap toevoegen
add.ingredient.label=Ingredient
add.recipe.label=Receptnaam
add.step.label=Bereidingsstap
button.ok=Ok
button.cancel=Annuleren
menu.label.recipes=Recepten
menu.label.ingredients=Ingrediënten
menu.label.preparation=Bereiding
menu.button.add.recipe=Recept toevoegen
menu.button.add.ingredient=Ingrediënt toevoegen
menu.button.add.step=Stap toevoegen
menu.button.remove.recipe=Recept verwijderen
menu.button.remove.ingredient=Ingrediënt verwijderen
menu.button.remove.step=Stap verwijderen
menu.button.edit=Bewerken
menu.button.clone=Dupliceren
menu.button.print=Recept afdrukken

View file

@ -0,0 +1,26 @@
add.ingredient.title=Dodaj składnik
add.recipe.title=Utwórz przepis
add.step.title=Dodaj instrukcję
add.ingredient.label=Składnik
add.recipe.label=Nazwa przepisu
add.step.label=Instrukcja
button.ok=Ok
button.cancel=Anuluj
menu.label.recipes=Przepisy
menu.label.ingredients=Składniki
menu.label.preparation=Przygotowanie
menu.button.add.recipe=Dodaj przepis
menu.button.add.ingredient=Dodaj składnik
menu.button.add.step=Dodaj instrukcję
menu.button.remove.recipe=Usuń przepis
menu.button.remove.ingredient=Usuń składnik
menu.button.remove.step=Usuń instrukcję
menu.button.edit=Edytuj
menu.button.clone=Duplikuj
menu.button.print=Drukuj przepis

View file

@ -15,16 +15,16 @@
*/
package client.scenes;
import client.utils.LocaleManager;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
public class MainCtrlTest {
private MainCtrl sut;
@BeforeEach
public void setup() {
sut = new MainCtrl();
sut = new MainCtrl(new LocaleManager());
}
@Test