Examples of GssError


Examples of com.google.common.css.compiler.ast.GssError

        booleanExpressionNode.setValue(permutationName + ":" + permutationValue);

        permutationAxesListBuilder.add(permutationName);

      } else {
        GssError warning = new GssError("The expression [" + booleanExpressionNode.getValue() +
            "] cannot be evaluated. It will be considered as false.",
            booleanExpressionNode.getSourceCodeLocation());
        errorManager.reportWarning(warning);
      }
    }
View Full Code Here

Examples of com.google.common.css.compiler.ast.GssError

  @Override
  public boolean enterDefinition(CssDefinitionNode node) {
    if (inConditionalRule()) {
      if (lenient) {
        errorManager.reportWarning(new GssError("You should not define a constant inside a " +
            "ConditionalNode that will be evaluated at runtime. This will be disallowed in " +
            "GWT 3.0", node.getSourceCodeLocation()));
      } else {
        errorManager.report(new GssError("You cannot define a constant inside a ConditionalNode " +
            "that will be evaluated at runtime.", node.getSourceCodeLocation()));
      }
    }
    return false;
  }
View Full Code Here

Examples of com.google.common.css.compiler.ast.GssError

  @Override
  public boolean enterUnknownAtRule(CssUnknownAtRuleNode node) {
    if (inConditionalRule() && "external".equals(node.getName().getValue())) {
      if (lenient) {
        errorManager.reportWarning(new GssError("You should not define a external at-rule inside" +
            " a  ConditionalNode that will be evaluated at runtime. This will be disallowed in " +
            "GWT 3.0", node.getSourceCodeLocation()));
      } else {
        errorManager.report(new GssError("You cannot define a external at-rule inside a " +
            "ConditionalNode that will be evaluated at runtime.", node.getSourceCodeLocation()));
      }
    }
    return super.enterUnknownAtRule(node);
  }
View Full Code Here

Examples of com.google.common.css.compiler.ast.GssError

    try {
      methodType = ResourceGeneratorUtil.getMethodByPath(context.getClientBundleType(),
              pathElements, null).getReturnType();
    } catch (NotFoundException e) {
      String message = e.getMessage();
      errorManager.report(new GssError(message, location));
      throw new GssFunctionException(message, e);
    }

    if (!dataResourceType.isAssignableFrom((JClassType) methodType) &&
            !imageResourceType.isAssignableFrom((JClassType) methodType)) {
      String message = "Invalid method type for url substitution: " + methodType + ". " +
              "Only DataResource and ImageResource are supported.";
      errorManager.report(new GssError(message, location));
      throw new GssFunctionException(message);
    }
  }
View Full Code Here

