Examples of CssCompilerException


Examples of com.google.gwt.resources.css.ast.CssCompilerException

          + "method(s) to the CssResource interface for obfuscated classes, "
          + "or using an @external declaration for unobfuscated classes.");
    }

    if (stop) {
      throw new CssCompilerException("Missing a CSS replacement");
    }
  }
View Full Code Here

Examples of com.google.gwt.resources.css.ast.CssCompilerException

    String functionName = x.getResourceFunction();

    if (functionName == null) {
      logger.log(TreeLogger.ERROR, "The @sprite rule " + x.getSelectors()
          + " must specify the " + CssSprite.IMAGE_PROPERTY_NAME + " property");
      throw new CssCompilerException("No image property specified");
    }

    // Find the image accessor method
    JMethod imageMethod = null;
    JMethod[] allMethods = bundleType.getOverridableMethods();
    for (int i = 0; imageMethod == null && i < allMethods.length; i++) {
      JMethod candidate = allMethods[i];
      // If the function name matches and takes no parameters
      if (candidate.getName().equals(functionName)
          && candidate.getParameters().length == 0) {
        // We have a match
        imageMethod = candidate;
      }
    }

    // Method unable to be located
    if (imageMethod == null) {
      logger.log(TreeLogger.ERROR, "Unable to find ImageResource method "
          + functionName + " in " + bundleType.getQualifiedSourceName());
      throw new CssCompilerException("Cannot find image function");
    }

    JClassType imageResourceType = context.getGeneratorContext().getTypeOracle().findType(
        ImageResource.class.getName());
    assert imageResourceType != null;

    if (!imageResourceType.isAssignableFrom(imageMethod.getReturnType().isClassOrInterface())) {
      logger.log(TreeLogger.ERROR, "The return type of " + functionName
          + " is not assignable to " + imageResourceType.getSimpleSourceName());
      throw new CssCompilerException("Incorrect return type for "
          + CssSprite.IMAGE_PROPERTY_NAME + " method");
    }

    ImageOptions options = imageMethod.getAnnotation(ImageOptions.class);
    RepeatStyle repeatStyle;
View Full Code Here

Examples of com.google.gwt.resources.css.ast.CssCompilerException

      } catch (NoSuchMethodException e) {
        // OK
      }

    } catch (SecurityException e) {
      throw new CssCompilerException(
          "Unable to invoke property handler function for " + name, e);
    } catch (IllegalArgumentException e) {
      throw new CssCompilerException(
          "Unable to invoke property handler function for " + name, e);
    } catch (IllegalAccessException e) {
      throw new CssCompilerException(
          "Unable to invoke property handler function for " + name, e);
    } catch (InvocationTargetException e) {
      throw new CssCompilerException(
          "Unable to invoke property handler function for " + name, e);
    }
  }
View Full Code Here

Examples of com.google.gwt.resources.css.ast.CssCompilerException

          + "method(s) to the CssResource interface for obfuscated classes, "
          + "or using an @external declaration for unobfuscated classes.");
    }

    if (stop) {
      throw new CssCompilerException("Missing a CSS replacement");
    }
  }
View Full Code Here

Examples of com.google.gwt.resources.css.ast.CssCompilerException

    DotPathValue functionName = x.getResourceFunction();

    if (functionName == null) {
      logger.log(TreeLogger.ERROR, "The @sprite rule " + x.getSelectors()
          + " must specify the " + CssSprite.IMAGE_PROPERTY_NAME + " property");
      throw new CssCompilerException("No image property specified");
    }

    JClassType imageResourceType = context.getGeneratorContext().getTypeOracle().findType(
        ImageResource.class.getName());
    assert imageResourceType != null;

    // Find the image accessor method
    JMethod imageMethod;
    try {
      imageMethod = ResourceGeneratorUtil.getMethodByPath(bundleType,
          functionName.getParts(), imageResourceType);
    } catch (NotFoundException e) {
      logger.log(TreeLogger.ERROR, "Unable to find ImageResource method "
          + functionName + " in " + bundleType.getQualifiedSourceName() + " : "
          + e.getMessage());
      throw new CssCompilerException("Cannot find image function");
    }

    ImageOptions options = imageMethod.getAnnotation(ImageOptions.class);
    RepeatStyle repeatStyle;
    if (options != null) {
View Full Code Here

Examples of com.google.gwt.resources.css.ast.CssCompilerException

        try {
          ResourceGeneratorUtil.getMethodByPath(context.getClientBundleType(),
              functionName.getParts(), dataResourceType);
        } catch (NotFoundException e) {
          logger.log(TreeLogger.ERROR, e.getMessage());
          throw new CssCompilerException("Cannot find data method");
        }

        String instance = "((" + DataResource.class.getName() + ")("
            + context.getImplementationSimpleSourceName() + ".this."
            + functionName.getExpression() + "))";
View Full Code Here

Examples of com.google.gwt.resources.css.ast.CssCompilerException

          + "method(s) to the CssResource interface for obfuscated classes, "
          + "or using an @external declaration for unobfuscated classes.");
    }

    if (stop) {
      throw new CssCompilerException("Missing a CSS replacement");
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.