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 {
3636 public void initialize (FxmlStageHolder fxmlStageHolder ) {
3737 super .initialize (fxmlStageHolder );
3838 fxmlStageHolder .getStage ().setOnCloseRequest (event -> {
39- wasClosed = true ;
40- StageFactory .unregisterExecutingController (this );
39+ beforeStageClose ();
4140 });
4241 canvas .setOnKeyPressed (event -> {
4342 if (event .getCode () == KeyCode .ESCAPE || event .getCode () == KeyCode .ENTER ) {
4443 if (isExecutionFinished ) {
45- fxmlStageHolder . getStage (). close ();
44+ closeStage ();
4645 }
4746 }
4847 });
4948 fxmlStageHolder .getScene ().setOnKeyPressed (event -> {
5049 if (event .getCode () == KeyCode .ESCAPE || event .getCode () == KeyCode .ENTER ) {
5150 if (isExecutionFinished ) {
52- fxmlStageHolder . getStage (). close ();
51+ closeStage ();
5352 }
5453 }
5554 });
@@ -83,11 +82,22 @@ public boolean wasClosed() {
8382 return wasClosed ;
8483 }
8584
85+ @ Override
86+ protected void closeStage () {
87+ beforeStageClose ();
88+ super .closeStage ();
89+ }
90+
8691 private void commonWritingPart (String line , String style ) {
8792 Platform .runLater (() -> {
8893 canvas .appendText (line );
8994 canvas .setStyle (canvas .getLength () - line .length (), canvas .getLength (), style );
9095 canvas .requestFollowCaret ();
9196 });
9297 }
98+
99+ private void beforeStageClose () {
100+ wasClosed = true ;
101+ StageFactory .unregisterExecutingController (this );
102+ }
93103}
Original file line number Diff line number Diff line change 77 <children >
88 <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" >
99 <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" />
1212 <TableColumn editable =" false" maxWidth =" 30.0" minWidth =" 30.0" prefWidth =" 30.0" resizable =" false" sortable =" false" />
1313 </columns >
1414 <columnResizePolicy >
You can’t perform that action at this time.
0 commit comments