|
3 | 3 | import com.google.gson.JsonObject; |
4 | 4 | import com.sun.javafx.collections.ObservableListWrapper; |
5 | 5 | import javafx.beans.property.SimpleStringProperty; |
| 6 | +import javafx.fxml.FXMLLoader; |
| 7 | +import javafx.scene.Parent; |
| 8 | +import javafx.scene.Scene; |
6 | 9 | import javafx.scene.control.*; |
7 | 10 | import javafx.scene.control.cell.TextFieldTableCell; |
8 | 11 | import javafx.scene.input.MouseEvent; |
9 | 12 | import javafx.scene.layout.GridPane; |
10 | 13 | import javafx.scene.layout.Priority; |
| 14 | +import javafx.stage.Modality; |
| 15 | +import javafx.stage.Stage; |
11 | 16 | import org.jetbrains.annotations.NotNull; |
12 | 17 |
|
| 18 | +import java.io.IOException; |
13 | 19 | import java.io.PrintWriter; |
14 | 20 | import java.io.StringWriter; |
15 | 21 | import java.net.URI; |
@@ -180,6 +186,21 @@ public void clickedMercuryAddEmptyHeader(MouseEvent mouseEvent) { |
180 | 186 | mercuryHeaders.getFocusModel().focus(last); |
181 | 187 | } |
182 | 188 |
|
| 189 | + public void clickedResponse(MouseEvent mouseEvent) throws IOException { |
| 190 | + String json = responses.getSelectionModel().getSelectedItem(); |
| 191 | + |
| 192 | + FXMLLoader fxmlLoader = new FXMLLoader(getClass().getClassLoader().getResource("responseDialog.fxml")); |
| 193 | + Parent parent = fxmlLoader.load(); |
| 194 | + ResponseDialogController dialogController = fxmlLoader.getController(); |
| 195 | + dialogController.setJson(json); |
| 196 | + |
| 197 | + Scene scene = new Scene(parent, 400, 300); |
| 198 | + Stage stage = new Stage(); |
| 199 | + stage.initModality(Modality.APPLICATION_MODAL); |
| 200 | + stage.setScene(scene); |
| 201 | + stage.showAndWait(); |
| 202 | + } |
| 203 | + |
183 | 204 | public static class Header { |
184 | 205 | private final SimpleStringProperty key; |
185 | 206 | private final SimpleStringProperty value; |
|
0 commit comments