From 50163dc6576ce5476f4fb0f2d1f88a3f001d1b05 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oliver=20L=C3=B6ffler?= <22102800+Oliver-Loeffler@users.noreply.github.com> Date: Tue, 7 Feb 2023 21:04:27 +0100 Subject: [PATCH] feat: Added link to JFX-Central in menu Help/JavaFX/ (#570) --- .../scenebuilder/app/DocumentWindowController.java | 10 ++++++++-- .../scenebuilder/app/menubar/MenuBarController.java | 5 +++++ .../scenebuilder/app/i18n/SceneBuilderApp.properties | 1 + .../javafx/scenebuilder/app/menubar/MenuBar.fxml | 2 ++ .../scenebuilder/kit/editor/DocumentationUrls.java | 7 ++++++- 5 files changed, 22 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/com/oracle/javafx/scenebuilder/app/DocumentWindowController.java b/app/src/main/java/com/oracle/javafx/scenebuilder/app/DocumentWindowController.java index b5af4e0fe..89e1c2ef0 100644 --- a/app/src/main/java/com/oracle/javafx/scenebuilder/app/DocumentWindowController.java +++ b/app/src/main/java/com/oracle/javafx/scenebuilder/app/DocumentWindowController.java @@ -166,7 +166,8 @@ public enum DocumentControlAction { HELP_OPEN_OPENJFX_CSS_REFERENCE, HELP_OPEN_OPENJFX_FXML_REFERENCE, HELP_OPEN_GLUON_SCENEBUILDER_HOME, - HELP_COMMUNITY_CONTRIBUTE_SCENEBUILDER, + HELP_COMMUNITY_CONTRIBUTE_SCENEBUILDER, + HELP_OPEN_JFXCENTRAL_HOMEPAGE, } public enum DocumentEditAction { @@ -654,6 +655,7 @@ public boolean canPerformControlAction(DocumentControlAction controlAction) { case HELP_OPEN_OPENJFX_CSS_REFERENCE: case HELP_OPEN_OPENJFX_FXML_REFERENCE: case HELP_OPEN_GLUON_SCENEBUILDER_HOME: + case HELP_OPEN_JFXCENTRAL_HOMEPAGE: case HELP_COMMUNITY_CONTRIBUTE_SCENEBUILDER: result = true; break; @@ -883,7 +885,11 @@ public void performControlAction(DocumentControlAction controlAction) { case HELP_COMMUNITY_CONTRIBUTE_SCENEBUILDER: openURL(DocumentationUrls.GLUON_SCENEBUILDER_CONTRIBUTE.toString()); break; - + + case HELP_OPEN_JFXCENTRAL_HOMEPAGE: + openURL(DocumentationUrls.JFXCENTRAL_HOMEPAGE.toString()); + break; + case SHOW_SAMPLE_CONTROLLER: if (skeletonWindowController == null) { skeletonWindowController = new SkeletonWindowController(editorController, diff --git a/app/src/main/java/com/oracle/javafx/scenebuilder/app/menubar/MenuBarController.java b/app/src/main/java/com/oracle/javafx/scenebuilder/app/menubar/MenuBarController.java index c7f74f77c..3948053cd 100644 --- a/app/src/main/java/com/oracle/javafx/scenebuilder/app/menubar/MenuBarController.java +++ b/app/src/main/java/com/oracle/javafx/scenebuilder/app/menubar/MenuBarController.java @@ -425,6 +425,8 @@ public class MenuBarController { private MenuItem fxmlIntroductionMenuItem; @FXML private MenuItem communityContributeMenuItem; + @FXML + private MenuItem jfxCentralMenuItem; private static final KeyCombination.Modifier modifier; private final Map keyToMenu = new HashMap<>(); @@ -646,6 +648,7 @@ private void controllerDidLoadFxml() { assert fxmlIntroductionMenuItem != null; assert sceneBuilderHomeMenuItem != null; assert communityContributeMenuItem != null; + assert jfxCentralMenuItem != null; /* * To make MenuBar.fxml editable with SB 1.1, the menu bar is enclosed @@ -1157,6 +1160,8 @@ public String getTitle() { cssReferenceGuideMenuItem.setAccelerator(new KeyCodeCombination(KeyCode.F4)); fxmlIntroductionMenuItem.setUserData(new DocumentControlActionController(DocumentControlAction.HELP_OPEN_OPENJFX_FXML_REFERENCE)); fxmlIntroductionMenuItem.setAccelerator(new KeyCodeCombination(KeyCode.F5)); + jfxCentralMenuItem.setUserData(new DocumentControlActionController(DocumentControlAction.HELP_OPEN_JFXCENTRAL_HOMEPAGE)); + jfxCentralMenuItem.setAccelerator(new KeyCodeCombination(KeyCode.F6)); sceneBuilderHomeMenuItem.setUserData(new DocumentControlActionController(DocumentControlAction.HELP_OPEN_GLUON_SCENEBUILDER_HOME)); communityContributeMenuItem.setUserData(new DocumentControlActionController(DocumentControlAction.HELP_COMMUNITY_CONTRIBUTE_SCENEBUILDER)); /* diff --git a/app/src/main/resources/com/oracle/javafx/scenebuilder/app/i18n/SceneBuilderApp.properties b/app/src/main/resources/com/oracle/javafx/scenebuilder/app/i18n/SceneBuilderApp.properties index b77ee6359..268837898 100644 --- a/app/src/main/resources/com/oracle/javafx/scenebuilder/app/i18n/SceneBuilderApp.properties +++ b/app/src/main/resources/com/oracle/javafx/scenebuilder/app/i18n/SceneBuilderApp.properties @@ -201,6 +201,7 @@ menu.title.help.openjfx.css.reference=JavaFX CSS Reference Guide menu.title.help.openjfx.fxml.reference=Introduction to FXML menu.title.help.scenebuilder.contribute=Contribute to Scene Builder menu.title.help.scenebuilder.home=Gluon Scene Builder Home +menu.title.help.jfxcentral.homepage=JFX-Central # ----------------------------------------------------------------------------- # Document # ----------------------------------------------------------------------------- diff --git a/app/src/main/resources/com/oracle/javafx/scenebuilder/app/menubar/MenuBar.fxml b/app/src/main/resources/com/oracle/javafx/scenebuilder/app/menubar/MenuBar.fxml index ad2b92255..3defd6871 100644 --- a/app/src/main/resources/com/oracle/javafx/scenebuilder/app/menubar/MenuBar.fxml +++ b/app/src/main/resources/com/oracle/javafx/scenebuilder/app/menubar/MenuBar.fxml @@ -307,6 +307,8 @@ + + diff --git a/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/editor/DocumentationUrls.java b/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/editor/DocumentationUrls.java index 26c7befc7..cb9dfd216 100644 --- a/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/editor/DocumentationUrls.java +++ b/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/editor/DocumentationUrls.java @@ -62,7 +62,12 @@ public enum DocumentationUrls { OPENJFX_CSS_REFERENCE("https://openjfx.io/javadoc/{javafx.version.major}/javafx.graphics/javafx/scene/doc-files/cssref.html"), OPENJFX_FXML_REFERENCE("https://openjfx.io/javadoc/{javafx.version.major}/javafx.fxml/javafx/fxml/doc-files/introduction_to_fxml.html"), - GLUON_SCENEBUILDER_CONTRIBUTE("https://github.com/gluonhq/scenebuilder"); + GLUON_SCENEBUILDER_CONTRIBUTE("https://github.com/gluonhq/scenebuilder"), + + /** + * 3rd Party + */ + JFXCENTRAL_HOMEPAGE("https://www.jfx-central.com"); private static final String SAFE_DEFAULT_VERSION = "17";