Package com.google.gdt.eclipse.designer.hosted

Examples of com.google.gdt.eclipse.designer.hosted.HostedModeException


      }
    });
    try {
      m_browser = new Browser(m_shell, SWT.MOZILLA);
    } catch (Throwable e) {
      throw new HostedModeException(HostedModeException.LINUX_BROWSER_ERROR, e);
    }
    try {
      Field webBrowserField = m_browser.getClass().getDeclaredField("webBrowser");
      webBrowserField.setAccessible(true);
      m_webBrowser = webBrowserField.get(m_browser);
      m_isBrowser33 = m_webBrowser.getClass().getName().indexOf("Mozilla") != -1;
      hackOnStateChange();
    } catch (Throwable e) {
      throw new HostedModeException(HostedModeException.LINUX_GENERAL_INIT_ERROR, e);
    }
    String libname = "gwt-ll";
    try {
      System.loadLibrary(libname);
    } catch (Throwable e) {
      throw new HostedModeException(HostedModeException.NATIVE_LIBS_LOADING_ERROR,
        e,
        new String[]{libname});
    }
    m_browser.addProgressListener(new ProgressListener() {
      public void completed(ProgressEvent event) {
View Full Code Here


    // wait for browser to init no more than timeout
    while (!hasWindow() && !m_unsupportedBrowserVersion && System.currentTimeMillis() - startTime < timeout && m_exception[0] == null) {
      messageProcessor.run();
    }
    if (m_unsupportedBrowserVersion) {
      throw new HostedModeException(HostedModeException.LINUX_WRONG_MOZILLA_VER);
    }
    if (m_exception[0] != null) {
      if (m_exception[0] instanceof HostedModeException) {
        throw (HostedModeException) m_exception[0];
      }
      throw new HostedModeException(HostedModeException.MODULE_LOADING_ERROR, m_exception[0]);
    }
    if (!hasWindow()) {
      throw new HostedModeException(HostedModeException.GWT_INIT_TIMEOUT);
    }
  }
View Full Code Here

            "__defineExternal",
            new String[]{"__arg0"},
            "window.__wbp_geckoExternal = __arg0;",
            new long[]{externalJSObject.getJsRootedValue()});
        } catch (Throwable e) {
          throw new HostedModeException(HostedModeException.LINUX_HOSTED_MODE_INIT_ERROR, e);
        }
      }
    });
    Display.getCurrent().asyncExec(new Runnable() {
      public void run() {
        try {
          JsValue returnVal =
              createAndInvoke(
                "__isInitializersReady",
                new String[0],
                "return (window.__wbp_geckoExternal != undefined) && (window.__wbp_geckoExternal.gwtOnLoad != undefined);",
                new long[0]);
          if (!returnVal.isBoolean() || !returnVal.getBoolean()) {
            throw new HostedModeException(HostedModeException.LINUX_HOSTED_MODE_INIT_ERROR);
          }
        } catch (Throwable e) {
          m_exception[0] = e;
        }
      }
View Full Code Here

    // wait for browser to init no more than timeout
    while (m_window == null && System.currentTimeMillis() - startTime < timeout) {
      messageProcessor.run();
    }
    if (m_window == null) {
      throw new HostedModeException(HostedModeException.GWT_INIT_TIMEOUT);
    }
  }
View Full Code Here

      }
    }
    // no shell has been created by factories
    if (isWindows64()) {
      // special message for windows
      throw new HostedModeException(HostedModeException.WIN32_NO_WINDOWS_64);
    }
    throw new HostedModeException(HostedModeException.UNSUPPORTED_OS);
  }
View Full Code Here

        long external = wrapDispatch(new ExternalObject());
        invoke(wso, "__defineExternal", wso, new long[]{external});
        // let the WebKit to be the owner of the object
        objcRelease(external);
      } catch (Throwable e) {
        m_exception[0] = new HostedModeException(HostedModeException.OSX_BROWSER_INIT_ERROR, e);
      }
    }
  }
