gt22

Untitled

Dec 16th, 2016
289
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 2.29 KB | None | 0 0
  1.         throw new JSException("Unexpected error: This method should not be used unless loaded from plugin.jar");
  2.  
  3. /*
  4.         try
  5.         {
  6.             if (applet != null)
  7.             {
  8.  
  9.                 String obj = (String) applet.getParameter("MAYSCRIPT");
  10.  
  11.                 // Comment out MAYSCRIPT check because Internet Explorer doesn't support
  12.                 // it.
  13. //              if (obj != null && (obj.equals("") || (new Boolean(obj).booleanValue() == true)))
  14.                 {
  15.                     // MAYSCRIPT is enabled
  16.  
  17.                     AppletContext c = applet.getAppletContext();
  18.  
  19.                     // The applet context must implement the sun.plugin.javascript.JSContext
  20.                     // in order for us to get the handle that can be used when evaluating
  21.                     // JavaScript expression.
  22.                     //
  23.                     JSObject ret = null;
  24.  
  25.                     if (c instanceof sun.plugin.javascript.JSContext)
  26.                     {
  27.                         JSContext j = (JSContext) c;
  28.                         ret = j.getJSObject();
  29.                     }
  30.  
  31.                     if (ret != null) {
  32.                         return ret;
  33.                     }
  34.                 }
  35.             } else {
  36.                 // new code for CustomProgress to get the JSObject w/o applet
  37.                 AppContext ac = ToolkitStore.get().getAppContext();
  38.                 if (ac != null) {
  39.                     Plugin2Context context = (Plugin2Context)
  40.                             ac.get(sun.plugin2.applet.Plugin2Manager.APPCONTEXT_PLUGIN2CTX_KEY);
  41.                     if (context != null) {
  42.                         Applet2Host host = context.getHost();
  43.                         if (host != null && host instanceof JSContext) {
  44.                             JSContext jsc = (JSContext) host;
  45.                             JSObject ret = jsc.getOneWayJSObject();
  46.                             if (ret != null) {
  47.                                return ret;
  48.                             }
  49.                         }
  50.                     }
  51.                 }
  52.             }
  53.         }
  54.         catch (Throwable e)
  55.         {
  56.             throw (JSException) new JSException(JSException.EXCEPTION_TYPE_ERROR, e).initCause(e);
  57.         }
  58.  
  59.         throw new JSException();
  60. */
Advertisement
Add Comment
Please, Sign In to add comment