File tree Expand file tree Collapse file tree 2 files changed +16
-6
lines changed
java/com/github/introfog/gitwave/controller/main
resources/com/github/introfog/gitwave/view Expand file tree Collapse file tree 2 files changed +16
-6
lines changed Original file line number Diff line number Diff line change @@ -36,20 +36,19 @@ public class ExecutionController extends BaseController {
36
36
public void initialize (FxmlStageHolder fxmlStageHolder ) {
37
37
super .initialize (fxmlStageHolder );
38
38
fxmlStageHolder .getStage ().setOnCloseRequest (event -> {
39
- wasClosed = true ;
40
- StageFactory .unregisterExecutingController (this );
39
+ beforeStageClose ();
41
40
});
42
41
canvas .setOnKeyPressed (event -> {
43
42
if (event .getCode () == KeyCode .ESCAPE || event .getCode () == KeyCode .ENTER ) {
44
43
if (isExecutionFinished ) {
45
- fxmlStageHolder . getStage (). close ();
44
+ closeStage ();
46
45
}
47
46
}
48
47
});
49
48
fxmlStageHolder .getScene ().setOnKeyPressed (event -> {
50
49
if (event .getCode () == KeyCode .ESCAPE || event .getCode () == KeyCode .ENTER ) {
51
50
if (isExecutionFinished ) {
52
- fxmlStageHolder . getStage (). close ();
51
+ closeStage ();
53
52
}
54
53
}
55
54
});
@@ -83,11 +82,22 @@ public boolean wasClosed() {
83
82
return wasClosed ;
84
83
}
85
84
85
+ @ Override
86
+ protected void closeStage () {
87
+ beforeStageClose ();
88
+ super .closeStage ();
89
+ }
90
+
86
91
private void commonWritingPart (String line , String style ) {
87
92
Platform .runLater (() -> {
88
93
canvas .appendText (line );
89
94
canvas .setStyle (canvas .getLength () - line .length (), canvas .getLength (), style );
90
95
canvas .requestFollowCaret ();
91
96
});
92
97
}
98
+
99
+ private void beforeStageClose () {
100
+ wasClosed = true ;
101
+ StageFactory .unregisterExecutingController (this );
102
+ }
93
103
}
Original file line number Diff line number Diff line change 7
7
<children >
8
8
<TableView fx : id =" commandsTable" onMouseClicked =" #mouseClick" prefHeight =" 223.0" prefWidth =" 600.0" AnchorPane.bottomAnchor=" 0.0" AnchorPane.leftAnchor=" 0.0" AnchorPane.rightAnchor=" 0.0" AnchorPane.topAnchor=" 0.0" >
9
9
<columns >
10
- <TableColumn minWidth =" 100.0" prefWidth =" 468 .0" text =" Command" />
11
- <TableColumn minWidth =" 100.0" prefWidth =" 300 .0" text =" Description" />
10
+ <TableColumn minWidth =" 100.0" prefWidth =" 384 .0" text =" Command" />
11
+ <TableColumn minWidth =" 100.0" prefWidth =" 384 .0" text =" Description" />
12
12
<TableColumn editable =" false" maxWidth =" 30.0" minWidth =" 30.0" prefWidth =" 30.0" resizable =" false" sortable =" false" />
13
13
</columns >
14
14
<columnResizePolicy >
You can’t perform that action at this time.
0 commit comments