File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed
src/main/java/ee/ut/similaritydetector/ui/controllers Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -131,6 +131,11 @@ private void viewClusters() {
131131 * @throws IOException if the code view could not be opened
132132 */
133133 private void openCodeView () throws IOException {
134+ // If already open then bring to front and don't open new one
135+ if (codeViewStage != null ) {
136+ codeViewStage .toFront ();
137+ return ;
138+ }
134139 FXMLLoader loader = new FXMLLoader (getClass ().getResource (
135140 "/ee/ut/similaritydetector/fxml/code_view.fxml" ));
136141 Parent root = loader .load ();
@@ -153,6 +158,7 @@ private void openCodeView() throws IOException {
153158
154159 newWindow .show ();
155160 codeViewStage = newWindow ;
161+ codeViewStage .setOnCloseRequest (event -> codeViewStage = null );
156162
157163 // Resize cluster table columns
158164 Platform .runLater (controller ::resizeClusterTableColumns );
You can’t perform that action at this time.
0 commit comments