View Full Code Here

    long startTime = System.currentTimeMillis();
    // wait for load
    while (true) {
      messageProcessor.run();
      if (m_doneLoading && m_code != 0) {
        throw new HostedModeException(HostedModeException.OSX_BROWSER_ERROR, new String[]{
            "" + m_code,
            m_description});
      }
      boolean exit1 = m_windowScriptObject != 0 && m_doneInitializing;
      boolean exit2 = System.currentTimeMillis() - startTime >= timeout;
      if (exit1 || exit2 || m_exception[0] != null) {
        break;
      }
    }
    if (m_windowScriptObject == 0) {
      throw new HostedModeException(HostedModeException.GWT_INIT_TIMEOUT, m_exception[0]);
    }
    if (!m_doneLoading || !m_doneInitializing) {
      if (m_exception[0] != null) {
        if (m_exception[0] instanceof HostedModeException) {
          throw (HostedModeException) m_exception[0];
        }
        throw new HostedModeException(HostedModeException.MODULE_LOADING_ERROR, m_exception[0]);
      } else {
        throw new HostedModeException(HostedModeException.OSX_UNKNOWN_BROWSER_ERROR);
      }
    }
  }
View Full Code Here

          e,
          new String[]{messages});
    }
    // HostedModeException
    if (e instanceof HostedModeException) {
      HostedModeException hme = (HostedModeException) e;
      return new DesignerException(hme.getCode(), e.getCause(), hme.getParameters());
    }
    // NPE in com.google.gwt.dev.javac.CompiledClass.<init>
    if (e instanceof NullPointerException) {
      StackTraceElement element = e.getStackTrace()[0];
      if (element.getClassName().equals("com.google.gwt.dev.javac.CompiledClass")
View Full Code Here

            "__defineExternal",
            new String[]{"__arg0"},
            "window.__wbp_geckoExternal = __arg0;",
            new int /*long*/[]{externalJSObject.getJsRootedValue()});
        } catch (Throwable e) {
          throw new HostedModeException(HostedModeException.LINUX_HOSTED_MODE_INIT_ERROR, e);
        }
      }
    });
    Display.getCurrent().asyncExec(new Runnable() {
      public void run() {
        try {
          JsValue returnVal =
              createAndInvoke(
                "__isInitializersReady",
                new String[0],
                "return (window.__wbp_geckoExternal != undefined) && (window.__wbp_geckoExternal.gwtOnLoad != undefined);",
                new int[0]);
          if (!returnVal.isBoolean() || !returnVal.getBoolean()) {
            throw new HostedModeException(HostedModeException.LINUX_HOSTED_MODE_INIT_ERROR);
          }
        } catch (Throwable e) {
          m_exception[0] = e;
        }
      }
View Full Code Here

            "__defineExternal",
            new String[]{"__arg0"},
            "window.__wbp_geckoExternal = __arg0;",
            new long[]{externalJSObject.getJsRootedValue()});
        } catch (Throwable e) {
          throw new HostedModeException(HostedModeException.LINUX_HOSTED_MODE_INIT_ERROR, e);
        }
      }
    });
    Display.getCurrent().asyncExec(new Runnable() {
      public void run() {
        try {
          JsValue returnVal =
              createAndInvoke(
                "__isInitializersReady",
                new String[0],
                "return (window.__wbp_geckoExternal != undefined) && (window.__wbp_geckoExternal.gwtOnLoad != undefined);",
                new long[0]);
          if (!returnVal.isBoolean() || !returnVal.getBoolean()) {
            throw new HostedModeException(HostedModeException.LINUX_HOSTED_MODE_INIT_ERROR);
          }
        } catch (Throwable e) {
          m_exception[0] = e;
        }
      }
View Full Code Here

TOP

Related Classes of com.google.gdt.eclipse.designer.hosted.HostedModeException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.