Package com.google.common.css.compiler.ast

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


      if (returnType == null) {
        logger.log(TreeLogger.ERROR, name + ": Return type must be primitive type " +
            "or String for @def accessors");
        return false;
      }
      CssValueNode valueNode = params.get(0);
      if (!(valueNode instanceof CssNumericNode)) {
        logger.log(TreeLogger.ERROR, "The value of the constant defined by @" + name + " is not a" +
            " numeric");
        return false;
      }
View Full Code Here


      if (firstValues.size() != secondValues.size()) {
        return false;
      }

      for (int i = 0; i < firstValues.size(); i++) {
        CssValueNode firstNode = firstValues.get(i);
        CssValueNode secondNode = secondValues.get(i);

        if (!valueEqual(firstNode, secondNode)) {
          return false;
        }
      }
View Full Code Here

  }

  @Override
  public List<CssValueNode> getCallResultNodes(List<CssValueNode> cssValueNodes, ErrorManager errorManager)
          throws GssFunctionException {
    CssValueNode functionToEval = cssValueNodes.get(0);
    String value = functionToEval.getValue();
    SourceCodeLocation location = functionToEval.getSourceCodeLocation();

    String javaExpression = buildJavaExpression(value, location, errorManager);

    CssFunctionNode urlNode = buildUrlNode(javaExpression, location);
View Full Code Here

  }

  private CssDeclarationNode buildHeightDeclaration(String imageResource,
      SourceCodeLocation location) {
    CssPropertyNode propertyNode = new CssPropertyNode("height", location);
    CssValueNode valueNode = new CssDotPathNode(resourceThisPrefix, imageResource + ".getHeight",
        null, "px", location);

    CssPropertyValueNode propertyValueNode = new CssPropertyValueNode(ImmutableList.of(valueNode));

    return createDeclarationNode(propertyNode, propertyValueNode, location, true);
View Full Code Here

    return createDeclarationNode(propertyNode, propertyValueNode, location, true);
  }

  private CssDeclarationNode buildOverflowDeclaration(SourceCodeLocation location) {
    CssPropertyNode propertyNode = new CssPropertyNode("overflow", location);
    CssValueNode valueNode = new CssLiteralNode("hidden", location);

    CssPropertyValueNode propertyValueNode = new CssPropertyValueNode(ImmutableList.of(valueNode));

    return createDeclarationNode(propertyNode, propertyValueNode, location, true);
  }
View Full Code Here

  }

  private CssDeclarationNode buildWidthDeclaration(String imageResource,
      SourceCodeLocation location) {
    CssPropertyNode propertyNode = new CssPropertyNode("width", location);
    CssValueNode valueNode = new CssDotPathNode(resourceThisPrefix, imageResource + ".getWidth",
        null, "px", location);
    CssPropertyValueNode propertyValueNode = new CssPropertyValueNode(ImmutableList.of(valueNode));

    return createDeclarationNode(propertyNode, propertyValueNode, location, true);
  }
View Full Code Here

  }

  @Override
  public List<CssValueNode> getCallResultNodes(List<CssValueNode> args, ErrorManager errorManager)
      throws GssFunctionException {
    CssValueNode functionToEval = args.get(0);

    //TODO check that the value of functionToEval match a certain pattern or exist ?
    CssJavaExpressionNode result = new CssJavaExpressionNode(functionToEval.getValue());

    return ImmutableList.of((CssValueNode) result);
  }
View Full Code Here

    assertTrue(externalClasses.contains("prefix-class1"));
    assertTrue(externalClasses.contains("external"));
  }

  private CssValueNode literalNode(String externalClass) {
    CssValueNode node = mock(CssLiteralNode.class);
    when(node.getValue()).thenReturn(externalClass);
    return node;
  }
View Full Code Here

TOP

Related Classes of com.google.common.css.compiler.ast.CssValueNode

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.