Package org.eclipse.wb.internal.core.utils.exception

Examples of org.eclipse.wb.internal.core.utils.exception.DesignerException


    if (javaProject.findType("com.gwtext.client.widgets.Component") != null) {
      try {
        Class<?> classComponent = classLoader.loadClass("com.gwtext.client.widgets.Component");
        ReflectionUtils.invokeMethod(classComponent, "checkExtVer()");
      } catch (Throwable e) {
        throw new DesignerException(IExceptionConstants.NOT_CONFIGURED,
            javaProject.getElementName());
      }
    }
  }
View Full Code Here


      ClassLoader classLoader = state.getClassLoader();
      // version
      {
        String description = getWrongVersionDescription(classLoader);
        if (description != null) {
          throw new DesignerException(IExceptionConstants.INCORRECT_VERSION,
              VALID_VERSIONS_STRING,
              description);
        }
      }
      // required resources
      if (!hasRequiredStyles(state)) {
        throw new DesignerException(IExceptionConstants.NO_RESOURCES);
      }
    }
  }
View Full Code Here

    ModuleDescription module = getTestModuleDescription();
    try {
      Utils.getHTMLFile(module);
      fail();
    } catch (Throwable e) {
      DesignerException de = DesignerExceptionUtils.getDesignerException(e);
      assertEquals(IExceptionConstants.INVALID_WEB_XML, de.getCode());
    }
  }
View Full Code Here

    frame.refresh();
    // paste Tree
    try {
      addTreeFromMemento(frame);
    } catch (Throwable e) {
      DesignerException de = DesignerExceptionUtils.getDesignerException(e);
      assertEquals(IExceptionConstants.NO_SUCH_IMAGE_BUNDLE, de.getCode());
    }
  }
View Full Code Here

          "    grid.add(new Button());",
          "  }",
          "}");
      fail();
    } catch (Throwable e) {
      DesignerException de = DesignerExceptionUtils.getDesignerException(e);
      assertEquals(IExceptionConstants.PANEL_ADD_INVOCATION, de.getCode());
      assertTrue(DesignerExceptionUtils.isFatal(e));
      assertTrue(DesignerExceptionUtils.isWarning(e));
      assertThat(de.getSourcePosition()).isPositive();
    }
  }
View Full Code Here

  public GwtState(ClassLoader parentClassLoader, ModuleDescription moduleDescription)
      throws Exception {
    // remember module
    m_moduleDescription = moduleDescription;
    if (m_moduleDescription == null) {
      throw new DesignerException(IExceptionConstants.NO_MODULE_FILE);
    }
    // remember arguments
    m_parentClassLoader = parentClassLoader;
    m_javaProject = JavaCore.create(m_moduleDescription.getProject());
    // remember for access from other classes
View Full Code Here

  private IHostedModeSupport getHostedModeSupport() throws Exception {
    String versionString = m_version.getStringMajorMinor();
    // prepare factories
    List<IHostedModeSupportFactory> supportFactories = getHostedModeSupportFactories();
    if (supportFactories.isEmpty()) {
      throw new DesignerException(IExceptionConstants.NO_GWT_SDK_SUPPORT);
    }
    // ask each factory
    for (IHostedModeSupportFactory supportFactory : supportFactories) {
      IHostedModeSupport hostedModeSupport =
          supportFactory.create(versionString, m_parentClassLoader, m_moduleDescription);
      if (hostedModeSupport != null) {
        return hostedModeSupport;
      }
    }
    throw new DesignerException(IExceptionConstants.UNSUPPORTED_GWT_SDK, versionString);
  }
View Full Code Here

    // special unsupported classes
    {
      ITypeBinding superClass = typeBinding.getSuperclass();
      String superClassName = AstNodeUtils.getFullyQualifiedName(superClass, false);
      if (superClassName.equals("com.google.gwt.user.client.ui.Widget")) {
        throw new DesignerException(IExceptionConstants.NO_DESIGN_WIDGET);
      }
    }
    // prepare class loader
    initializeClassLoader(editor);
    // check for @wbp.parser.entryPoint
View Full Code Here

      }
    }
    // prepare module
    ModuleDescription moduleDescription = Utils.getSingleModule(modelUnit);
    if (moduleDescription == null) {
      throw new DesignerException(IExceptionConstants.NO_MODULE_FILE);
    }
    // always include standard D2 ClassLoader's
    CompositeClassLoader parentClassLoader;
    {
      parentClassLoader = createClassLoader_parent(editor);
View Full Code Here

      e = e.getCause();
    }
    // UnableToCompleteException
    if ("com.google.gwt.core.ext.UnableToCompleteException".equals(e.getClass().getName())) {
      String messages = GwtState.getLoggerErrorMessages();
      return new DesignerException(HostedModeException.MODULE_LOADING_ERROR2,
          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")
          && element.getMethodName().equals("<init>")
          || System.getProperty("wbp.GWT_ExceptionRewriter.simulate.CompiledClass") != null) {
        return new DesignerException(IExceptionConstants.NPE_IN_COMPILED_CLASS, e);
      }
    }
    // IncompatibleClassChangeError for GWT 2.2
    {
      Throwable rootException = DesignerExceptionUtils.getRootCause(e);
      if (rootException instanceof IncompatibleClassChangeError) {
        String message = rootException.getMessage();
        if (message != null && message.contains("com.google.gwt.core.ext.typeinfo.JClassType")) {
          return new DesignerException(IExceptionConstants.BINARY_INCOMPAT_GWT22, e);
        }
      }
    }
    // use as is
    return e;
View Full Code Here

TOP

Related Classes of org.eclipse.wb.internal.core.utils.exception.DesignerException

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.