Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
fca9228
Merge pull request #41 from BobHanson/master
BobHanson May 15, 2018
fbd83d8
Merge pull request #42 from BobHanson/master
BobHanson May 21, 2018
a653b97
Merge pull request #43 from BobHanson/master
BobHanson May 23, 2018
11c7752
Merge pull request #44 from BobHanson/master
BobHanson May 24, 2018
f11dbad
Merge pull request #45 from BobHanson/yadav1
BobHanson May 24, 2018
a33c72e
Merge pull request #46 from BobHanson/master
BobHanson May 24, 2018
110663d
Merge pull request #47 from BobHanson/yadav1
BobHanson May 29, 2018
dafc2ef
Merge pull request #48 from BobHanson/yadav1
BobHanson Jun 24, 2018
40bae9d
Merge pull request #49 from BobHanson/yadav1
BobHanson Jun 24, 2018
a811459
Merge pull request #50 from BobHanson/yadav1
BobHanson Jun 25, 2018
45d44e6
Merge pull request #51 from BobHanson/yadav1
BobHanson Jul 6, 2018
4c08840
Merge pull request #52 from BobHanson/yadav1
BobHanson Jul 20, 2018
22860e8
// BH 7/21/2018 fix for static{thisApplet.__Info.width=300} not working
Jul 21, 2018
63010aa
ScrollPane scroll bar upgrade
Jul 21, 2018
4bfacfb
fix for static applet info; scrollpane scroll bar upgrade
Jul 21, 2018
394fd1e
fix for static applet info; scrollpane scroll bar upgrade
Jul 21, 2018
7622dc6
Bug: J2S compiler not activated on Linux/macOS (Wrong ".J2S" file name)
abego Jul 22, 2018
f7f45d6
Merge pull request #54 from abego/wrong_dotj2s_literal
BobHanson Jul 22, 2018
50b0e6c
JScrollBar fixes
Jul 22, 2018
788ae01
Merge pull request #55 from BobHanson/yadav1
BobHanson Jul 22, 2018
e88dcf9
Merge branch 'master' into master
BobHanson Jul 22, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,15 @@
import java.util.Map;
import java.util.Properties;

import org.eclipse.core.resources.IContainer;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
import org.eclipse.jdt.core.JavaCore;
import org.eclipse.jdt.core.dom.AST;
import org.eclipse.jdt.core.dom.ASTParser;
import org.eclipse.jdt.core.dom.CompilationUnit;
import org.eclipse.jdt.internal.compiler.env.ICompilationUnit;
import org.eclipse.jdt.internal.core.builder.SourceFile;

import net.sf.j2s.core.CorePlugin;
import net.sf.j2s.core.astvisitors.Java2ScriptVisitor;
//import net.sf.j2s.core.builder.SourceFile;
//import net.sf.j2s.core.builder.SourceFileProxy;
//import net.sf.j2s.core.hotspot.InnerHotspotServer;

/**
* The main (and currently only operational) Java2Script compiler.
Expand All @@ -42,7 +36,11 @@
*/
@SuppressWarnings("restriction")
public class Java2ScriptCompiler {

/**
* The name of the J2S options file, aka as the "Dot-j2s" file.
*/
public static final String J2S_OPTIONS_FILE_NAME = ".j2s";

// BH: added "true".equals(getProperty(props,
// "j2s.compiler.allow.compression")) to ensure compression only occurs when
// desired
Expand Down Expand Up @@ -83,8 +81,8 @@ public class Java2ScriptCompiler {

public static boolean isActive(IProject project) {
try {
return new File(project.getProject().getLocation().toOSString(), ".J2S").exists();
} catch (Exception e) {
return new File(project.getProject().getLocation().toOSString(), J2S_OPTIONS_FILE_NAME).exists();
} catch (@SuppressWarnings("unused") Exception e) {
return false;
}
}
Expand Down Expand Up @@ -141,7 +139,7 @@ public boolean initializeProject(IProject project, boolean isCompilationParticip
projectFolder = project.getLocation().toOSString();
props = new Properties();
try {
File j2sFile = new File(projectFolder, ".j2s");
File j2sFile = new File(projectFolder, J2S_OPTIONS_FILE_NAME);
props.load(new FileInputStream(j2sFile));
String status = getProperty("j2s.compiler.status");
if (!"enable".equals(status) && !"enabled".equals(status)) {
Expand Down
Binary file modified sources/net.sf.j2s.java.core/dist/SwingJS-site.zip
Binary file not shown.
6 changes: 4 additions & 2 deletions sources/net.sf.j2s.java.core/src/swingjs/JSUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ public static String getJavaResource(String resourceName, boolean isJavaPath,
+ (ok ? "" + sdata.length() : sdata) + "]");
return (!ok ? null : !doProcess ? sdata
: path.endsWith(".css") ? JSUtil.processCSS(sdata, path) : path
.endsWith(".js") ? JSUtil.processJS(sdata) : sdata);
.endsWith(".js") ? JSUtil.processJS(sdata, resourceName) : sdata);
}

static void cacheFileData(String path, Object data) {
Expand Down Expand Up @@ -231,11 +231,13 @@ static String processCSS(String css, String path) {
return css;
}

static String processJS(String js) {
static String processJS(String js, String resourceName) {
try {
/**
* @j2sNative
*
*
* if (js.indexOf(";//# sourceURL=") < 0) js += ";//# sourceURL=" + thisApplet._j2sPath + "/" + resourceName;
* eval(js);
*
*/
Expand Down
26 changes: 0 additions & 26 deletions sources/net.sf.j2s.java.core/src/swingjs/jquery/JQueryUI.js

This file was deleted.

Loading