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 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

   */
  private ClassLoader getDevClassLoader0() throws Exception {
    // prepare gwt-dev.jar location
    String devLibLocation = Utils.getDevLibLocation(moduleDescription);
    if (devLibLocation == null) {
      throw new HostedModeException(HostedModeException.NO_DEV_LIB);
    }
    String gwtLocation = FilenameUtils.getFullPath(devLibLocation);
    // add 'dev' & 'dev-designtime'
    ClassLoader devClassLoader = devClassLoaders.get(gwtLocation);
    if (devClassLoader == null) {
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

  public void wait(int timeout, Runnable messageProcessor) {
    long startTime = System.currentTimeMillis();
    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_scriptObject != null && m_doneLoading;
      boolean exit2 = System.currentTimeMillis() - startTime >= timeout;
      if (exit1 || exit2 || m_exception != null) {
        break;
      }
    }
    if (m_scriptObject == null && m_exception == null) {
      throw new HostedModeException(HostedModeException.GWT_INIT_TIMEOUT);
    }
    if (!m_doneLoading) {
      if (m_exception != null) {
        throw new HostedModeException(HostedModeException.OSX_BROWSER_INIT_ERROR, m_exception);
      } else {
        throw new HostedModeException(HostedModeException.OSX_UNKNOWN_BROWSER_ERROR);
      }
    }
  }
View Full Code Here

      String libname = "wbp-gwt-webkit-bs-carbon";
      try {
        System.loadLibrary(libname);
        _init(WebKitInitializer.class);
      } catch (Throwable e) {
        throw new HostedModeException(HostedModeException.NATIVE_LIBS_LOADING_ERROR,
          e,
          new String[]{libname});
      }
      m_initialized = true;
    }
View Full Code Here

      String libname = "wbp-gwt-webkit-bs-cocoa";
      try {
        System.loadLibrary(libname);
        _init(WebKitInitializer.class);
      } catch (Throwable e) {
        throw new HostedModeException(HostedModeException.NATIVE_LIBS_LOADING_ERROR,
          e,
          new String[]{libname});
      }
      m_initialized = true;
    }
View Full Code Here

      String libname = "wbp-gwt-webkit-bs-carbon";
      try {
        System.loadLibrary(libname);
        _init(WebKitInitializer.class);
      } catch (Throwable e) {
        throw new HostedModeException(HostedModeException.NATIVE_LIBS_LOADING_ERROR,
          e,
          new String[]{libname});
      }
      m_initialized = true;
    }
View Full Code Here

  public void test_HostedModeException() throws Exception {
    int code = 123;
    Exception nested = new Exception();
    String[] parameters = new String[]{"a", "b", "c"};
    Throwable e = new HostedModeException(code, nested, parameters);
    DesignerException result = (DesignerException) GwtExceptionRewriter.INSTANCE.rewrite(e);
    assertEquals(code, result.getCode());
    assertSame(nested, result.getCause());
    assertSame(parameters, result.getParameters());
  }
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.