1 16 package com.google.gwt.dev.shell; 17 18 22 public class JavaScriptHost { 23 24 private static ShellJavaScriptHost sHost; 25 26 35 public static void createNative(String file, int line, String jsniSignature, 36 String [] paramNames, String js) { 37 sHost.createNative(file, line, jsniSignature, paramNames, js); 38 } 39 40 public static void exceptionCaught(int number, String name, String description) { 41 sHost.exceptionCaught(number, name, description); 42 } 43 44 47 public static boolean invokeNativeBoolean(String name, Object jthis, 48 Class [] types, Object [] args) throws Throwable { 49 return sHost.invokeNativeBoolean(name, jthis, types, args); 50 } 51 52 55 public static byte invokeNativeByte(String name, Object jthis, Class [] types, 56 Object [] args) throws Throwable { 57 return sHost.invokeNativeByte(name, jthis, types, args); 58 } 59 60 63 public static char invokeNativeChar(String name, Object jthis, Class [] types, 64 Object [] args) throws Throwable { 65 return sHost.invokeNativeChar(name, jthis, types, args); 66 } 67 68 71 public static double invokeNativeDouble(String name, Object jthis, 72 Class [] types, Object [] args) throws Throwable { 73 return sHost.invokeNativeDouble(name, jthis, types, args); 74 } 75 76 79 public static float invokeNativeFloat(String name, Object jthis, 80 Class [] types, Object [] args) throws Throwable { 81 return sHost.invokeNativeFloat(name, jthis, types, args); 82 } 83 84 87 public static Object invokeNativeHandle(String name, Object jthis, 88 Class returnType, Class [] types, Object [] args) throws Throwable { 89 return sHost.invokeNativeHandle(name, jthis, returnType, types, args); 90 } 91 92 95 public static int invokeNativeInt(String name, Object jthis, Class [] types, 96 Object [] args) throws Throwable { 97 return sHost.invokeNativeInt(name, jthis, types, args); 98 } 99 100 103 public static long invokeNativeLong(String name, Object jthis, Class [] types, 104 Object [] args) throws Throwable { 105 return sHost.invokeNativeLong(name, jthis, types, args); 106 } 107 108 111 public static Object invokeNativeObject(String name, Object jthis, 112 Class [] types, Object [] args) throws Throwable { 113 return sHost.invokeNativeObject(name, jthis, types, args); 114 } 115 116 119 public static short invokeNativeShort(String name, Object jthis, 120 Class [] types, Object [] args) throws Throwable { 121 return sHost.invokeNativeShort(name, jthis, types, args); 122 } 123 124 127 public static String invokeNativeString(String name, Object jthis, 128 Class [] types, Object [] args) throws Throwable { 129 return sHost.invokeNativeString(name, jthis, types, args); 130 } 131 132 135 public static void invokeNativeVoid(String name, Object jthis, Class [] types, 136 Object [] args) throws Throwable { 137 sHost.invokeNativeVoid(name, jthis, types, args); 138 } 139 140 143 public static void log(String message, Throwable e) { 144 sHost.log(message, e); 145 } 146 147 150 public static Object rebindAndCreate(Class requestedClass) { 151 String className = requestedClass.getName(); 152 try { 153 return sHost.rebindAndCreate(className); 154 } catch (Throwable e) { 155 String msg = "Deferred binding failed for '" + className 156 + "' (did you forget to inherit a required module?)"; 157 throw new RuntimeException (msg, e); 158 } 159 } 160 161 166 public static void setHost(ShellJavaScriptHost host) { 167 sHost = host; 168 } 169 } 170 | Popular Tags |