Compare commits
3 Commits
Author | SHA1 | Date | |
---|---|---|---|
29476f49e7 | |||
df1cef295b | |||
a7479726ac |
@ -91,3 +91,49 @@ App started
|
||||
2021-03-17 14:48:46 INFO PostgresHelper:15 - User Table created
|
||||
2021-03-17 14:48:48 ERROR PSQLException:33 - Connection to 192.168.1.116:5432 refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
|
||||
2021-03-17 14:48:48 ERROR NullPointerException:33 -
|
||||
2021-03-17 15:20:09 INFO TourPlaner:15 - Tour Planer App gestartet
|
||||
2021-03-17 15:20:09 INFO PostgresHelper:15 - User Table created
|
||||
2021-03-17 15:20:11 ERROR PSQLException:33 - Connection to 192.168.1.116:5432 refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
|
||||
2021-03-17 15:20:11 ERROR NullPointerException:33 -
|
||||
2021-03-17 15:36:24 ERROR ViewModel -> DelTour:33 - Keine Tour ausgewählt!
|
||||
2021-03-17 15:38:41 ERROR ViewModel -> DelTour:33 - Keine Tour ausgewählt!
|
||||
2021-03-17 16:02:24 INFO TourPlaner:15 - Tour Planer App gestartet
|
||||
2021-03-17 16:02:24 INFO PostgresHelper:15 - User Table created
|
||||
2021-03-17 16:02:26 ERROR PSQLException:33 - Connection to 192.168.1.116:5432 refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
|
||||
2021-03-17 16:02:26 ERROR NullPointerException:33 -
|
||||
2021-03-17 16:03:16 INFO TourPlaner:15 - Tour Planer App gestartet
|
||||
2021-03-17 16:03:16 INFO PostgresHelper:15 - User Table created
|
||||
2021-03-17 16:03:18 ERROR PSQLException:33 - Connection to 192.168.1.116:5432 refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
|
||||
2021-03-17 16:03:18 ERROR NullPointerException:33 -
|
||||
2021-03-17 16:04:18 INFO TourPlaner:15 - Tour Planer App gestartet
|
||||
2021-03-17 16:04:18 INFO PostgresHelper:15 - User Table created
|
||||
2021-03-17 16:04:20 ERROR PSQLException:33 - Connection to 192.168.1.116:5432 refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
|
||||
2021-03-17 16:04:20 ERROR NullPointerException:33 -
|
||||
2021-03-17 16:04:26 INFO TourPlaner:15 - Tour Planer App gestartet
|
||||
2021-03-17 16:04:26 INFO PostgresHelper:15 - User Table created
|
||||
2021-03-17 16:04:28 ERROR PSQLException:33 - Connection to 192.168.1.116:5432 refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
|
||||
2021-03-17 16:04:28 ERROR NullPointerException:33 -
|
||||
2021-03-17 16:06:47 INFO TourPlaner:15 - Tour Planer App gestartet
|
||||
2021-03-17 16:06:47 INFO PostgresHelper:15 - User Table created
|
||||
2021-03-17 16:06:49 ERROR PSQLException:33 - Connection to 192.168.1.116:5432 refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
|
||||
2021-03-17 16:06:49 ERROR NullPointerException:33 -
|
||||
2021-03-17 16:06:55 INFO TourPlaner:15 - Tour Planer App gestartet
|
||||
2021-03-17 16:06:55 INFO PostgresHelper:15 - User Table created
|
||||
2021-03-17 16:06:57 ERROR PSQLException:33 - Connection to 192.168.1.116:5432 refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
|
||||
2021-03-17 16:06:57 ERROR NullPointerException:33 -
|
||||
2021-03-17 17:02:33 INFO TourPlaner:15 - Tour Planer App gestartet
|
||||
2021-03-17 17:02:33 INFO PostgresHelper:15 - User Table created
|
||||
2021-03-17 17:02:35 ERROR PSQLException:33 - Connection to 192.168.1.116:5432 refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
|
||||
2021-03-17 17:02:35 ERROR NullPointerException:33 -
|
||||
2021-03-17 17:02:38 INFO TourPlaner:15 - Tour Planer App gestartet
|
||||
2021-03-17 17:02:38 INFO PostgresHelper:15 - User Table created
|
||||
2021-03-17 17:02:40 ERROR PSQLException:33 - Connection to 192.168.1.116:5432 refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
|
||||
2021-03-17 17:02:40 ERROR NullPointerException:33 -
|
||||
2021-03-17 17:08:23 INFO TourPlaner:15 - Tour Planer App gestartet
|
||||
2021-03-17 17:08:23 INFO PostgresHelper:15 - User Table created
|
||||
2021-03-17 17:08:25 ERROR PSQLException:33 - Connection to 192.168.1.116:5432 refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
|
||||
2021-03-17 17:08:25 ERROR NullPointerException:33 -
|
||||
2021-03-17 17:08:31 INFO TourPlaner:15 - Tour Planer App gestartet
|
||||
2021-03-17 17:08:31 INFO PostgresHelper:15 - User Table created
|
||||
2021-03-17 17:08:33 ERROR PSQLException:33 - Connection to 192.168.1.116:5432 refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
|
||||
2021-03-17 17:08:33 ERROR NullPointerException:33 -
|
||||
|
79
src/tourplaner/business/AlertHelper.java
Normal file
79
src/tourplaner/business/AlertHelper.java
Normal file
@ -0,0 +1,79 @@
|
||||
package tourplaner.business;
|
||||
|
||||
import javafx.scene.control.Alert;
|
||||
import javafx.scene.control.Label;
|
||||
import javafx.scene.control.TextArea;
|
||||
import javafx.scene.control.TextInputDialog;
|
||||
import javafx.scene.layout.GridPane;
|
||||
import javafx.scene.layout.Priority;
|
||||
|
||||
import java.io.PrintWriter;
|
||||
import java.io.StringWriter;
|
||||
import java.util.Optional;
|
||||
import java.util.concurrent.atomic.AtomicReference;
|
||||
|
||||
public class AlertHelper {
|
||||
public static void warn(String title, String header, String msg){
|
||||
alertType(Alert.AlertType.WARNING, title, header, msg);
|
||||
}
|
||||
public static void inform(String title, String header, String msg){
|
||||
alertType(Alert.AlertType.INFORMATION, title, header, msg);
|
||||
}
|
||||
|
||||
public static void informNoHeader(String title, String msg){
|
||||
inform(title, null, msg);
|
||||
}
|
||||
|
||||
public static void error(String title, String header, String msg){
|
||||
alertType(Alert.AlertType.ERROR, title, header, msg);
|
||||
}
|
||||
|
||||
public static void exerror(String title, String header, String msg, Exception ex){
|
||||
Alert alert = new Alert(Alert.AlertType.ERROR);
|
||||
alert.setTitle(title);
|
||||
alert.setHeaderText(header);
|
||||
alert.setContentText(msg);
|
||||
StringWriter sw = new StringWriter();
|
||||
PrintWriter pw = new PrintWriter(sw);
|
||||
ex.printStackTrace(pw);
|
||||
String exceptionText = sw.toString();
|
||||
Label label = new Label("Exception stacktrace:");
|
||||
TextArea textArea = new TextArea(exceptionText);
|
||||
textArea.setEditable(false);
|
||||
textArea.setWrapText(true);
|
||||
textArea.setMaxWidth(Double.MAX_VALUE);
|
||||
textArea.setMaxHeight(Double.MAX_VALUE);
|
||||
GridPane.setVgrow(textArea, Priority.ALWAYS);
|
||||
GridPane.setHgrow(textArea, Priority.ALWAYS);
|
||||
GridPane expContent = new GridPane();
|
||||
expContent.setMaxWidth(Double.MAX_VALUE);
|
||||
expContent.add(label, 0, 0);
|
||||
expContent.add(textArea, 0, 1);
|
||||
alert.getDialogPane().setExpandableContent(expContent);
|
||||
alert.showAndWait();
|
||||
}
|
||||
|
||||
private static void alertType(Alert.AlertType alertly, String title, String header, String msg){
|
||||
Alert alert = new Alert(alertly);
|
||||
alert.setTitle(title);
|
||||
alert.setHeaderText(header);
|
||||
alert.setContentText(msg);
|
||||
|
||||
alert.showAndWait();
|
||||
}
|
||||
|
||||
public static String inputText(String title, String header, String msg) {
|
||||
TextInputDialog dialog = new TextInputDialog();
|
||||
dialog.setTitle(title);
|
||||
dialog.setHeaderText(header);
|
||||
dialog.setContentText(msg);
|
||||
Optional<String> result = dialog.showAndWait();
|
||||
AtomicReference<String> returnText = new AtomicReference<>("");
|
||||
result.ifPresent(returnText::set);
|
||||
if(!returnText.get().isEmpty()){
|
||||
return returnText.get();
|
||||
}else{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
@ -39,7 +39,6 @@
|
||||
<?import javafx.scene.control.Menu?>
|
||||
<?import javafx.scene.control.MenuBar?>
|
||||
<?import javafx.scene.control.MenuItem?>
|
||||
<?import javafx.scene.control.SeparatorMenuItem?>
|
||||
<?import javafx.scene.control.SplitPane?>
|
||||
<?import javafx.scene.control.Tab?>
|
||||
<?import javafx.scene.control.TabPane?>
|
||||
@ -58,51 +57,16 @@
|
||||
<menus>
|
||||
<Menu fx:id="menueFile" mnemonicParsing="false" text="Datei">
|
||||
<items>
|
||||
<MenuItem mnemonicParsing="false" text="Neu" />
|
||||
<MenuItem mnemonicParsing="false" text="Öffnen" />
|
||||
<Menu mnemonicParsing="false" text="Open Recent" />
|
||||
<SeparatorMenuItem mnemonicParsing="false" />
|
||||
<MenuItem mnemonicParsing="false" text="Close" />
|
||||
<MenuItem mnemonicParsing="false" text="Save" />
|
||||
<MenuItem mnemonicParsing="false" text="Save As…" />
|
||||
<MenuItem mnemonicParsing="false" text="Revert" />
|
||||
<SeparatorMenuItem mnemonicParsing="false" />
|
||||
<MenuItem mnemonicParsing="false" text="Preferences…" />
|
||||
<SeparatorMenuItem mnemonicParsing="false" />
|
||||
<MenuItem mnemonicParsing="false" text="Quit" />
|
||||
<MenuItem fx:id="beendenButton" mnemonicParsing="false" onAction="#quitApp" text="Beenden" />
|
||||
</items>
|
||||
</Menu>
|
||||
<Menu mnemonicParsing="false" text="Bearbeiten">
|
||||
<items>
|
||||
<MenuItem mnemonicParsing="false" text="Undo" />
|
||||
<MenuItem mnemonicParsing="false" text="Redo" />
|
||||
<SeparatorMenuItem mnemonicParsing="false" />
|
||||
<MenuItem mnemonicParsing="false" text="Cut" />
|
||||
<MenuItem mnemonicParsing="false" text="Copy" />
|
||||
<MenuItem mnemonicParsing="false" text="Paste" />
|
||||
<MenuItem mnemonicParsing="false" text="Delete" />
|
||||
<SeparatorMenuItem mnemonicParsing="false" />
|
||||
<MenuItem mnemonicParsing="false" text="Select All" />
|
||||
<MenuItem mnemonicParsing="false" text="Unselect All" />
|
||||
</items>
|
||||
</Menu>
|
||||
<Menu mnemonicParsing="false" text="Optionen">
|
||||
<items>
|
||||
<MenuItem mnemonicParsing="false" text="Undo" />
|
||||
<MenuItem mnemonicParsing="false" text="Redo" />
|
||||
<SeparatorMenuItem mnemonicParsing="false" />
|
||||
<MenuItem mnemonicParsing="false" text="Cut" />
|
||||
<MenuItem mnemonicParsing="false" text="Copy" />
|
||||
<MenuItem mnemonicParsing="false" text="Paste" />
|
||||
<MenuItem mnemonicParsing="false" text="Delete" />
|
||||
<SeparatorMenuItem mnemonicParsing="false" />
|
||||
<MenuItem mnemonicParsing="false" text="Select All" />
|
||||
<MenuItem mnemonicParsing="false" text="Unselect All" />
|
||||
</items>
|
||||
</Menu>
|
||||
<Menu mnemonicParsing="false" text="Bearbeiten" />
|
||||
<Menu mnemonicParsing="false" text="Optionen" />
|
||||
<Menu mnemonicParsing="false" text="Hilfe">
|
||||
<items>
|
||||
<MenuItem mnemonicParsing="false" text="About MyHelloApp" />
|
||||
<MenuItem mnemonicParsing="false" text="Git Repo" />
|
||||
<MenuItem mnemonicParsing="false" text="JavaDoc" />
|
||||
<MenuItem mnemonicParsing="false" text="Unspecified Action" />
|
||||
</items>
|
||||
</Menu>
|
||||
</menus>
|
||||
@ -126,11 +90,7 @@
|
||||
<items>
|
||||
<AnchorPane prefWidth="239.0">
|
||||
<children>
|
||||
<ListView fx:id="TourListView" layoutX="-1.0" onMouseClicked="#tourListSelectedItem" prefHeight="520.0" prefWidth="190.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
|
||||
<padding>
|
||||
<Insets bottom="20.0" left="20.0" right="20.0" top="20.0" />
|
||||
</padding>
|
||||
</ListView>
|
||||
<ListView fx:id="TourListView" layoutX="-1.0" onMouseClicked="#tourListSelectedItem" prefHeight="520.0" prefWidth="190.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0" />
|
||||
</children>
|
||||
</AnchorPane>
|
||||
<SplitPane dividerPositions="0.5" orientation="VERTICAL" prefHeight="496.0" prefWidth="620.0">
|
||||
|
@ -10,6 +10,7 @@ import javafx.scene.control.cell.PropertyValueFactory;
|
||||
import javafx.scene.input.MouseEvent;
|
||||
import javafx.scene.layout.Pane;
|
||||
import javafx.scene.web.WebView;
|
||||
import tourplaner.business.AlertHelper;
|
||||
import tourplaner.object.Tour;
|
||||
import tourplaner.viewmodels.ViewModel;
|
||||
|
||||
@ -24,11 +25,16 @@ public class TourplanerController implements Initializable {
|
||||
public Tab kartenTab, beschreibungTab;
|
||||
public TableView<Tour> beschreibungTableView;
|
||||
public TableColumn<Tour, String> startCol, zielCol, dauerCol, streckeCol, nameCol;
|
||||
public TextField titleTextView;
|
||||
public TextField titleTextView, sucheInput;
|
||||
|
||||
/**
|
||||
* Wird gestartet wenn eine Tour in der Tour listView ausgewählt wird
|
||||
* @param mouseEvent Triggered Event
|
||||
*/
|
||||
@FXML
|
||||
private void tourListSelectedItem(MouseEvent mouseEvent){
|
||||
String selectedItem = TourListView.getSelectionModel().getSelectedItem();
|
||||
this.viewModel.selectTour(selectedItem);
|
||||
titleTextView.setText(selectedItem);
|
||||
beschreibungTableView.getItems().removeIf(s -> true); //Leert die Table View komplett
|
||||
beschreibungTableView.getItems().add(this.viewModel.getTour(selectedItem));
|
||||
@ -39,29 +45,60 @@ public class TourplanerController implements Initializable {
|
||||
nameCol.setCellValueFactory(new PropertyValueFactory<Tour, String>("name"));
|
||||
}
|
||||
|
||||
/**
|
||||
* Beendet die App
|
||||
* Verbunden mit dem Menu -> Datei -> Beenden
|
||||
*/
|
||||
@FXML
|
||||
private void quitApp(){
|
||||
System.exit(0);
|
||||
}
|
||||
|
||||
/**
|
||||
* Fügt eine Tour hinzu
|
||||
* Verbunden mit Button -> Tour -> +
|
||||
*/
|
||||
@FXML
|
||||
private void addTour(){
|
||||
this.viewModel.addTour();
|
||||
}
|
||||
|
||||
/**
|
||||
* Entfernt eine ausgewählte Tour
|
||||
* Verbunden mit Button -> Tour -> -
|
||||
*/
|
||||
@FXML
|
||||
private void delTour(){
|
||||
this.beschreibungTableView.getItems().removeIf(s -> true); //löscht alles aus der tabelle
|
||||
this.titleTextView.setText("Keine Tour ausgewählt!");
|
||||
this.viewModel.delTour();
|
||||
}
|
||||
|
||||
/**
|
||||
* Sucht eine Tour
|
||||
* Verbunden mit Button -> Suche
|
||||
*/
|
||||
@FXML
|
||||
private void suche(){
|
||||
this.viewModel.suche();
|
||||
String sucheInput = this.sucheInput.getText();
|
||||
if(sucheInput.isEmpty()){
|
||||
AlertHelper.warn("ACHTUNG", "Suchfeld ist leer!", "Bitte zuerst den Suchtext in das Suchfeld eingeben!");
|
||||
}else {
|
||||
this.viewModel.suche(sucheInput);
|
||||
}
|
||||
}
|
||||
|
||||
@FXML
|
||||
private WebView mapView;
|
||||
|
||||
/**
|
||||
* Wird beim Start ausgeführt
|
||||
* @param url
|
||||
* @param resourceBundle
|
||||
*/
|
||||
@Override
|
||||
public void initialize(URL url, ResourceBundle resourceBundle) {
|
||||
TourListView.getSelectionModel().setSelectionMode(SelectionMode.SINGLE);
|
||||
TourListView.setOrientation(Orientation.VERTICAL);
|
||||
TourListView.setItems(this.viewModel.getTourNamen());
|
||||
this.beschreibungTableView.setPlaceholder(new Label("Keine Tour ausgewählt!"));
|
||||
this.titleTextView.setText("Keine Tour ausgewählt!");
|
||||
}
|
||||
}
|
||||
|
@ -2,7 +2,10 @@ package tourplaner.viewmodels;
|
||||
|
||||
import javafx.collections.FXCollections;
|
||||
import javafx.collections.ObservableList;
|
||||
import javafx.scene.control.Alert;
|
||||
import javafx.scene.control.TextInputDialog;
|
||||
import tourplaner.business.AlertHelper;
|
||||
import tourplaner.business.LogHelper;
|
||||
import tourplaner.business.TourPlaner;
|
||||
import tourplaner.object.Tour;
|
||||
import java.util.Optional;
|
||||
@ -11,49 +14,34 @@ import java.util.concurrent.atomic.AtomicReference;
|
||||
public class ViewModel {
|
||||
private final ObservableList<Tour> tourData = FXCollections.observableArrayList(new Tour("Test 1", "120", "json dings", 22.3, "Wien", "Graz"),new Tour("Test 2", "210", "json dings", 42.3, "Da", "Dort"));
|
||||
private final ObservableList<String> tourNamen = FXCollections.observableArrayList("Test 1", "Test 2");
|
||||
private final ObservableList<Tour> selectedTour = FXCollections.observableArrayList();
|
||||
//private final ObservableList<Tour> selectedTour = FXCollections.observableArrayList();
|
||||
private Tour selectedTour;
|
||||
private String neueTourName, neueTourStart, neueTourZiel;
|
||||
|
||||
public void addTour(){
|
||||
TextInputDialog dialogName = new TextInputDialog("");
|
||||
dialogName.setTitle("Tour Name");
|
||||
dialogName.setHeaderText("Bitte geben Sie den Namen der Tour an!");
|
||||
dialogName.setContentText("Name: ");
|
||||
Optional<String> resultName = dialogName.showAndWait();
|
||||
resultName.ifPresent(sname -> {
|
||||
this.neueTourName = resultName.get();
|
||||
TextInputDialog dialogStart = new TextInputDialog("");
|
||||
dialogStart.setTitle("Tour Startpunkt");
|
||||
dialogStart.setHeaderText("Bitte geben Sie den Startpunkt der Tour an!");
|
||||
dialogStart.setContentText("Startpunkt: ");
|
||||
Optional<String> resultStart = dialogStart.showAndWait();
|
||||
resultStart.ifPresent(sstart -> {
|
||||
this.neueTourStart = resultStart.get();
|
||||
TextInputDialog dialogZiel = new TextInputDialog("");
|
||||
dialogZiel.setTitle("Tour Zielpunkt");
|
||||
dialogZiel.setHeaderText("Bitte geben Sie den Zielpunkt der Tour an!");
|
||||
dialogZiel.setContentText("Zielpunkt: ");
|
||||
Optional<String> resultZiel = dialogZiel.showAndWait();
|
||||
resultZiel.ifPresent(sziel -> {
|
||||
this.neueTourZiel = resultZiel.get();
|
||||
if (getTour(this.neueTourName) == null) {
|
||||
tourData.add(new Tour(this.neueTourName, "120", new TourPlaner().getMapJson(this.neueTourStart, this.neueTourZiel), 22.3, this.neueTourStart, this.neueTourZiel));
|
||||
tourNamen.add(this.neueTourName);
|
||||
}else{
|
||||
// TODO: 17.03.2021 Warning das dieser Tourname bereits vergeben ist
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Entfernt eine Tour anhand des Tournamens
|
||||
* @param tourname Name der zu entfernenden Tour
|
||||
* Fügt eine neue Tour hinzu
|
||||
*/
|
||||
public void removeTour(String tourname){
|
||||
tourData.removeIf(s -> s.getName().equals(tourname));
|
||||
tourNamen.removeIf(s -> s.equals(tourname));
|
||||
public void addTour(){
|
||||
while(this.neueTourName == null) {
|
||||
this.neueTourName = AlertHelper.inputText("Tourname", "Bitte geben Sie den Namen der Tour an!", "Name:");
|
||||
if (getTour(this.neueTourName) != null) {
|
||||
AlertHelper.warn("ACHTUNG", "Name bereits vergeben!", "Der Name '"+ this.neueTourName +"' ist bereits vergeben, bitte verwenden Sie einen andern!");
|
||||
this.neueTourName = null;
|
||||
}
|
||||
}
|
||||
while(this.neueTourStart == null){
|
||||
this.neueTourStart = AlertHelper.inputText("Tour Startpunkt", "Bitte geben Sie den Startpunkt der Tour an!", "Startpunkt: ");
|
||||
}
|
||||
while(this.neueTourZiel == null){
|
||||
this.neueTourZiel = AlertHelper.inputText("Tour zielpunkt", "Bitte geben Sie den Zielpunkt der Tour an!", "Zielpunkt: ");
|
||||
}
|
||||
if (getTour(this.neueTourName) == null) {
|
||||
tourData.add(new Tour(this.neueTourName, "TBD", "TBD", 0, this.neueTourStart, this.neueTourZiel));
|
||||
tourNamen.add(this.neueTourName);
|
||||
}
|
||||
this.neueTourStart = null;
|
||||
this.neueTourZiel = null;
|
||||
this.neueTourName = null;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -71,12 +59,13 @@ public class ViewModel {
|
||||
return returnTour.get();
|
||||
}
|
||||
|
||||
// public void selectTour(String tourname){
|
||||
public void selectTour(String tourname){
|
||||
this.selectedTour = getTour(tourname);
|
||||
// this.selectedTour.removeIf(s -> true);//Alle deselect
|
||||
// this.selectedTour.add(getTour(tourname));
|
||||
// }
|
||||
}
|
||||
|
||||
public ObservableList<Tour> getSelectedTour() {
|
||||
public Tour getSelectedTour() {
|
||||
return selectedTour;
|
||||
}
|
||||
|
||||
@ -112,10 +101,24 @@ public class ViewModel {
|
||||
return tourData;
|
||||
}
|
||||
|
||||
public void delTour() {
|
||||
/**
|
||||
* Entfernt eine Tour anhand der ausgewählten Tour
|
||||
*/
|
||||
public void delTour(){
|
||||
try {
|
||||
String tourname = this.selectedTour.getName();
|
||||
tourData.removeIf(s -> s.getName().equals(tourname));
|
||||
tourNamen.removeIf(s -> s.equals(tourname));
|
||||
}catch (NullPointerException e){
|
||||
LogHelper.error("Keine Tour ausgewählt!", "ViewModel -> DelTour");
|
||||
AlertHelper.warn("ACHTUNG", "Keine Tour ausgewählt!", "Bitte wählen Sie zuerst eine Tour aus, bevor Sie auf löschen klicken!");
|
||||
}
|
||||
}
|
||||
|
||||
public void suche(){
|
||||
/**
|
||||
* Sucht eine Tour
|
||||
*/
|
||||
public void suche(String suchString){
|
||||
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user