Skip to content

Commit 5e2e68a

Browse files
author
Paul
authored
feat: Added help menu option to show the welcome screen (gluonhq#490)
1 parent b9837ca commit 5e2e68a

File tree

4 files changed

+13
-1
lines changed

4 files changed

+13
-1
lines changed

app/src/main/java/com/oracle/javafx/scenebuilder/app/SceneBuilderApp.java

+7-1
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,8 @@ public enum ApplicationControlAction {
110110
USE_DEFAULT_THEME,
111111
USE_DARK_THEME,
112112
SHOW_PREFERENCES,
113-
EXIT
113+
EXIT,
114+
SHOW_WELCOME
114115
}
115116

116117
private static SceneBuilderApp singleton;
@@ -212,6 +213,10 @@ public void performControlAction(ApplicationControlAction a, DocumentWindowContr
212213
case EXIT:
213214
performExit();
214215
break;
216+
217+
case SHOW_WELCOME:
218+
WelcomeDialogWindowController.getInstance().getStage().show();
219+
break;
215220
}
216221
}
217222

@@ -226,6 +231,7 @@ public boolean canPerformControlAction(ApplicationControlAction a, DocumentWindo
226231
case OPEN_FILE:
227232
case SHOW_PREFERENCES:
228233
case EXIT:
234+
case SHOW_WELCOME:
229235
result = true;
230236
break;
231237

app/src/main/java/com/oracle/javafx/scenebuilder/app/menubar/MenuBarController.java

+4
Original file line numberDiff line numberDiff line change
@@ -404,6 +404,8 @@ public class MenuBarController {
404404
@FXML
405405
private MenuItem helpMenuItem;
406406
@FXML
407+
private MenuItem showWelcomeItem;
408+
@FXML
407409
private MenuItem aboutMenuItem;
408410
@FXML
409411
private MenuItem checkUpdatesMenuItem;
@@ -628,6 +630,7 @@ private void controllerDidLoadFxml() {
628630
assert preferredPreviewSizeMenuItem != null;
629631

630632
assert helpMenuItem != null;
633+
assert showWelcomeItem != null;
631634
assert aboutMenuItem != null;
632635
assert checkUpdatesMenuItem != null;
633636
assert registerMenuItem != null;
@@ -1137,6 +1140,7 @@ public String getTitle() {
11371140
aboutMenuItem.setUserData(new ApplicationControlActionController(ApplicationControlAction.ABOUT));
11381141
helpMenuItem.setUserData(new DocumentControlActionController(DocumentControlAction.HELP));
11391142
helpMenuItem.setAccelerator(new KeyCodeCombination(KeyCode.F1));
1143+
showWelcomeItem.setUserData(new ApplicationControlActionController(ApplicationControlAction.SHOW_WELCOME));
11401144
checkUpdatesMenuItem.setUserData(new ApplicationControlActionController(ApplicationControlAction.CHECK_UPDATES));
11411145
registerMenuItem.setUserData(new ApplicationControlActionController(ApplicationControlAction.REGISTER));
11421146
gettingStartedMenuItem.setUserData(new DocumentControlActionController(DocumentControlAction.HELP_OPEN_GETTING_STARTED_GUIDE));

app/src/main/resources/com/oracle/javafx/scenebuilder/app/i18n/SceneBuilderApp.properties

+1
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,7 @@ menu.title.size.preferred.with.value = Preferred Size ({0} x {1})
190190
menu.title.no.window = No Window
191191
# Help menu items
192192
menu.title.scene.builder.help = Scene Builder Help
193+
menu.title.show.welcome = Show Welcome Page
193194
menu.title.check.updates = Check for Update...
194195
menu.title.about = About Scene Builder
195196
menu.title.register = Register...

app/src/main/resources/com/oracle/javafx/scenebuilder/app/menubar/MenuBar.fxml

+1
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,7 @@
315315
<SeparatorMenuItem mnemonicParsing="false" />
316316
<MenuItem fx:id="checkUpdatesMenuItem" mnemonicParsing="true" text="%menu.title.check.updates" />
317317
<MenuItem fx:id="registerMenuItem" mnemonicParsing="false" text="%menu.title.register" />
318+
<MenuItem fx:id="showWelcomeItem" mnemonicParsing="false" text="%menu.title.show.welcome" />
318319
<MenuItem fx:id="aboutMenuItem" mnemonicParsing="false" text="%menu.title.about" />
319320
</items>
320321
</Menu>

0 commit comments

Comments
 (0)