Skip to content

Commit 76ccca0

Browse files
committed
Add tabs to execute window and first steps to make it resizeble
1 parent e74d1c5 commit 76ccca0

File tree

3 files changed

+76
-25
lines changed

3 files changed

+76
-25
lines changed

src/main/java/com/github/introfog/gitwave/controller/ExecuteController.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,8 @@ protected void browseDirectory() {
8989

9090
@FXML
9191
protected void updateSavedCommand() {
92+
// TODO get rid of special window for updating saved command, just add buttons "update existed" and "save as new" to execute window
93+
// TODO when the saved command hasn't been changed, write it green, when you change it, write red, and show buttons "update existed" and "save as new"
9294
FxmlStageHolder holder = StageFactory.createModalStage("view/updater.fxml", "Command updater");
9395

9496
UpdateController updateController = holder.getFxmlLoader().getController();

src/main/java/com/github/introfog/gitwave/model/StageFactory.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,9 @@ public static FxmlStageHolder createModalStage(String fxmlPath, String title) {
5151
}
5252

5353
public static FxmlStageHolder createPrimaryStage(String fxmlPath, String title, Stage stage) {
54-
return creteStage(fxmlPath, title, stage);
54+
final FxmlStageHolder holder = creteStage(fxmlPath, title, stage);
55+
holder.getStage().setResizable(true);
56+
return holder;
5557
}
5658

5759
private static FxmlStageHolder creteStage(String fxmlPath, String title, Stage stage) {

src/main/resources/com/github/introfog/gitwave/view/executor.fxml

Lines changed: 71 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -7,32 +7,79 @@
77
<?import javafx.scene.control.MenuBar?>
88
<?import javafx.scene.control.MenuItem?>
99
<?import javafx.scene.control.SeparatorMenuItem?>
10+
<?import javafx.scene.control.Tab?>
11+
<?import javafx.scene.control.TabPane?>
1012
<?import javafx.scene.control.TextField?>
1113
<?import javafx.scene.layout.AnchorPane?>
12-
<AnchorPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="290.0" prefWidth="600.0" xmlns="http://javafx.com/javafx/17.0.2-ea" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.github.introfog.gitwave.controller.ExecuteController">
14+
<?import javafx.scene.layout.ColumnConstraints?>
15+
<?import javafx.scene.layout.GridPane?>
16+
<?import javafx.scene.layout.RowConstraints?>
17+
<AnchorPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="300.0" prefWidth="450.0" xmlns="http://javafx.com/javafx/17.0.2-ea" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.github.introfog.gitwave.controller.ExecuteController">
1318
<children>
14-
<Label layoutX="32.0" layoutY="52.0" prefWidth="270.0" text="Choose directory where git command will be run" />
15-
<TextField fx:id="directory" layoutX="32.0" layoutY="78.0" prefHeight="25.0" prefWidth="378.0" />
16-
<Button layoutX="470.0" layoutY="78.0" mnemonicParsing="false" onAction="#browseDirectory" text="Browse" />
17-
<TextField fx:id="command" layoutX="32.0" layoutY="146.0" prefHeight="25.0" prefWidth="378.0" />
18-
<Label layoutX="32.0" layoutY="115.0" text="Command" />
19-
<Button fx:id="run" layoutX="452.0" layoutY="146.0" mnemonicParsing="false" onAction="#runCommand" text="Run" />
20-
<Button fx:id="save" layoutX="525.0" layoutY="146.0" mnemonicParsing="false" onAction="#saveCommand" text="Save" />
21-
<Button layoutX="243.0" layoutY="251.0" mnemonicParsing="false" onAction="#chooseFromSaved" text="Choose from saved" />
22-
<TextField fx:id="description" layoutX="32.0" layoutY="207.0" prefHeight="25.0" prefWidth="378.0" />
23-
<Label layoutX="32.0" layoutY="180.0" text="Description" />
24-
<Button fx:id="update" disable="true" layoutX="443.0" layoutY="207.0" mnemonicParsing="false" onAction="#updateSavedCommand" text="Update" />
25-
<Button fx:id="clean" disable="true" layoutX="523.0" layoutY="207.0" mnemonicParsing="false" onAction="#cleanSavedCommand" text="Clean" />
26-
<MenuBar layoutY="2.0" prefHeight="25.0" prefWidth="600.0">
27-
<menus>
28-
<Menu mnemonicParsing="false" text="Menu">
29-
<items>
30-
<MenuItem mnemonicParsing="false" onAction="#openSettings" text="Settings" />
31-
<SeparatorMenuItem mnemonicParsing="false" />
32-
<MenuItem mnemonicParsing="false" onAction="#openAbout" text="About" />
33-
</items></Menu>
34-
</menus>
35-
</MenuBar>
36-
<Hyperlink layoutX="507.0" layoutY="265.0" onAction="#foundIssue" text="Found an issue?" />
19+
<GridPane AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
20+
<columnConstraints>
21+
<ColumnConstraints hgrow="ALWAYS" minWidth="10.0" prefWidth="100.0" />
22+
</columnConstraints>
23+
<rowConstraints>
24+
<RowConstraints maxHeight="25.0" minHeight="25.0" prefHeight="25.0" vgrow="NEVER" />
25+
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
26+
<RowConstraints maxHeight="50.0" minHeight="50.0" prefHeight="50.0" vgrow="NEVER" />
27+
</rowConstraints>
28+
<children>
29+
<MenuBar prefHeight="25.0" prefWidth="450.0" GridPane.vgrow="NEVER">
30+
<menus>
31+
<Menu mnemonicParsing="false" text="Menu">
32+
<items>
33+
<MenuItem mnemonicParsing="false" onAction="#openSettings" text="Settings" />
34+
<SeparatorMenuItem mnemonicParsing="false" />
35+
<MenuItem mnemonicParsing="false" onAction="#openAbout" text="About" />
36+
</items>
37+
</Menu>
38+
</menus>
39+
</MenuBar>
40+
<AnchorPane prefHeight="200.0" prefWidth="200.0" GridPane.rowIndex="2" GridPane.vgrow="NEVER">
41+
<children>
42+
<Hyperlink layoutY="25.0" onAction="#foundIssue" text="Found an issue?" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" />
43+
<Button fx:id="run" layoutX="386.0" layoutY="36.0" mnemonicParsing="false" onAction="#runCommand" text="4. Run" AnchorPane.bottomAnchor="20.0" AnchorPane.rightAnchor="20.0" />
44+
</children>
45+
</AnchorPane>
46+
<TabPane prefHeight="204.0" prefWidth="450.0" style="-fx-border-color: black;" tabClosingPolicy="UNAVAILABLE" GridPane.hgrow="ALWAYS" GridPane.rowIndex="1" GridPane.vgrow="ALWAYS">
47+
<tabs>
48+
<Tab text="1. Directory">
49+
<content>
50+
<AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="180.0" prefWidth="200.0">
51+
<children>
52+
<Label prefWidth="270.0" text="Choose directory where git command will be run" />
53+
<TextField fx:id="directory" layoutY="40.0" prefHeight="25.0" prefWidth="378.0" />
54+
<Button layoutY="88.0" mnemonicParsing="false" onAction="#browseDirectory" text="Browse" />
55+
</children>
56+
</AnchorPane>
57+
</content>
58+
</Tab>
59+
<Tab text="2. Command">
60+
<content>
61+
<AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="180.0" prefWidth="200.0">
62+
<children>
63+
<Label text="Command" />
64+
<TextField fx:id="command" layoutY="37.0" prefHeight="25.0" prefWidth="378.0" />
65+
<Label layoutX="8.0" layoutY="71.0" text="Description" />
66+
<TextField fx:id="description" layoutY="88.0" prefHeight="25.0" prefWidth="378.0" />
67+
<Button fx:id="save" layoutX="48.0" layoutY="138.0" mnemonicParsing="false" onAction="#saveCommand" text="Save" />
68+
<Button layoutX="130.0" layoutY="138.0" mnemonicParsing="false" onAction="#chooseFromSaved" text="Choose from saved" />
69+
<Button fx:id="update" disable="true" layoutX="351.0" layoutY="138.0" mnemonicParsing="false" onAction="#updateSavedCommand" text="Update" />
70+
<Button fx:id="clean" disable="true" layoutX="287.0" layoutY="138.0" mnemonicParsing="false" onAction="#cleanSavedCommand" text="Clean" />
71+
</children>
72+
</AnchorPane>
73+
</content>
74+
</Tab>
75+
<Tab text="3. Parameters">
76+
<content>
77+
<AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="180.0" prefWidth="200.0" />
78+
</content>
79+
</Tab>
80+
</tabs>
81+
</TabPane>
82+
</children>
83+
</GridPane>
3784
</children>
3885
</AnchorPane>

0 commit comments

Comments
 (0)