1.1 --- a/launcher/fx/src/main/java/org/apidesign/bck2brwsr/launcher/fximpl/Console.java Sun Apr 28 17:42:49 2013 +0200
1.2 +++ b/launcher/fx/src/main/java/org/apidesign/bck2brwsr/launcher/fximpl/Console.java Sun Apr 28 21:17:04 2013 +0200
1.3 @@ -27,7 +27,6 @@
1.4 import java.util.Enumeration;
1.5 import javafx.scene.web.WebEngine;
1.6 import netscape.javascript.JSObject;
1.7 -import org.apidesign.bck2brwsr.core.JavaScriptBody;
1.8
1.9 /**
1.10 *
1.11 @@ -37,24 +36,17 @@
1.12 public Console() {
1.13 }
1.14
1.15 - @JavaScriptBody(args = {"elem", "attr"}, body =
1.16 - "return elem[attr].toString();")
1.17 private static Object getAttr(Object elem, String attr) {
1.18 return InvokeJS.CObject.call("getAttr", elem, attr);
1.19 }
1.20
1.21 - @JavaScriptBody(args = {"id", "attr", "value"}, body =
1.22 - "window.document.getElementById(id)[attr] = value;")
1.23 private static void setAttr(String id, String attr, Object value) {
1.24 InvokeJS.CObject.call("setAttrId", id, attr, value);
1.25 }
1.26 - @JavaScriptBody(args = {"elem", "attr", "value"}, body =
1.27 - "elem[attr] = value;")
1.28 private static void setAttr(Object id, String attr, Object value) {
1.29 InvokeJS.CObject.call("setAttr", id, attr, value);
1.30 }
1.31
1.32 - @JavaScriptBody(args = {}, body = "return; window.close();")
1.33 private static void closeWindow() {}
1.34
1.35 private static Object textArea;
1.36 @@ -113,7 +105,6 @@
1.37 + "arr[0] = pre;\n"
1.38 + "arr[1] = status;\n";
1.39
1.40 - @JavaScriptBody(args = { "test", "c", "arr" }, body = BEGIN_TEST)
1.41 private static void beginTest(String test, Case c, Object[] arr) {
1.42 InvokeJS.CObject.call("beginTest", test, c, arr);
1.43 }
1.44 @@ -130,7 +121,6 @@
1.45 + " } catch (e) { alert(e); }"
1.46 + "};"
1.47 + "request.send();";
1.48 - @JavaScriptBody(args = { "url", "callback", "arr" }, body = LOAD_TEXT)
1.49 private static void loadText(String url, Runnable callback, String[] arr) throws IOException {
1.50 InvokeJS.CObject.call("loadText", url, new Run(callback), arr);
1.51 }
1.52 @@ -257,12 +247,9 @@
1.53 }
1.54 }
1.55
1.56 - @JavaScriptBody(args = {}, body = "vm.desiredAssertionStatus = true;")
1.57 private static void turnAssetionStatusOn() {
1.58 }
1.59
1.60 - @JavaScriptBody(args = {"r", "time"}, body =
1.61 - "return window.setTimeout(function() { r.run__V(); }, time);")
1.62 private static Object schedule(Runnable r, int time) {
1.63 return InvokeJS.CObject.call("schedule", new Run(r), time);
1.64 }
1.65 @@ -362,16 +349,10 @@
1.66 return res;
1.67 }
1.68
1.69 - @JavaScriptBody(args = "s", body = "return eval('(' + s + ')');")
1.70 private static Object toJSON(String s) {
1.71 return InvokeJS.CObject.call("toJSON", s);
1.72 }
1.73
1.74 - @JavaScriptBody(args = {"p", "d"}, body =
1.75 - "var v = d[p];\n"
1.76 - + "if (typeof v === 'undefined') return null;\n"
1.77 - + "return v.toString();"
1.78 - )
1.79 private static Object value(String p, Object d) {
1.80 return ((JSObject)d).getMember(p);
1.81 }
1.82 @@ -388,7 +369,6 @@
1.83 private static final class InvokeJS {
1.84 static final JSObject CObject = initJS();
1.85
1.86 - @JavaScriptBody(args = { }, body = "return null;")
1.87 private static JSObject initJS() {
1.88 WebEngine web = (WebEngine) System.getProperties().get("webEngine");
1.89 return (JSObject) web.executeScript("(function() {"