Skip to content

Commit 11f7170

Browse files
hansonrhansonr
authored andcommitted
Java 8 Lambda functions implemented
1 parent c475ddc commit 11f7170

File tree

11 files changed

+800
-670
lines changed

11 files changed

+800
-670
lines changed

sources/net.sf.j2s.core/.j2s

Lines changed: 0 additions & 25 deletions
This file was deleted.

sources/net.sf.j2s.core/.settings/org.eclipse.jdt.core.prefs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ org.eclipse.jdt.core.compiler.compliance=1.7
1616
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
1717
org.eclipse.jdt.core.compiler.debug.localVariable=generate
1818
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
19+
org.eclipse.jdt.core.compiler.problem.APILeak=warning
1920
org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
2021
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
2122
org.eclipse.jdt.core.compiler.problem.autoboxing=warning
@@ -39,7 +40,7 @@ org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=disabled
3940
org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
4041
org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning
4142
org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=warning
42-
org.eclipse.jdt.core.compiler.problem.localVariableHiding=warning
43+
org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
4344
org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
4445
org.eclipse.jdt.core.compiler.problem.missingDefaultCase=warning
4546
org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
@@ -77,12 +78,16 @@ org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
7778
org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
7879
org.eclipse.jdt.core.compiler.problem.syntacticNullAnalysisForFields=disabled
7980
org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=warning
81+
org.eclipse.jdt.core.compiler.problem.terminalDeprecation=warning
8082
org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
8183
org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=enabled
8284
org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
8385
org.eclipse.jdt.core.compiler.problem.unclosedCloseable=warning
8486
org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=warning
8587
org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
88+
org.eclipse.jdt.core.compiler.problem.unlikelyCollectionMethodArgumentType=warning
89+
org.eclipse.jdt.core.compiler.problem.unlikelyCollectionMethodArgumentTypeStrict=disabled
90+
org.eclipse.jdt.core.compiler.problem.unlikelyEqualsArgumentType=info
8691
org.eclipse.jdt.core.compiler.problem.unnecessaryElse=warning
8792
org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning
8893
org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore

sources/net.sf.j2s.core/dist/.j2s

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
#j2s configuration file
2+
3+
#enable the Java2Script transpiler -- comment out to disable
4+
j2s.compiler.status=enable
5+
6+
7+
# destination directory for all JavaScript
8+
j2s.site.directory=site
9+
10+
# uncomment j2s.* lines to process:
11+
12+
# a semicolon-separated list of package-level file paths to be excluded
13+
#j2s.excluded.paths=test;testng
14+
15+
# output file name for logging methods declared - delete the file to regenerate a listing
16+
#j2s.log.methods.declared=methodsDeclared.csv
17+
18+
#output file name for logging methods called - delete the file to regenerate a listing
19+
#j2s.log.methods.called=methodsCalled.csv
20+
21+
#if set, every instance of methods called will be logged
22+
#otherwise, only the first call to a method will be logged
23+
#output will be comma-separated: called method,caller class
24+
#j2s.log.all.calls=true
25+
26+
# a semicolon-separated list of packages that contain classes for which the method names
27+
# in their classes should not be "qualified" to indicate their parameter types.
28+
# This option is useful if you have an API interface in Java that refers to JavaScript
29+
# methods such as calling window or jQuery functions or the methods in Clazz or J2S.
30+
# The classes must not have any methods that are overloaded - with the
31+
# same name but different paramater type, as JavaScript will only see the last one.
32+
#j2s.compiler.nonqualified.packages=org.jmol.api.js;jspecview.api.js
33+
34+
# uncomment to add debugging output. Start eclipse with the -consoleLog option to see output.
35+
#j2s.compiler.mode=debug
36+
37+
# a semicolon-separated list of from->to listings of package (foo.) or class (foo.bar)
38+
# replacements to be made. This option allows for having one class or package used in Java
39+
# and another used in JavaScript. Take care with this. All methods in both packages must
40+
# have exactly the same parameter signature. We use it in Jalview to provide a minimal
41+
# JavaScript implementation of a large third-party library while still using that library's
42+
# jar file in Java.
43+
#j2s.class.replacements=org.apache.log4j.->jalview.javascript.log4j.
44+
45+
# uncomment and change if you do not want to use a template.html file that is created for you
46+
# in your project directory. A default template file will be created by the transpiler
47+
# directory if there is none there already.
48+
#j2s.template.html=template.html
49+

sources/net.sf.j2s.core/dist/README.txt

Lines changed: 56 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,37 @@
1-
SwingJS distribution README.txt
1+
SwingJS distribution
22

3-
3/15/2018 Bob Hanson hansonr@stolaf.edu
3+
https://github.com/BobHanson/java2script/blob/master/sources/net.sf.j2s.core/dist/dropins/README.txt
44

