#23: Create Medication Modal
All checks were successful
Quality Check / Linting Check (push) Successful in 12s
Quality Check / Javadoc Check (push) Successful in 21s

This commit is contained in:
Ole Kück 2024-05-08 16:58:00 +02:00 committed by Dominik Säume
parent 192c14eb0d
commit 861ff49940
Signed by: SZUT-Dominik
GPG key ID: 67D15BB250B41E7C
4 changed files with 57 additions and 0 deletions

View file

@ -1,15 +1,22 @@
package de.hitec.nhplus.medication;
import de.hitec.nhplus.Main;
import de.hitec.nhplus.datastorage.DaoFactory;
import de.hitec.nhplus.medication.database.MedicationDao;
import javafx.beans.property.SimpleStringProperty;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.fxml.FXMLLoader;
import javafx.scene.Scene;
import javafx.scene.control.TableColumn;
import javafx.scene.control.TableView;
import javafx.scene.control.cell.PropertyValueFactory;
import javafx.scene.layout.BorderPane;
import javafx.stage.Stage;
import java.io.IOException;
import java.sql.SQLException;
import java.util.stream.Collectors;
@ -76,4 +83,27 @@ public class AllMedicationController {
exception.printStackTrace();
}
}
@FXML
public void handleNewMedication() {
try {
FXMLLoader loader = new FXMLLoader(
Main.class.getResource("/de/hitec/nhplus/medication/MedicationModal.fxml")
);
BorderPane pane = loader.load();
Scene scene = new Scene(pane);
Stage stage = new Stage();
MedicationModalController controller = loader.getController();
controller.initialize();
stage.setScene(scene);
stage.setTitle("NHPlus - Neues Medikament");
stage.setResizable(true);
stage.setAlwaysOnTop(true);
stage.showAndWait();
} catch (IOException exception) {
exception.printStackTrace();
}
}
}

View file

@ -0,0 +1,8 @@
package de.hitec.nhplus.medication;
public class MedicationModalController {
public void initialize(){
}
}

View file

@ -66,6 +66,7 @@
fx:id="buttonAdd"
mnemonicParsing="false"
prefWidth="90.0"
onAction="#handleNewMedication"
text="Hinzufügen"
/>
<Button

View file

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.scene.layout.*?>
<?import javafx.geometry.Insets?>
<?import javafx.scene.control.Label?>
<BorderPane
xmlns="http://javafx.com/javafx/17.0.2-ea"
xmlns:fx="http://javafx.com/fxml/1"
fx:controller="de.hitec.nhplus.medication.MedicationModalController"
>
<padding>
<Insets top="8" left="8" bottom="8" right="8"/>
</padding>
<center>
<Label text="Test"/>
</center>
</BorderPane>