} else if (rbLarge.isSelected()) {
String company = txtAttr.getText().trim();
- Main.addNewFuelStation(company);
- parentController.appendOutput("Added large station (" + company + ").");
+ if (!company.isEmpty()) {
+ Main.addNewFuelStation(company);
+ parentController.appendOutput("Added large station (" + company + ").");
+ } else
+ parentController.showError("Company name must not be empty");
}
parentController.refreshStationNames();
* @author Leander Schnurrer
*/
public static void addNewFuelStation(String supermarket_company) {
- while (supermarket_company.isEmpty()) {
- // TODO: Show error in UI
- }
fuelStations.add(new LargeFuelStation(supermarket_company));
}
* @author Leander Schnurrer
*/
public static void addNewFuelStation(float retail_space) {
- while (retail_space <= 0) {
- // TODO: Show error in UI
- }
fuelStations.add(new MediumFuelStation(retail_space));
}
* @author Leander Schnurrer
*/
public static void addNewFuelStation(short number_of_vending_machines) {
- while (number_of_vending_machines <= 0) {
- // TODO: Show error in UI
- }
fuelStations.add(new SmallFuelStation(number_of_vending_machines));
}