Package com.google.gwt.resources.gss.ast

Examples of com.google.gwt.resources.gss.ast.CssDotPathNode


  private CssDeclarationNode buildBackgroundDeclaration(String imageResource, String repeatText,
      SourceCodeLocation location) {
    // build the url function
    CssFunctionNode urlFunction = new CssFunctionNode(Function.byName("url"), location);
    CssDotPathNode imageUrl = new CssDotPathNode(resourceThisPrefix, imageResource + ".getSafeUri" +
        ".asString", null, null, location);
    CssFunctionArgumentsNode urlFunctionArguments = new CssFunctionArgumentsNode();
    urlFunctionArguments.addChildToBack(imageUrl);
    urlFunction.setArguments(urlFunctionArguments);

    // build left offset
    CssDotPathNode left = new CssDotPathNode(resourceThisPrefix, imageResource + ".getLeft", "-",
        "px", location);

    // build top offset
    CssDotPathNode top = new CssDotPathNode(resourceThisPrefix, imageResource + ".getTop",
        "-", "px", location);

    // build repeat
    CssLiteralNode repeat = new CssLiteralNode(repeatText, 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

  }

  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

    return strings.get(0);
  }

  private String buildJavaExpression(String value, SourceCodeLocation location,
      ErrorManager errorManager) throws GssFunctionException {
    CssDotPathNode dotPathValue = new CssDotPathNode(value, "", "", location);

    assertMethodIsValidResource(location, dotPathValue.getPathElements(), errorManager);

    return context.getImplementationSimpleSourceName() + ".this."
        + dotPathValue.getValue() + ".getSafeUri().asString()";
  }
View Full Code Here

    if (args.size() > 2) {
      prefix = args.get(2).getValue();
    }

    CssDotPathNode cssDotPathNode = new CssDotPathNode(functionPath, prefix, suffix,
        args.get(0).getSourceCodeLocation());

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

  private void assertResultIsValid(List<CssValueNode> result, String expectedJavaExpression) {
    assertEquals(1, result.size());
    assertTrue(result.get(0) instanceof CssDotPathNode);

    CssDotPathNode cssDotPathNode = (CssDotPathNode) result.get(0);

    assertEquals(expectedJavaExpression, cssDotPathNode.getValue());
  }
View Full Code Here

    if (args.size() > 2) {
      prefix = args.get(2).getValue();
    }

    CssDotPathNode cssDotPathNode = new CssDotPathNode(functionPath, prefix, suffix, args.get(0).getSourceCodeLocation());

    // TODO add validation : maybe add a compilation pass that will validate the the method exist
    // on the resource bundle

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

    return strings.get(0);
  }

  private String buildJavaExpression(String value, SourceCodeLocation location,
                                     ErrorManager errorManager) throws GssFunctionException {
    CssDotPathNode dotPathValue = new CssDotPathNode(value, "", "", location);

    assertMethodIsValidResource(location, dotPathValue.getPathElements(), errorManager);

    return context.getImplementationSimpleSourceName() + ".this."
            + dotPathValue.getValue() + ".getSafeUri().asString()";
  }
View Full Code Here

  private CssDeclarationNode buildBackgroundDeclaration(String imageResource, String repeatText,
      SourceCodeLocation location) {
    // build the url function
    CssFunctionNode urlFunction = new CssFunctionNode(Function.byName("url"), location);
    CssDotPathNode imageUrl = new CssDotPathNode(resourceThisPrefix, imageResource + ".getSafeUri" +
        ".asString", null, null, location);
    CssFunctionArgumentsNode urlFunctionArguments = new CssFunctionArgumentsNode();
    urlFunctionArguments.addChildToBack(imageUrl);
    urlFunction.setArguments(urlFunctionArguments);

    // build left offset
    CssDotPathNode left = new CssDotPathNode(resourceThisPrefix, imageResource + ".getLeft", "-",
        "px", location);

    // build top offset
    CssDotPathNode top = new CssDotPathNode(resourceThisPrefix, imageResource + ".getTop",
        "-", "px", location);

    // build repeat
    CssLiteralNode repeat = new CssLiteralNode(repeatText, 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

TOP

Related Classes of com.google.gwt.resources.gss.ast.CssDotPathNode

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.