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

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


  }

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

    SourceCodeLocation sourceCodeLocation = extractSourceCodeLocation(functionToEval);

    CssJavaExpressionNode result = new CssJavaExpressionNode(functionToEval.getValue(),
        sourceCodeLocation);

    return ImmutableList.of((CssValueNode) result);
  }
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

      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

  private List<CssValueNode> createInput(String... argumentValue) {
    Builder<CssValueNode> listBuilder = ImmutableList.builder();

    for (String arg: argumentValue) {
      CssValueNode input = mock(CssValueNode.class);
      when(input.getValue()).thenReturn(arg);

      SourceCodeLocation sourceCodeLocation = mock(SourceCodeLocation.class);
      when(input.getSourceCodeLocation()).thenReturn(sourceCodeLocation);

      listBuilder.add(input);
    }

    return listBuilder.build();
View Full Code Here

    verify(errorManager, never()).report(any(GssError.class));
    verify(errorManager, never()).reportWarning(any(GssError.class));
  }

  private List<CssValueNode> createInput(String value) {
    CssValueNode input = mock(CssValueNode.class);
    when(input.getValue()).thenReturn(value);

    SourceCodeLocation sourceCodeLocation = mock(SourceCodeLocation.class);
    when(input.getSourceCodeLocation()).thenReturn(sourceCodeLocation);

    return ImmutableList.of(input);
  }
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.gwt.thirdparty.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.