Skip to content

Commit 1e7afa9

Browse files
Merge with v8.0.0-eap
2 parents 37168d7 + e671fac commit 1e7afa9

File tree

92 files changed

+4220
-161
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

92 files changed

+4220
-161
lines changed

.github/workflows/check.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
fetch-depth: 0
1313
- uses: actions/setup-java@v3
1414
with:
15-
distribution: 'corretto'
16-
java-version: '8'
15+
java-version: 17
16+
distribution: oracle
1717
- run: |-
1818
./gradlew build

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ out/
3030
*.tar.gz
3131
*.rar
3232

33+
# Do not ignore a JAR file used by `JarProtocol` example.
34+
!/examples/src/main/resources/tiny-website.jar
35+
3336
# Do not ignore Gradle Wrapper
3437
!/gradle/wrapper/gradle-wrapper.jar
3538

.idea/codeStyles/Project.xml

Lines changed: 8 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/inspectionProfiles/Project_Default.xml

Lines changed: 17 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build.gradle.kts

Lines changed: 32 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -18,20 +18,20 @@
1818
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
1919
*/
2020

21-
buildscript {
22-
repositories {
23-
mavenCentral()
24-
}
25-
}
26-
2721
plugins {
2822
java
23+
kotlin("jvm") version "2.0.0"
2924

30-
// Provides convenience methods for adding JxBrowser dependencies into a project.
25+
// Adds JxBrowser.
3126
id("com.teamdev.jxbrowser") version "1.1.0"
27+
28+
// Adds UI toolkits.
29+
id("org.openjfx.javafxplugin") version "0.1.0"
30+
id("org.jetbrains.compose") version "1.7.0-rc01"
31+
id("org.jetbrains.kotlin.plugin.compose") version "2.0.0"
3232
}
3333

34-
val jxBrowserVersion by extra { "7.41.3" } // The version of JxBrowser used in the examples.
34+
val jxBrowserVersion by extra { "8.0.0" } // The version of JxBrowser used in the examples.
3535
val guavaVersion by extra { "29.0-jre" } // Some of the examples use Guava.
3636

3737
allprojects {
@@ -41,19 +41,31 @@ allprojects {
4141

4242
subprojects {
4343
apply(plugin = "java")
44+
apply(plugin = "org.jetbrains.kotlin.jvm")
4445
apply(plugin = "com.teamdev.jxbrowser")
45-
46-
java.sourceCompatibility = JavaVersion.VERSION_1_8
47-
java.targetCompatibility = JavaVersion.VERSION_1_8
46+
apply(plugin = "org.openjfx.javafxplugin")
47+
apply(plugin = "org.jetbrains.compose")
48+
apply(plugin = "org.jetbrains.kotlin.plugin.compose")
4849

4950
repositories {
5051
mavenCentral()
52+
google()
53+
}
54+
55+
java {
56+
sourceCompatibility = JavaVersion.VERSION_17
57+
targetCompatibility = JavaVersion.VERSION_17
5158
}
5259

5360
jxbrowser {
5461
version = jxBrowserVersion
5562
}
5663

64+
javafx {
65+
version = "17"
66+
modules = listOf("javafx.controls", "javafx.swing", "javafx.fxml")
67+
}
68+
5769
dependencies {
5870
// Cross-platform dependency
5971
implementation(jxbrowser.crossPlatform)
@@ -88,16 +100,23 @@ subprojects {
88100
// JxBrowser for Swing dependency.
89101
implementation(jxbrowser.swing)
90102

103+
// JxBrowser for Compose dependency.
104+
implementation(jxbrowser.compose)
105+
106+
// Dependency on Compose for the current platform.
107+
implementation(compose.desktop.currentOs)
108+
91109
// JxBrowser for SWT dependency.
92110
implementation(jxbrowser.swt)
93111

94-
// Dependency on SWT for the current platform.
112+
// Dependency on an SWT for the current platform.
95113
implementation(Swt.toolkitDependency)
96114

97115
// Depend on Guava for the Resources utility class used for loading resource files into strings.
98116
implementation("com.google.guava:guava:$guavaVersion")
99117

100-
implementation(files("$rootDir/examples/src/main/resources/resource.jar"))
118+
// This file is used by `JarProtocol` example.
119+
runtimeOnly(files(rootDir.resolve("examples/src/main/resources/tiny-website.jar")))
101120
}
102121

103122
tasks.withType<JavaExec> {

buildSrc/src/main/kotlin/Swt.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ object Swt {
5757
* Returns the platform bit of the SWT artifact names.
5858
*/
5959
private fun osgiPlatform(): String {
60-
val os = System.getProperty("os.name").toLowerCase()
60+
val os = System.getProperty("os.name").lowercase()
6161
val arch = System.getProperty("os.arch")
6262
val isArm = "aarch64" == arch || "arm" == arch
6363
return when {

examples/src/main/java/com/teamdev/jxbrowser/examples/DispatchKeyEvents.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public static void main(String[] args) {
5555

5656
SwingUtilities.invokeLater(() -> {
5757
BrowserView view = BrowserView.newInstance(browser);
58-
JFrame frame = new JFrame("Dispatch key event");
58+
JFrame frame = new JFrame("Dispatch key events");
5959
frame.addWindowListener(new WindowAdapter() {
6060
@Override
6161
public void windowClosing(WindowEvent e) {

examples/src/main/java/com/teamdev/jxbrowser/examples/DomForm.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
import javax.swing.WindowConstants;
3636

3737
/**
38-
* This example demonstrates how to fill HTML Form fields using JxBrowser DOM API.
38+
* This example demonstrates how to fill HTML form fields using JxBrowser DOM API.
3939
*/
4040
public final class DomForm {
4141

@@ -63,9 +63,9 @@ public void windowClosing(WindowEvent e) {
6363
browser.navigation().on(FrameLoadFinished.class, event ->
6464
event.frame().document().flatMap(Document::documentElement).ifPresent(element -> {
6565
element.findElementByName("firstName").ifPresent(firstName ->
66-
firstName.putAttribute("value", "John"));
66+
firstName.attributes().put("value", "John"));
6767
element.findElementByName("lastName").ifPresent(lastName ->
68-
lastName.putAttribute("value", "Doe"));
68+
lastName.attributes().put("value", "Doe"));
6969
}));
7070
browser.mainFrame().ifPresent(mainFrame ->
7171
mainFrame.loadHtml("<html><body><form name=\"myForm\">" +

examples/src/main/java/com/teamdev/jxbrowser/examples/DomGetAttributes.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@
2828
import com.teamdev.jxbrowser.frame.Frame;
2929

3030
/**
31-
* This example demonstrates how to get the list of existing attributes of a specified HTML
32-
* element.
31+
* This example demonstrates how to obtain the list of existing attributes of
32+
* a specified HTML element.
3333
*/
3434
public final class DomGetAttributes {
3535

@@ -44,7 +44,7 @@ public static void main(String[] args) {
4444
.flatMap(Document::documentElement)
4545
.flatMap(element -> element.findElementById("link"))
4646
.ifPresent(
47-
linkElement -> linkElement.attributes().forEach(DomGetAttributes::print));
47+
linkElement -> linkElement.attributes().asMap().forEach(DomGetAttributes::print));
4848
}
4949
}
5050

examples/src/main/java/com/teamdev/jxbrowser/examples/DomQuerySelector.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
import javax.swing.WindowConstants;
3636

3737
/**
38-
* This example demonstrates how to use querySelector DOM API.
38+
* This example demonstrates how to use {@code querySelector} DOM API.
3939
*/
4040
public final class DomQuerySelector {
4141

0 commit comments

Comments
 (0)