Examples of com.google.common.css.compiler.ast.GssError

  private void createSprite(CssDeclarationNode declaration) {
    List<CssValueNode> valuesNodes = declaration.getPropertyValue().getChildren();

    if (valuesNodes.size() != 1) {
      errorManager.report(new GssError(SPRITE_PROPERTY_NAME + " must have exactly one value",
          declaration.getSourceCodeLocation()));
    }

    String imageResource = valuesNodes.get(0).getValue();

    JMethod imageMethod;
    try {
      imageMethod = ResourceGeneratorUtil.getMethodByPath(context.getClientBundleType(),
          getPathElement(imageResource), imageResourceType);
    } catch (NotFoundException e) {
      errorManager.report(new GssError("Unable to find ImageResource method "
          + imageResource + " in " + context.getClientBundleType().getQualifiedSourceName() + " : "
          + e.getMessage(), declaration.getSourceCodeLocation()));
      return;
    }

    ImageOptions options = imageMethod.getAnnotation(ImageOptions.class);
    RepeatStyle repeatStyle = options != null ? options.repeatStyle() : RepeatStyle.None;

    Builder<CssDeclarationNode> listBuilder = ImmutableList.builder();
    SourceCodeLocation sourceCodeLocation = declaration.getSourceCodeLocation();

    String repeatText;
    switch (repeatStyle) {
      case None:
        repeatText = " no-repeat";
        listBuilder.add(buildHeightDeclaration(imageResource, sourceCodeLocation));
        listBuilder.add(buildWidthDeclaration(imageResource, sourceCodeLocation));
        break;
      case Horizontal:
        repeatText = " repeat-x";
        listBuilder.add(buildHeightDeclaration(imageResource, sourceCodeLocation));
        break;
      case Vertical:
        repeatText = " repeat-y";
        listBuilder.add(buildWidthDeclaration(imageResource, sourceCodeLocation));
        break;
      case Both:
        repeatText = " repeat";
        break;
      default:
        errorManager.report(new GssError("Unknown repeatStyle " + repeatStyle,
            sourceCodeLocation));
        return;
    }

    listBuilder.add(buildOverflowDeclaration(sourceCodeLocation));
View Full Code Here

Examples of com.google.gwt.thirdparty.common.css.compiler.ast.GssError

  private void createSprite(CssDeclarationNode declaration) {
    List<CssValueNode> valuesNodes = declaration.getPropertyValue().getChildren();

    if (valuesNodes.size() != 1) {
      errorManager.report(new GssError(SPRITE_PROPERTY_NAME + " must have exactly one value",
          declaration.getSourceCodeLocation()));
      return;
    }

    String imageResource = valuesNodes.get(0).getValue();

    JMethod imageMethod;
    try {
      imageMethod = methodByPathHelper.getMethodByPath(context, getPathElement(imageResource),
          imageResourceType);
    } catch (NotFoundException e) {
      errorManager.report(new GssError("Unable to find ImageResource method "
          + imageResource + " in " + context.getClientBundleType().getQualifiedSourceName() + " : "
          + e.getMessage(), declaration.getSourceCodeLocation()));
      return;
    }

    ImageOptions options = imageMethod.getAnnotation(ImageOptions.class);
    RepeatStyle repeatStyle = options != null ? options.repeatStyle() : RepeatStyle.None;

    Builder<CssDeclarationNode> listBuilder = ImmutableList.builder();
    SourceCodeLocation sourceCodeLocation = declaration.getSourceCodeLocation();

    String repeatText;
    switch (repeatStyle) {
      case None:
        repeatText = " no-repeat";
        listBuilder.add(buildHeightDeclaration(imageResource, sourceCodeLocation));
        listBuilder.add(buildWidthDeclaration(imageResource, sourceCodeLocation));
        break;
      case Horizontal:
        repeatText = " repeat-x";
        listBuilder.add(buildHeightDeclaration(imageResource, sourceCodeLocation));
        break;
      case Vertical:
        repeatText = " repeat-y";
        listBuilder.add(buildWidthDeclaration(imageResource, sourceCodeLocation));
        break;
      case Both:
        repeatText = " repeat";
        break;
      default:
        errorManager.report(new GssError("Unknown repeatStyle " + repeatStyle,
            sourceCodeLocation));
        return;
    }

    listBuilder.add(buildOverflowDeclaration(sourceCodeLocation));
View Full Code Here

Examples of com.google.gwt.thirdparty.common.css.compiler.ast.GssError

  @Override
  public boolean enterDefinition(CssDefinitionNode node) {
    if (inConditionalRule()) {
      if (lenient) {
        errorManager.reportWarning(new GssError("You should not define a constant inside a " +
            "ConditionalNode that will be evaluated at runtime. This will be disallowed in " +
            "the next version of GWT.", node.getSourceCodeLocation()));
      } else {
        errorManager.report(new GssError("You cannot define a constant inside a ConditionalNode " +
            "that will be evaluated at runtime.", node.getSourceCodeLocation()));
      }
    }
    return false;
  }
View Full Code Here

Examples of com.google.gwt.thirdparty.common.css.compiler.ast.GssError

  @Override
  public boolean enterUnknownAtRule(CssUnknownAtRuleNode node) {
    if (inConditionalRule() && "external".equals(node.getName().getValue())) {
      if (lenient) {
        errorManager.reportWarning(new GssError("You should not define a external at-rule inside" +
            " a  ConditionalNode that will be evaluated at runtime. This will be disallowed in " +
            "the next version of GWT.", node.getSourceCodeLocation()));
      } else {
        errorManager.report(new GssError("You cannot define a external at-rule inside a " +
            "ConditionalNode that will be evaluated at runtime.", node.getSourceCodeLocation()));
      }
    }
    return super.enterUnknownAtRule(node);
  }
View Full Code Here

Examples of com.google.gwt.thirdparty.common.css.compiler.ast.GssError

    try {
      methodType = methodByPathHelper.getReturnType(context, pathElements);
    } catch (NotFoundException e) {
      String message = e.getMessage() != null ? e.getMessage() : "Invalid path";
      errorManager.report(new GssError(message, location));
      throw new GssFunctionException(message, e);
    }

    if (!dataResourceType.isAssignableFrom((JClassType) methodType) &&
        !imageResourceType.isAssignableFrom((JClassType) methodType)) {
      String message = "Invalid method type for url substitution: " + methodType + ". " +
          "Only DataResource and ImageResource are supported.";
      errorManager.report(new GssError(message, location));
      throw new GssFunctionException(message);
    }
  }
View Full Code Here

Examples of com.google.gwt.thirdparty.common.css.compiler.ast.GssError

          externalClassNames.add(selector);
        }
      } else if (value instanceof CssLiteralNode) {
        externalClassNames.add(value.getValue());
      } else {
        errorManager.report(new GssError("External at-rule invalid. The following terms is not " +
            "accepted in an external at-rule [" + value.getValue() + "]", sourceCodeLocation));
      }
    }
  }
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.