Skip to content

Commit

Permalink
Merge branch 'master' into 749-publishkit
Browse files Browse the repository at this point in the history
  • Loading branch information
jperedadnr authored Oct 22, 2024
2 parents 4b68b3d + 8cb8648 commit 54e1ee1
Show file tree
Hide file tree
Showing 22 changed files with 257 additions and 303 deletions.
7 changes: 7 additions & 0 deletions app/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,13 @@
<artifactId>gluon-plugin</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.glassfish</groupId>
<artifactId>jakarta.json</artifactId>
<version>2.0.1</version>
<classifier>module</classifier>
<scope>runtime</scope>
</dependency>
</dependencies>

<build>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1405,7 +1405,7 @@ private void updateHierarchyDisplayOption() {
public void onManageJarFxml(ActionEvent event) {
if(libraryDialogController==null){
libraryDialogController = new LibraryDialogController(editorController, AppSettings.getUserM2Repository(),
AppSettings.getTempM2Repository(), PreferencesController.getSingleton(), getStage());
PreferencesController.getSingleton(), getStage());
libraryDialogController.setOnAddJar(() -> onImportJarFxml(libraryDialogController.getStage()));
libraryDialogController.setOnEditFXML(fxmlPath -> {
if (SceneBuilderApp.getSingleton().findFirstUnusedDocumentWindowController().isPresent()) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2016, 2022, Gluon and/or its affiliates.
* Copyright (c) 2016, 2024, Gluon and/or its affiliates.
* All rights reserved. Use is subject to license terms.
*
* This file is available and licensed under the following license:
Expand Down Expand Up @@ -40,10 +40,10 @@
import javafx.scene.image.Image;
import javafx.stage.Stage;

import javax.json.Json;
import javax.json.JsonObject;
import javax.json.JsonReader;
import javax.json.JsonReaderFactory;
import jakarta.json.Json;
import jakarta.json.JsonObject;
import jakarta.json.JsonReader;
import jakarta.json.JsonReaderFactory;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
Expand Down Expand Up @@ -78,10 +78,10 @@ public class AppSettings {
private static final JsonReaderFactory readerFactory = Json.createReaderFactory(null);

static {
initSceneBuiderVersion();
initSceneBuilderVersion();
}

private static void initSceneBuiderVersion() {
private static void initSceneBuilderVersion() {
try (InputStream in = AboutWindowController.class.getResourceAsStream("about.properties")) {
if (in != null) {
Properties sbProps = new Properties();
Expand Down Expand Up @@ -206,11 +206,4 @@ public static String getUserM2Repository() {
return m2Path;
}

public static String getTempM2Repository() {
String m2Path = System.getProperty("java.io.tmpdir") + File.separator + "m2Tmp"; //NOI18N

assert m2Path != null;

return m2Path;
}
}
2 changes: 1 addition & 1 deletion app/src/main/java/module-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
requires transitive com.gluonhq.scenebuilder.gluon.plugin;
requires java.logging;
requires java.prefs;
requires javax.json.api;
requires jakarta.json;

opens com.oracle.javafx.scenebuilder.app to javafx.fxml;
opens com.oracle.javafx.scenebuilder.app.about to javafx.fxml;
Expand Down
49 changes: 6 additions & 43 deletions kit/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,54 +31,17 @@
<version>${javafx.version}</version>
</dependency>

<!-- Eclipse Aether -->
<!-- Maven Resolver -->
<dependency>
<groupId>org.eclipse.aether</groupId>
<artifactId>aether-api</artifactId>
<version>${aether.version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.aether</groupId>
<artifactId>aether-impl</artifactId>
<version>${aether.version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.aether</groupId>
<artifactId>aether-connector-basic</artifactId>
<version>${aether.version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.aether</groupId>
<artifactId>aether-transport-file</artifactId>
<version>${aether.version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.aether</groupId>
<artifactId>aether-transport-http</artifactId>
<version>${aether.version}</version>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-aether-provider</artifactId>
<version>3.3.9</version>
<groupId>org.apache.maven.resolver</groupId>
<artifactId>maven-resolver-supplier</artifactId>
<version>${maven.resolver.version}</version>
</dependency>

<!-- Rest API -->
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.5.13</version>
</dependency>
<dependency>
<groupId>javax.json</groupId>
<artifactId>javax.json-api</artifactId>
<version>1.0</version>
</dependency>
<dependency>
<groupId>org.glassfish</groupId>
<artifactId>javax.json</artifactId>
<version>1.0.4</version>
<scope>runtime</scope>
<artifactId>jakarta.json</artifactId>
<version>2.0.1</version>
</dependency>
</dependencies>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,11 @@ public static Theme valueOf(String themeName) {
// no-op
}

public static boolean isPlatformThemeStylesheetURL(String stylesheetURL) {
// Return USER_AGENT css, which is Modena for fx 8.0
return stylesheetURL != null && stylesheetURL.equals(Theme.MODENA.getStylesheetURLs().getFirst());
}

public static String getPlatformThemeStylesheetURL() {
// Return USER_AGENT css, which is Modena for fx 8.0
return Theme.MODENA.getStylesheetURLs().getFirst();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1075,7 +1075,7 @@ private void themeDidChange() {
final EditorPlatform.Theme theme = getEditorController().getTheme();
List<String> themeStylesheets = new ArrayList<>(EditorPlatform.getStylesheetsForTheme(theme));
themeStylesheets.addAll(theme.getStylesheetURLs());
workspaceController.setThemeStyleSheet(themeStylesheets, theme);
workspaceController.setThemeStylesheet(themeStylesheets, theme);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,16 +163,18 @@ public List<String> getThemeStyleSheets() {
return Collections.unmodifiableList(themeStylesheets);
}

public void setThemeStyleSheet(List<String> themeStyleSheets, EditorPlatform.Theme theme) {
assert themeStyleSheets != null;
public void setThemeStylesheet(List<String> themeStylesheets, EditorPlatform.Theme theme) {
assert themeStylesheets != null;
assert theme != null;
List<String> stylesheets = new ArrayList<>(EditorPlatform.getStylesheetsForTheme(theme));
stylesheets.addAll(themeStyleSheets);
contentSubScene.setUserAgentStylesheet(stylesheets.getFirst());
themeStylesheets.stream()
.filter(s -> !EditorPlatform.isPlatformThemeStylesheetURL(s))
.forEach(stylesheets::add);
contentSubScene.setUserAgentStylesheet(stylesheets.stream().findFirst().orElse(null));

ObservableList<String> currentStyleSheets = FXCollections.observableArrayList(stylesheets);
themeStylesheets.clear();
themeStylesheets.addAll(currentStyleSheets);
ObservableList<String> currentStylesheets = FXCollections.observableArrayList(stylesheets);
this.themeStylesheets.clear();
this.themeStylesheets.addAll(currentStylesheets);
contentGroupApplyCss();

// Update scenegraph layout, etc
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2016, 2021, Gluon and/or its affiliates.
* Copyright (c) 2016, 2024, Gluon and/or its affiliates.
* All rights reserved. Use is subject to license terms.
*
* This file is available and licensed under the following license:
Expand Down Expand Up @@ -95,19 +95,17 @@ public class LibraryDialogController extends AbstractFxmlWindowController {
private Runnable onAddFolder;
private Consumer<Path> onEditFXML;

private String userM2Repository;
private String tempM2Repository;
private final String userM2Repository;

private final PreferencesControllerBase preferencesControllerBase;

public LibraryDialogController(EditorController editorController, String userM2Repository, String tempM2Repository,
public LibraryDialogController(EditorController editorController, String userM2Repository,
PreferencesControllerBase preferencesController, Stage owner) {
super(LibraryPanelController.class.getResource("LibraryDialog.fxml"), I18N.getBundle(), owner); //NOI18N
this.owner = owner;
this.editorController = editorController;
this.userLibrary = (UserLibrary) editorController.getLibrary();
this.userM2Repository = userM2Repository;
this.tempM2Repository = tempM2Repository;
this.preferencesControllerBase = preferencesController;
}

Expand Down Expand Up @@ -192,7 +190,7 @@ private void close() {
@FXML
private void manage() {
RepositoryManagerController repositoryDialogController = new RepositoryManagerController(editorController,
userM2Repository, tempM2Repository, preferencesControllerBase, getStage());
userM2Repository, preferencesControllerBase, getStage());
repositoryDialogController.openWindow();
}

Expand All @@ -216,7 +214,7 @@ private void addFolder() {
@FXML
private void addRelease() {
SearchMavenDialogController mavenDialogController = new SearchMavenDialogController(editorController,
userM2Repository, tempM2Repository, preferencesControllerBase, getStage());
userM2Repository, preferencesControllerBase, getStage());
mavenDialogController.openWindow();
mavenDialogController.getStage().showingProperty().addListener(new InvalidationListener() {
@Override
Expand All @@ -232,7 +230,7 @@ public void invalidated(Observable observable) {
@FXML
private void addManually() {
MavenDialogController mavenDialogController = new MavenDialogController(editorController, userM2Repository,
tempM2Repository, preferencesControllerBase, getStage());
preferencesControllerBase, getStage());
mavenDialogController.openWindow();
mavenDialogController.getStage().showingProperty().addListener(new InvalidationListener() {
@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2016, 2017 Gluon and/or its affiliates.
* Copyright (c) 2016, 2024, Gluon and/or its affiliates.
* All rights reserved. Use is subject to license terms.
*
* This file is available and licensed under the following license:
Expand Down Expand Up @@ -111,14 +111,14 @@ public class MavenDialogController extends AbstractFxmlWindowController {
private final PreferencesControllerBase preferencesControllerBase;

public MavenDialogController(EditorController editorController, String userM2Repository,
String tempM2Repository, PreferencesControllerBase preferencesControllerBase, Stage owner) {
PreferencesControllerBase preferencesControllerBase, Stage owner) {
super(LibraryPanelController.class.getResource("MavenDialog.fxml"), I18N.getBundle(), owner); //NOI18N
this.userLibrary = (UserLibrary) editorController.getLibrary();
this.owner = owner;
this.editorController = editorController;
this.preferencesControllerBase = preferencesControllerBase;

maven = new MavenRepositorySystem(false, userM2Repository, tempM2Repository,
maven = new MavenRepositorySystem(false, userM2Repository,
preferencesControllerBase.getRepositoryPreferences());

versionsService = new Service<ObservableList<Version>>() {
Expand Down
Loading

0 comments on commit 54e1ee1

Please sign in to comment.