#23: Create Medication Modal
This commit is contained in:
parent
192c14eb0d
commit
861ff49940
4 changed files with 57 additions and 0 deletions
|
@ -1,15 +1,22 @@
|
||||||
package de.hitec.nhplus.medication;
|
package de.hitec.nhplus.medication;
|
||||||
|
|
||||||
|
import de.hitec.nhplus.Main;
|
||||||
import de.hitec.nhplus.datastorage.DaoFactory;
|
import de.hitec.nhplus.datastorage.DaoFactory;
|
||||||
import de.hitec.nhplus.medication.database.MedicationDao;
|
import de.hitec.nhplus.medication.database.MedicationDao;
|
||||||
import javafx.beans.property.SimpleStringProperty;
|
import javafx.beans.property.SimpleStringProperty;
|
||||||
import javafx.collections.FXCollections;
|
import javafx.collections.FXCollections;
|
||||||
import javafx.collections.ObservableList;
|
import javafx.collections.ObservableList;
|
||||||
|
import javafx.event.ActionEvent;
|
||||||
import javafx.fxml.FXML;
|
import javafx.fxml.FXML;
|
||||||
|
import javafx.fxml.FXMLLoader;
|
||||||
|
import javafx.scene.Scene;
|
||||||
import javafx.scene.control.TableColumn;
|
import javafx.scene.control.TableColumn;
|
||||||
import javafx.scene.control.TableView;
|
import javafx.scene.control.TableView;
|
||||||
import javafx.scene.control.cell.PropertyValueFactory;
|
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.sql.SQLException;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
@ -76,4 +83,27 @@ public class AllMedicationController {
|
||||||
exception.printStackTrace();
|
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();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,8 @@
|
||||||
|
package de.hitec.nhplus.medication;
|
||||||
|
|
||||||
|
public class MedicationModalController {
|
||||||
|
|
||||||
|
public void initialize(){
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
|
@ -66,6 +66,7 @@
|
||||||
fx:id="buttonAdd"
|
fx:id="buttonAdd"
|
||||||
mnemonicParsing="false"
|
mnemonicParsing="false"
|
||||||
prefWidth="90.0"
|
prefWidth="90.0"
|
||||||
|
onAction="#handleNewMedication"
|
||||||
text="Hinzufügen"
|
text="Hinzufügen"
|
||||||
/>
|
/>
|
||||||
<Button
|
<Button
|
||||||
|
|
|
@ -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>
|
Loading…
Reference in a new issue