5-
SwingJS has been successfully tested in Eclipse Neon and Oxygen on Mac and Windows platforms.
5+
7/15/2018 Bob Hanson hansonr@stolaf.edu
6+
7+
net.sf.j2s.core_3.2.1.jar replaces net.sf.j2s.core_3.1.1.jar
8+
9+
These versions differ only in their internal workings relative to Eclipse.
10+
Most importantly, the requirement that the .project file be changed to
11+
indicate a customized Java builder is dropped in version 3.2.1, which just uses
12+
the standard Eclipse java builder, org.eclipse.jdt.core.javabuilder.
13+
14+
Thus, to get started, all you need are:
15+
16+
1) the latest transpiler from
17+
18+
https://github.com/BobHanson/java2script/blob/master/sources/net.sf.j2s.core/dist/dropins
19+
20+
2) the latest JavaScript-site.zip from
21+
22+
https://github.com/BobHanson/java2script/blob/master/sources/net.sf.j2s.java.core/dist
23+
24+
3) an empty .j2s file in your project directory. (The v.3.2.1 transpiler will fill this in with
25+
a default .j2s configuration when it runs the first time.)
26+
27+
28+
NOTE! If you are updating to 3.2.1 from 3.1.1, be sure to open your .project file and change the
29+
builder name from net.sf.j2s.core.java2scriptbuilder back to org.eclipse.jdt.core.javabuilder
30+
or your project will no longer compile.
31+
32+
Comments below have been adjusted for these differences.
33+
34+
SwingJS has been successfully tested in Eclipse version Neon-Photon on Mac and Windows platforms.
635
(No reason to believe it would not also work for Linux; just haven't tried that recently.)
736

837
INSTALLATION INSTRUCTIONS
@@ -13,8 +42,13 @@ Eclipse Neon or higher is necessary.
1342
Installing the Java2Script transpiler as an Eclipse plug-in
1443
-----------------------------------------------------------
1544

16-
The Java2Script transpiler for SwingJS is in net.sf.j2s.core.jar. It parses the .java code and
17-
creates .js files that match the standard .class files created by the Eclipse Java compiler.
45+
The Java2Script transpiler for SwingJS is net.sf.j2s.core.jar. It rides along with the
46+
Eclipse Java compiler as a "CompilationParticipant"
47+
48+
https://help.eclipse.org/photon/index.jsp?topic=/org.eclipse.jdt.doc.isv/reference/api/org/eclipse/jdt/core/compiler/CompilationParticipant.html
49+
50+
listening for updates to the source files and converting them on the fly to .js files
51+
that match the standard .class files created by the Eclipse Java compiler itself.
1852

1953
Note that both Java .class files (in bin/) and JavaScript .js files (in site/swingjs/j2s) are
2054
created automatically anytime you do any building of your project.
@@ -30,17 +64,29 @@ https://github.com/BobHanson/java2script/blob/master/sources/net.sf.j2s.core/dis
3064

3165
into your eclipse/dropins directory.
3266

33-
Do not use net.sf.j2s.core_x.x.x.jar for this, as, if you do that, some versions of Eclipse will have to be
67+
Also provided in that directory is a ver/ directory with previous core files.
68+
It is recommended that you not use them. If you do, be sure to remove their _x.x.x version
69+
signature from their file name, or some versions of Eclipse will have to be
3470
entirely reinstalled every time you change versions. We do not know why this is necessary,
35-
but it appears to be. If you leave the version in the name, Eclipse will not be able to replace it with a
36-
newer version later. From what we can tell. So just always use dist/dropins/net.sf.j2s.core.jar.
71+
but it appears to be. This is an Eclipse bug. So just always use dist/dropins/net.sf.j2s.core.jar.
3772

38-
On Mac systems, the Eclipse directory is
73+
On Mac systems, the Eclipse directory is generally
3974

4075
/Applications/Eclipse.app/Contents/Eclipse/dropins
4176

4277
2. Restart Eclipse and check for the presence of the plug-in at
4378
help...about Eclipse...installation details...Plug-ins...(wait several seconds for tabulation)
79+
80+
Note relating to updating to 3.2.1 from 3.1.1 version of Java2Script:
81+
82+
If the version on this readout does not match the version that is
83+
reported at the end of each .js file created:
84+
85+
//Created 2018-07-15 04:35:10 net.sf.j2s.core.jar v. 3.2.1
86+
87+
then there is no real problem, but you can correct that by restarting
88+
Eclipse once with the -clean flag.
89+
4490

4591
search for "j2s" to find j2s.sourceforge.net Java2Script Core
4692

@@ -67,7 +113,7 @@ All of the JavaScript produced will be in the project site/ directory.
67113
You must prepopulate this site with all the JavaScript required by the
68114
JavaScript version of the JVM. The most recent version of site/ is at
69115

70-
https://github.com/BobHanson/java2script/blob/master/sources/net.sf.j2s.java.core/SwingJS-site.zip?raw=true
116+
https://github.com/BobHanson/java2script/blob/master/sources/net.sf.j2s.java.core/dist/SwingJS-site.zip?raw=true
71117

72118
Occasional additions to the java.* classes are made to the above-mentioned zip file.
73119

-120 KB
Binary file not shown.

sources/net.sf.j2s.core/dist/net.sf.j2s.core_3.1.1.jar renamed to sources/net.sf.j2s.core/dist/dropins/ver/net.sf.j2s.core_3.1.1.jar

File renamed without changes.
Binary file not shown.

0 commit comments

Comments
 (0)