From b7c46982493541d2f3f77bb5d707ccea654c0483 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Pereda?= Date: Wed, 30 Oct 2024 19:03:59 +0100 Subject: [PATCH 1/6] Update PreviewWindowController to prevent exception (#788) --- .../scenebuilder/kit/preview/PreviewWindowController.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/preview/PreviewWindowController.java b/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/preview/PreviewWindowController.java index 222f29e61..55beff0f6 100644 --- a/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/preview/PreviewWindowController.java +++ b/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/preview/PreviewWindowController.java @@ -324,7 +324,7 @@ public void run() { } getScene().setRoot(getRoot()); - if (themeStyleSheetsList != null) { + if (themeStyleSheetsList != null && !themeStyleSheetsList.isEmpty()) { getScene().setUserAgentStylesheet(themeStyleSheetsList.getFirst()); ObservableList newStylesheets = FXCollections.observableArrayList(themeStyleSheetsList); getScene().getStylesheets().clear(); From 255053bff8451d709b6221680d09f2af2515468a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Pereda?= Date: Wed, 30 Oct 2024 19:14:31 +0100 Subject: [PATCH 2/6] Update apple action version (#785) --- .github/workflows/bundles-mac.yml | 2 +- .github/workflows/bundles-mac_aarch64.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/bundles-mac.yml b/.github/workflows/bundles-mac.yml index cd9cea1cc..ce8e5ccad 100644 --- a/.github/workflows/bundles-mac.yml +++ b/.github/workflows/bundles-mac.yml @@ -51,7 +51,7 @@ jobs: release: ${{ inputs.java-release }} version: ${{ inputs.java-version }} - - uses: Apple-Actions/import-codesign-certs@v1 + - uses: Apple-Actions/import-codesign-certs@v3 with: p12-file-base64: ${{ secrets.CERTIFICATES_FILE_BASE64 }} p12-password: ${{ secrets.CERTIFICATES_PASSWORD }} diff --git a/.github/workflows/bundles-mac_aarch64.yml b/.github/workflows/bundles-mac_aarch64.yml index 16d80b6b6..253b7a3a8 100644 --- a/.github/workflows/bundles-mac_aarch64.yml +++ b/.github/workflows/bundles-mac_aarch64.yml @@ -52,7 +52,7 @@ jobs: release: ${{ inputs.java-release }} version: ${{ inputs.java-version }} - - uses: Apple-Actions/import-codesign-certs@v1 + - uses: Apple-Actions/import-codesign-certs@v3 with: p12-file-base64: ${{ secrets.CERTIFICATES_FILE_BASE64 }} p12-password: ${{ secrets.CERTIFICATES_PASSWORD }} From 77b10fcf68949f5177d8b25e25fa7692297c21f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Pereda?= Date: Wed, 30 Oct 2024 19:37:57 +0100 Subject: [PATCH 3/6] build: Add input for RC version to release workflow (#789) * Add input for RC version to release workflow * Address feedback --- .github/workflows/release.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f8650c511..730e42964 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -9,6 +9,10 @@ on: options: - RC - GA + rc_version: + type: string + default: '' + description: 'If candidate is RC, set a version like RC1 or RC2, else leave it empty' env: JAVA_RELEASE: '23' @@ -53,7 +57,11 @@ jobs: S3_PATH=$PROJECT_VERSION CANDIDATE=${{ github.event.inputs.candidate }} if [[ "$CANDIDATE" == RC ]]; then - PROJECT_VERSION=${PROJECT_VERSION}-RC + RC_VERSION = ${{ github.event.inputs.rc_version }} + if [[ "$RC_VERSION" == "" ]]; then + RC_VERSION = "RC" + fi + PROJECT_VERSION=${PROJECT_VERSION}-${RC_VERSION} S3_PATH=RC/$PROJECT_VERSION fi echo "Releasing.. "$PROJECT_VERSION From bef255f917400e22189bce863b8c6fd32b37d0ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Pereda?= Date: Wed, 30 Oct 2024 20:22:58 +0100 Subject: [PATCH 4/6] Update release.yml (#790) --- .github/workflows/release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 730e42964..50d496571 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -57,9 +57,9 @@ jobs: S3_PATH=$PROJECT_VERSION CANDIDATE=${{ github.event.inputs.candidate }} if [[ "$CANDIDATE" == RC ]]; then - RC_VERSION = ${{ github.event.inputs.rc_version }} + RC_VERSION=${{ github.event.inputs.rc_version }} if [[ "$RC_VERSION" == "" ]]; then - RC_VERSION = "RC" + RC_VERSION="RC" fi PROJECT_VERSION=${PROJECT_VERSION}-${RC_VERSION} S3_PATH=RC/$PROJECT_VERSION From ad3003eed990f75e08bbb09e6596fea80a6b0272 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Pereda?= Date: Tue, 5 Nov 2024 10:28:07 +0100 Subject: [PATCH 5/6] docs: Update README.md (#792) * Update README.md * add javadoc badge * Update README.md * Update README.md * add logo * Update README.md * Apply suggestions from code review Co-authored-by: Erwin Morrhey * Update README.md * Update README.md Co-authored-by: Erwin Morrhey * Update README.md * Change workflow --------- Co-authored-by: Erwin Morrhey --- .github/assets/gluon_logo.svg | 195 ++++++++++++++++++++++++++++++++++ README.md | 55 ++++++++-- 2 files changed, 240 insertions(+), 10 deletions(-) create mode 100644 .github/assets/gluon_logo.svg diff --git a/.github/assets/gluon_logo.svg b/.github/assets/gluon_logo.svg new file mode 100644 index 000000000..06aff6243 --- /dev/null +++ b/.github/assets/gluon_logo.svg @@ -0,0 +1,195 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/README.md b/README.md index 1b4bc433e..e0142045e 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,15 @@ +[![Gluon](.github/assets/gluon_logo.svg)](https://gluonhq.com) + # Gluon Scene Builder # +[![Build](https://github.com/gluonhq/scenebuilder/actions/workflows/early-access.yml/badge.svg)](https://github.com/gluonhq/scenebuilder/actions/workflows/early-access.yml) +[![License](https://img.shields.io/badge/license-BSD-green)](./LICENSE) + +#### Scene Builder Kit #### + +[![Maven Central](https://img.shields.io/maven-central/v/com.gluonhq.scenebuilder/kit)](https://search.maven.org/#search|ga|1|com.gluonhq.scenebuilder) +[![javadoc](https://javadoc.io/badge2/com.gluonhq.scenebuilder/kit/javadoc.svg?color=blue)](https://javadoc.io/doc/com.gluonhq.scenebuilder/kit) + Gluon [Scene Builder](http://gluonhq.com/products/scene-builder/) is a drag and drop UI designer tool allowing rapid desktop and mobile app development. Scene Builder separates design from logic, allowing team members to quickly and easily focus on their specific aspect of application development. @@ -44,7 +54,7 @@ These are the requisites: ### How to build Scene Builder ### -Scene Builder makes use of the Maven Wrapper to build and run the project. So there is no need to install Maven on the developers machine. To utilize Maven Wrapper, instead of calling `mvn`, one can run `./mvnw` on Linux or macOS or `mvnw` on Windows instead. +Scene Builder uses Maven Wrapper to build and run the project. Run `./mvnw` on Linux or macOS and `mvnw` on Windows. To build the Scene Builder services, on the project's root, run: @@ -61,11 +71,11 @@ It will create a partial shadow cross-platform jar under `app/target/lib/scenebu Before starting the app, all dependencies must be installed locally. This is achieved by: -`mvn install` +`./mvnw install` Then Scene Builder can be started with Maven: -`mvn javafx:run -f app` +`./mvnw javafx:run -f app` Alternatively, you can run the partial shadow jar in the classpath, providing you have downloaded the JavaFX SDK from [here](https://gluonhq.com/products/javafx/): @@ -78,14 +88,29 @@ java \ com.oracle.javafx.scenebuilder.app.SceneBuilderApp ``` -## Scene Builder Kit ## +## Scene Builder components ## + +The Scene Builder project has three main components defined by three modules (that is, three Java modules defined in three Maven modules subprojects): + +- Scene Builder App +- Scene Builder Kit +- Gluon plugin + +### Scene Builder App ### + +Contains the JavaFX main application that embeds the Scene Builder Kit, and includes menus, preferences and dialogs to interact with it. -To build and install the Scene Builder Kit in your local repository, run: +### Scene Builder Kit ### -`mvn clean install -f kit` +Scene Builder Kit is the core of the project and defines three main areas: -The custom controls of the Scene Builder kit can be used in your project. -You can add it as a regular dependency to the build of your app: +- Left: Library of custom and built-in controls, Hierarchy and Controller of the FXML layout being edited +- Center: Workspace area for displaying the content of the FXML layout that is being designed +- Right: Inspector with properties, layout and event handlers of the components of the FXML layout. + +Scene Builder Kit contains an API that allows these components and their functionality to be integrated in other applications or IDEs. Scene Builder App is the best example of such integration. Another basic example can be found here: [EmbeddedSceneBuilderDemo](https://github.com/gluonhq/EmbeddedSceneBuilderDemo). You can also use the controls available in Scene Builder Kit in your project. + +Scene Builder Kit is published to Maven Central, and you can add it as a regular dependency to the build of your app: ``` @@ -95,6 +120,16 @@ You can add it as a regular dependency to the build of your app: ``` +If you want to build and install the Scene Builder Kit in your local repository, run: + +`./mvnw clean install -f kit` + +### Gluon plugin ### + +The Gluon section in the Library allows adding [Gluon Mobile](http://gluonhq.com/products/mobile) controls to the FXML layout, and setting the stylesheets from the Gluon themes and swatch colors. + +An easy way to get started is by selecting the Mobile Basic Screen from the available templates in the welcome dialog. + ## Code Style To ensure that new code formatting matches the requirements for Pull Requests, @@ -106,10 +141,10 @@ Contributors can check for code-style violations in their code by running the Ch To run the plugin: ``` -mvn checkstyle:checkstyle +./mvnw checkstyle:checkstyle ``` -There will be a report for each sub-project, one for `app` and one for `kit`. +There will be a report for each sub-project: * Kit: `kit/target/reports/checkstyle.html` * App: `app/target/reports/checkstyle.html` From ceece31224a89a039e0e9feb95d6042d57803032 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oliver=20L=C3=B6ffler?= <22102800+Oliver-Loeffler@users.noreply.github.com> Date: Sun, 10 Nov 2024 17:51:32 +0100 Subject: [PATCH 6/6] fix: Prevents CTRL+P from being masked by a given accelerator defined in FXML (#553) (#593) * fix: Prevents CTRL+P from being masked by a given accelerator defined in FXML. Hence allowing to show preview with CTRL+P. * Added showPreview method to MenuBarController. * Key code provided by event is now compared to KeyCode instance. --- .../scenebuilder/app/DocumentWindowController.java | 7 +++++++ .../scenebuilder/app/menubar/MenuBarController.java | 13 ++++++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) 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 ce4b14ee1..696dfbbc3 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 @@ -323,6 +323,13 @@ public enum ActionStatus { } event.consume(); } + + // Keep preview function working even if preview accelerator is + // already occupied in FXML + if (KeyCode.P.equals(event.getCode()) && modifierDown) { + menuBarController.showPreview(); + event.consume(); + } }; /* 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 c084dd91c..ed70eb019 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 @@ -432,6 +432,8 @@ public class MenuBarController { private static final KeyCombination.Modifier modifier; private final Map keyToMenu = new HashMap<>(); + private DocumentControlActionController previewController; + static { if (EditorPlatform.IS_MAC) { modifier = KeyCombination.META_DOWN; @@ -445,6 +447,12 @@ public MenuBarController(DocumentWindowController documentWindowController) { this.documentWindowController = documentWindowController; } + public void showPreview() { + if (previewController != null && previewController.canPerform()) { + previewController.perform(); + } + } + public MenuBar getMenuBar() { if (menuBar == null) { @@ -1037,7 +1045,10 @@ public void perform() { /* * Preview menu */ - showPreviewInWindowMenuItem.setUserData(new DocumentControlActionController(DocumentControlAction.SHOW_PREVIEW_WINDOW)); + if (null == previewController) { + previewController = new DocumentControlActionController(DocumentControlAction.SHOW_PREVIEW_WINDOW); + } + showPreviewInWindowMenuItem.setUserData(previewController); showPreviewInWindowMenuItem.setAccelerator(new KeyCodeCombination(KeyCode.P, modifier)); showPreviewInDialogMenuItem.setUserData(new DocumentControlActionController(DocumentControlAction.SHOW_PREVIEW_DIALOG)); caspianHighContrastThemeMenuItem.setUserData(new SetThemeActionController(EditorPlatform.Theme.CASPIAN_HIGH_CONTRAST));