Swing module's module-info file
Tom Schindl
tom.schindl at bestsolution.at
Wed Aug 8 06:55:17 UTC 2018
Hi Nir,
I currently use the attached stash to make Eclipse compile all modules.
Unfortunately I have to modify the following java-Files to get away
without any compile errors:
* Dialog => Added a method getDialog() instead of directly accessing the
field
* javafx.fxml => Add a static require for controls
* javafx.web => Add a static require for java.management
* MarlinUtils => Small JavaDoc fix because one can not access
sun.security....
Issues 1 - 3 are Eclipse issues. The error in Dialog is known by the
Eclipse people. I'm not sure with the Read-Edges we'd have to add to get
around the module-info.java changes, IMHO the UI in Eclipse in this area
is completely senseless (or I'm too dumb to understand it)
Issue 4: Is something one could discuss if the Marlin maintainers would
be ok to change?
Tom
On 08.08.18 01:27, Nir Lisker wrote:
> Ah, yes, I was trying to see what modifications each project needs so I
> didn't have it modified.
>
> Can you share your Swing .classpath? Eclipse gives me a NPE during the
> build task, I think something broke.
>
> On Tue, Aug 7, 2018 at 8:54 PM, Tom Schindl <tom.schindl at bestsolution.at
> <mailto:tom.schindl at bestsolution.at>> wrote:
>
> Oh but naturally my .classpath-File is modified
>
> Tom
>
> On 07.08.18 19:51, Tom Schindl wrote:
> > Yes they do!
> >
> > Tom
> >
> > On 07.08.18 19:36, Nir Lisker wrote:
> >> And both newimlp and oldimpl packages compile for you?
> >>
> >> On Tue, Aug 7, 2018 at 8:04 PM, Tom Schindl
> <tom.schindl at bestsolution.at <mailto:tom.schindl at bestsolution.at>
> >> <mailto:tom.schindl at bestsolution.at
> <mailto:tom.schindl at bestsolution.at>>> wrote:
> >>
> >> Hi Nir,
> >>
> >> I'm using OpenJDK-11 in my eclipse for development so I have
> that module
> >> included.
> >>
> >> Tom
> >>
> >> On 07.08.18 18:34, Nir Lisker wrote:
> >> > So you rebuilt the JDK with the new jdk.unsupported.desktop
> module?
> >> >
> >> > On Tue, Aug 7, 2018 at 3:11 PM, Tom Schindl
> <tom.schindl at bestsolution.at <mailto:tom.schindl at bestsolution.at>
> <mailto:tom.schindl at bestsolution.at
> <mailto:tom.schindl at bestsolution.at>>
> >> > <mailto:tom.schindl at bestsolution.at
> <mailto:tom.schindl at bestsolution.at>
> <mailto:tom.schindl at bestsolution.at
> <mailto:tom.schindl at bestsolution.at>>>>
> >> wrote:
> >> >
> >> > Well I simply added the folder to my class-folders and
> things then work
> >> > perfectly fine inside Eclipse
> >> >
> >> > Tom
> >> >
> >> > On 07.08.18 14:02, Nir Lisker wrote:
> >> > > Thanks for the info. I'm working on updating the
> Eclipse files and
> >> > this is
> >> > > causing problems for javafx.swing. When will the
> minimum version
> >> > be bumped
> >> > > to 11?
> >> > >
> >> > > On Tue, Aug 7, 2018 at 7:51 AM, Prasanta Sadhukhan <
> >> > > prasanta.sadhukhan at oracle.com
> <mailto:prasanta.sadhukhan at oracle.com>
> <mailto:prasanta.sadhukhan at oracle.com
> <mailto:prasanta.sadhukhan at oracle.com>>
> >> > <mailto:prasanta.sadhukhan at oracle.com
> <mailto:prasanta.sadhukhan at oracle.com>
> >> <mailto:prasanta.sadhukhan at oracle.com
> <mailto:prasanta.sadhukhan at oracle.com>>>> wrote:
> >> > >
> >> > >> This is because if fx is compiled with a jdk version
> which does
> >> > not have
> >> > >> jdk.unsupported.desktop module then having
> module-info.java in
> >> > its original
> >> > >> place would cause compilation error as module-info.java
> >> contains
> >> > >>
> >> > >> requires static jdk.unsupported.desktop;
> >> > >>
> >> > >> So, the idea was to copy the file into a directory
> which is not
> >> > on the
> >> > >> module-source-path. Then build.gradle copy it from
> there to
> >> gensrc
> >> > >> directory optionally filtering the above line
> >> > >> task copyModuleInfo(type: Copy, description: "copy
> module-info
> >> > file to
> >> > >> gensrc") {
> >> > >> from "src/main/module-info/module-info.java"
> >> > >> into "$buildDir/gensrc/java/"
> >> > >> filter { line->
> >> > >> !HAS_UNSUPPORTED_DESKTOP &&
> >> > line.contains('jdk.unsupported.desktop')
> >> > >> ? null : line
> >> > >> }
> >> > >> }
> >> > >>
> >> > >> Regards
> >> > >> Prasanta
> >> > >>
> >> > >> On 8/7/2018 6:42 AM, Nir Lisker wrote:
> >> > >>
> >> > >>> Hi,
> >> > >>>
> >> > >>> I didn't follow all the latest changes to the Swing
> >> module, but
> >> > I notice
> >> > >>> now its module-info.java file is not in the same
> place where
> >> > other modules
> >> > >>> have theirs:
> >> > >>>
> >> > >>> It's under javafx.swing\src\main\module-info instead of
> >> > >>> javafx.<other>\src\main\java.
> >> > >>>
> >> > >>> Is there a reason for this?
> >> > >>>
> >> > >>> - Nir
> >> > >>>
> >> > >>
> >> > >>
> >> >
> >> > --
> >> > Tom Schindl, CTO
> >> > BestSolution.at EDV Systemhaus GmbH
> >> > Eduard-Bodem-Gasse 5-7. A-6020 Innsbruck
> >> > Reg. Nr. FN 222302s am Firmenbuchgericht Innsbruck
> >> >
> >> >
> >>
> >> --
> >> Tom Schindl, CTO
> >> BestSolution.at EDV Systemhaus GmbH
> >> Eduard-Bodem-Gasse 5-7. A-6020 Innsbruck
> >> Reg. Nr. FN 222302s am Firmenbuchgericht Innsbruck
> >>
> >>
> >
>
> --
> Tom Schindl, CTO
> BestSolution.at EDV Systemhaus GmbH
> Eduard-Bodem-Gasse 5-7. A-6020 Innsbruck
> Reg. Nr. FN 222302s am Firmenbuchgericht Innsbruck
>
>
--
Tom Schindl, CTO
BestSolution.at EDV Systemhaus GmbH
Eduard-Bodem-Gasse 5-7. A-6020 Innsbruck
Reg. Nr. FN 222302s am Firmenbuchgericht Innsbruck
-------------- next part --------------
diff --git a/.classpath b/.classpath
index a4ebd5168d..67fed0187f 100644
--- a/.classpath
+++ b/.classpath
@@ -1,11 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
<classpath>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
- <classpathentry kind="src" exported="true" path="/web"/>
- <classpathentry kind="src" exported="true" path="/fxml"/>
- <classpathentry kind="src" exported="true" path="/fxpackager"/>
- <classpathentry kind="src" exported="true" path="/swt"/>
- <classpathentry kind="src" exported="true" path="/swing"/>
- <classpathentry kind="src" exported="true" path="/media"/>
- <classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
- <classpathentry kind="output" path="bin"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER">
+ <attributes>
+ <attribute name="module" value="true"/>
+ </attributes>
+ </classpathentry>
+ <classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
+ <classpathentry kind="output" path="bin"/>
</classpath>
diff --git a/.gitignore b/.gitignore
index 899af1ffed..0874424342 100644
--- a/.gitignore
+++ b/.gitignore
@@ -14,3 +14,5 @@ webrev/
webrev.zip
gradle.properties
apps/samples/Ensemble8/lib/
+**/bin
+**/testbin
diff --git a/buildSrc/.classpath b/buildSrc/.classpath
index d5a88e9dd6..61b3967dd3 100644
--- a/buildSrc/.classpath
+++ b/buildSrc/.classpath
@@ -1,14 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
- <classpathentry kind="src" path="build/generated-src/antlr"/>
- <classpathentry kind="src" path="src/main/java"/>
- <classpathentry kind="src" path="src/test/java"/>
- <classpathentry kind="lib" exported="true" path="../build/libs/ant-1.8.2.jar"/>
- <classpathentry kind="lib" exported="true" path="../build/libs/antlr-3.1.3.jar"/>
- <classpathentry kind="lib" exported="true" path="../build/libs/antlr-runtime-3.1.3.jar"/>
- <classpathentry kind="lib" exported="true" path="../build/libs/stringtemplate-3.2.jar"/>
- <classpathentry kind="lib" exported="true" path="../build/libs/swt-debug.jar"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
- <classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
- <classpathentry kind="output" path="bin"/>
+ <classpathentry kind="src" path="build/generated-src/antlr"/>
+ <classpathentry kind="src" path="src/main/java"/>
+ <classpathentry kind="src" path="src/test/java"/>
+ <classpathentry exported="true" kind="lib" path="../build/libs/swt-debug.jar"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER">
+ <attributes>
+ <attribute name="module" value="true"/>
+ </attributes>
+ </classpathentry>
+ <classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
+ <classpathentry kind="output" path="bin"/>
</classpath>
diff --git a/modules/javafx.base/.classpath b/modules/javafx.base/.classpath
index f93c7fa21b..beafbb5d8c 100644
--- a/modules/javafx.base/.classpath
+++ b/modules/javafx.base/.classpath
@@ -21,7 +21,6 @@
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER">
<attributes>
<attribute name="module" value="true"/>
- <attribute name="limit-modules" value="java.se,jdk.accessibility,jdk.attach,jdk.compiler,jdk.httpserver,jdk.jartool,jdk.javadoc,jdk.jconsole,jdk.jdi,jdk.management,jdk.packager,jdk.sctp,jdk.security.auth,jdk.security.jgss,jdk.unsupported,jdk.dynalink,jdk.incubator.httpclient,jdk.jshell,jdk.jsobject,jdk.net,jdk.packager.services,jdk.scripting.nashorn,jdk.xml.dom"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="bin"/>
diff --git a/modules/javafx.controls/.classpath b/modules/javafx.controls/.classpath
index ac8be57636..a0e058a781 100644
--- a/modules/javafx.controls/.classpath
+++ b/modules/javafx.controls/.classpath
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src/main/java"/>
+ <classpathentry kind="src" path="src/main/resources"/>
<classpathentry kind="src" output="testbin" path="src/shims/java">
<attributes>
<attribute name="test" value="true"/>
@@ -38,8 +39,6 @@
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER">
<attributes>
<attribute name="module" value="true"/>
- <attribute name="add-exports" value="java.base/java.util=javafx.controls"/>
- <attribute name="limit-modules" value="java.se,jdk.accessibility,jdk.attach,jdk.compiler,jdk.httpserver,jdk.jartool,jdk.javadoc,jdk.jconsole,jdk.jdi,jdk.management,jdk.packager,jdk.sctp,jdk.security.auth,jdk.security.jgss,jdk.unsupported,jdk.dynalink,jdk.incubator.httpclient,jdk.jshell,jdk.jsobject,jdk.net,jdk.packager.services,jdk.scripting.nashorn,jdk.xml.dom"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="bin"/>
diff --git a/modules/javafx.controls/src/main/java/javafx/scene/control/Dialog.java b/modules/javafx.controls/src/main/java/javafx/scene/control/Dialog.java
index ed1348353d..d5dd38277f 100644
--- a/modules/javafx.controls/src/main/java/javafx/scene/control/Dialog.java
+++ b/modules/javafx.controls/src/main/java/javafx/scene/control/Dialog.java
@@ -269,6 +269,9 @@ public class Dialog<R> implements EventTarget {
initModality(Modality.APPLICATION_MODAL);
}
+ FXDialog getDialog() {
+ return this.dialog;
+ }
/**************************************************************************
@@ -517,7 +520,7 @@ public class Dialog<R> implements EventTarget {
final boolean isExpanded = content == null ? false : content.isVisible();
setResizable(isExpanded);
- Dialog.this.dialog.sizeToScene();
+ Dialog.this.getDialog().sizeToScene();
};
final InvalidationListener headerListener = o -> {
diff --git a/modules/javafx.fxml/src/main/java/module-info.java b/modules/javafx.fxml/src/main/java/module-info.java
index 955bfe5d9c..f01d7c1827 100644
--- a/modules/javafx.fxml/src/main/java/module-info.java
+++ b/modules/javafx.fxml/src/main/java/module-info.java
@@ -35,6 +35,7 @@ module javafx.fxml {
requires javafx.graphics;
requires transitive javafx.base;
+ requires static javafx.controls;
exports javafx.fxml;
}
diff --git a/modules/javafx.graphics/.classpath b/modules/javafx.graphics/.classpath
index 122a75941e..84041561fe 100644
--- a/modules/javafx.graphics/.classpath
+++ b/modules/javafx.graphics/.classpath
@@ -1,6 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src/main/java"/>
+ <classpathentry kind="src" path="build/gensrc/jsl-prism"/>
+ <classpathentry kind="src" path="build/gensrc/jsl-decora"/>
<classpathentry kind="src" output="testbin" path="src/shims/java">
<attributes>
<attribute name="test" value="true"/>
@@ -37,8 +39,6 @@
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER">
<attributes>
<attribute name="module" value="true"/>
- <attribute name="add-exports" value="java.desktop/sun.font=javafx.graphics:java.base/sun.security.util=javafx.graphics:java.desktop/sun.awt=javafx.graphics:java.xml/com.sun.org.apache.xerces.internal.util=javafx.graphics"/>
- <attribute name="limit-modules" value="java.se,jdk.accessibility,jdk.attach,jdk.compiler,jdk.httpserver,jdk.jartool,jdk.javadoc,jdk.jconsole,jdk.jdi,jdk.management,jdk.packager,jdk.sctp,jdk.security.auth,jdk.security.jgss,jdk.unsupported,jdk.dynalink,jdk.incubator.httpclient,jdk.jshell,jdk.jsobject,jdk.net,jdk.packager.services,jdk.scripting.nashorn,jdk.xml.dom,java.desktop"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="bin"/>
diff --git a/modules/javafx.graphics/src/main/java/com/sun/marlin/MarlinUtils.java b/modules/javafx.graphics/src/main/java/com/sun/marlin/MarlinUtils.java
index 55c775a06f..428c799178 100644
--- a/modules/javafx.graphics/src/main/java/com/sun/marlin/MarlinUtils.java
+++ b/modules/javafx.graphics/src/main/java/com/sun/marlin/MarlinUtils.java
@@ -64,7 +64,7 @@ public final class MarlinUtils {
/**
* Returns a root thread group.
- * Should be called with {@link sun.security.util.SecurityConstants#MODIFY_THREADGROUP_PERMISSION}
+ * Should be called with sun.security.util.SecurityConstants#MODIFY_THREADGROUP_PERMISSION
*
* @return a root {@code ThreadGroup}
*/
diff --git a/modules/javafx.swing/.classpath b/modules/javafx.swing/.classpath
index a195a541a3..640dcd6e8f 100644
--- a/modules/javafx.swing/.classpath
+++ b/modules/javafx.swing/.classpath
@@ -13,26 +13,24 @@
<attribute name="optional" value="true"/>
</attributes>
</classpathentry>
- <classpathentry kind="src" path="/graphics">
- <attributes>
- <attribute name="module" value="true"/>
- </attributes>
- </classpathentry>
+ <classpathentry kind="src" path="src/main/module-info"/>
<classpathentry combineaccessrules="false" kind="src" path="/base">
<attributes>
<attribute name="module" value="true"/>
</attributes>
</classpathentry>
- <classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/5">
+ <classpathentry combineaccessrules="false" kind="src" path="/graphics">
<attributes>
- <attribute name="test" value="true"/>
+ <attribute name="module" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER">
<attributes>
<attribute name="module" value="true"/>
- <attribute name="limit-modules" value="java.se,jdk.accessibility,jdk.attach,jdk.compiler,jdk.httpserver,jdk.jartool,jdk.javadoc,jdk.jconsole,jdk.jdi,jdk.management,jdk.packager,jdk.sctp,jdk.security.auth,jdk.security.jgss,jdk.unsupported,jdk.dynalink,jdk.incubator.httpclient,jdk.jshell,jdk.jsobject,jdk.net,jdk.packager.services,jdk.scripting.nashorn,jdk.xml.dom"/>
+ <attribute name="patch-module" value="java.desktop"/>
+ <attribute name="add-exports" value="java.desktop/java.awt.dnd.peer=javafx.swing:java.desktop/sun.awt=javafx.swing:java.desktop/sun.awt.dnd=javafx.swing:java.desktop/sun.swing=javafx.swing"/>
</attributes>
</classpathentry>
+ <classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/5"/>
<classpathentry kind="output" path="bin"/>
</classpath>
diff --git a/modules/javafx.swt/.classpath b/modules/javafx.swt/.classpath
index 66917eb8a0..7e72e4709f 100644
--- a/modules/javafx.swt/.classpath
+++ b/modules/javafx.swt/.classpath
@@ -11,14 +11,20 @@
<attribute name="optional" value="true"/>
</attributes>
</classpathentry>
- <classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/5"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER">
<attributes>
<attribute name="module" value="true"/>
- <attribute name="add-exports" value="javafx.graphics/com.sun.glass.ui=ALL-UNNAMED:javafx.graphics/com.sun.javafx.embed=ALL-UNNAMED:javafx.graphics/com.sun.javafx.stage=ALL-UNNAMED:javafx.graphics/com.sun.javafx.cursor=ALL-UNNAMED:javafx.graphics/com.sun.javafx.tk=ALL-UNNAMED"/>
</attributes>
</classpathentry>
- <classpathentry kind="src" path="/graphics"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/5"/>
+ <classpathentry kind="var" path="ECLIPSE_HOME/plugins/org.eclipse.swt.cocoa.macosx.x86_64_3.107.0.v20180611-0422.jar"/>
+ <classpathentry kind="src" path="/graphics">
+ <attributes>
+ <attribute name="module" value="true"/>
+ <attribute name="add-exports" value="javafx.graphics/com.sun.glass.ui=ALL-UNNAMED:javafx.graphics/com.sun.javafx.cursor=ALL-UNNAMED:javafx.graphics/com.sun.javafx.embed=ALL-UNNAMED:javafx.graphics/com.sun.javafx.stage=ALL-UNNAMED:javafx.graphics/com.sun.javafx.tk=ALL-UNNAMED"/>
+ </attributes>
+ </classpathentry>
+ <classpathentry combineaccessrules="false" kind="src" path="/controls"/>
<classpathentry combineaccessrules="false" kind="src" path="/base"/>
<classpathentry kind="output" path="bin"/>
</classpath>
diff --git a/modules/javafx.web/.classpath b/modules/javafx.web/.classpath
index 7d718e7812..287d1f0785 100644
--- a/modules/javafx.web/.classpath
+++ b/modules/javafx.web/.classpath
@@ -59,8 +59,6 @@
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER">
<attributes>
<attribute name="module" value="true"/>
- <attribute name="add-exports" value="java.management/java.lang.management=javafx.web"/>
- <attribute name="limit-modules" value="java.se,jdk.accessibility,jdk.attach,jdk.compiler,jdk.httpserver,jdk.jartool,jdk.javadoc,jdk.jconsole,jdk.jdi,jdk.management,jdk.packager,jdk.sctp,jdk.security.auth,jdk.security.jgss,jdk.unsupported,jdk.dynalink,jdk.incubator.httpclient,jdk.jshell,jdk.jsobject,jdk.net,jdk.packager.services,jdk.scripting.nashorn,jdk.xml.dom"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="bin"/>
diff --git a/modules/javafx.web/src/main/java/module-info.java b/modules/javafx.web/src/main/java/module-info.java
index 061972b6e5..9f43173083 100644
--- a/modules/javafx.web/src/main/java/module-info.java
+++ b/modules/javafx.web/src/main/java/module-info.java
@@ -40,6 +40,7 @@ module javafx.web {
requires transitive javafx.base;
requires transitive javafx.controls;
requires transitive javafx.graphics;
+ requires static java.management;
exports javafx.scene.web;
More information about the openjfx-dev
mailing list