Examples of CssProperty


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

  private List<CssProperty> createPropertiesWithName(String... names) {
    List<CssProperty> properties = new ArrayList<CssProperty>(names.length);

    for (String name : names) {
      CssProperty property = mock(CssProperty.class);
      when(property.getName()).thenReturn(name);

      properties.add(property);
    }

    return properties;
View Full Code Here

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

    verifyPropertyValueIs(properties.get(0), "UPPERCASE");
  }

  public void testVisit_functionWithUnknownConstant_propertyUpdated() {
    // given
    CssProperty property = mock(CssProperty.class);
    when(property.getName()).thenReturn("name");

    List<Value> arguments = new ArrayList<Value>(5);
    for (int i = 0; i < 5; i++) {
      arguments.add(new IdentValue("ARGUMENT" + i));
    }

    ListValue listValue = new ListValue(arguments);
    FunctionValue function = new FunctionValue("fct", listValue);

    when(property.getValues()).thenReturn(new ListValue(Lists.<Value>newArrayList(function)));

    when(cssRule.getProperties()).thenReturn(Lists.newArrayList(property));

    // when
    UndefinedConstantVisitor undefinedConstantVisitor = new UndefinedConstantVisitor(
View Full Code Here

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

    List<CssProperty> properties = new ArrayList<CssProperty>(names.size());

    for (int i = 0; i < names.size(); i++) {
      String name = names.get(i);
      CssProperty property = mock(CssProperty.class);
      when(property.getName()).thenReturn(name);

      String value = values.get(i);
      IdentValue identValue = new IdentValue(value);

      ListValue listValue = new ListValue(Lists.<Value>newArrayList(identValue));
      when(property.getValues()).thenReturn(listValue);

      properties.add(property);
    }

    return properties;
View Full Code Here

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

          b.append("((" + asIf.getExpression() + ") ? " + expression + " : "
              + elseExpression + ") ");
          numExpressions = concatOp(numExpressions, b);

        } else if (x instanceof CssProperty) {
          CssProperty property = (CssProperty) x;

          validateValue(loopLogger, context.getClientBundleType(),
              property.getValues());

          // (expr) +
          b.append("(" + property.getValues().getExpression() + ") ");
          numExpressions = concatOp(numExpressions, b);

        } else {
          // This indicates that some magic node is slipping by our visitors
          loopLogger.log(TreeLogger.ERROR, "Unhandled substitution "
View Full Code Here

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

      List<Value> values = new ArrayList<Value>();
      if (value != null) {
        extractValueOf(values, value);
      }
      currentRule.getProperties().add(
          new CssProperty(escapeIdent(name), new ListValue(values), important));
    }
View Full Code Here

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

      List<Value> values = new ArrayList<Value>();
      if (value != null) {
        extractValueOf(values, value);
      }
      currentRule.getProperties().add(
          new CssProperty(escapeIdent(name), new ListValue(values), important));
    }
View Full Code Here

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

          b.append("((" + asIf.getExpression() + ") ? " + expression + " : "
              + elseExpression + ") ");
          numExpressions = concatOp(numExpressions, b);

        } else if (x instanceof CssProperty) {
          CssProperty property = (CssProperty) x;

          validateValue(loopLogger, context.getClientBundleType(),
              property.getValues());

          // (expr) +
          b.append("(" + property.getValues().getExpression() + ") ");
          numExpressions = concatOp(numExpressions, b);

        } else {
          // This indicates that some magic node is slipping by our visitors
          loopLogger.log(TreeLogger.ERROR, "Unhandled substitution "
View Full Code Here

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

      List<Value> values = new ArrayList<Value>();
      if (value != null) {
        extractValueOf(values, value);
      }
      currentRule.getProperties().add(
          new CssProperty(escapeIdent(name), new ListValue(values), important));
    }
View Full Code Here

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

    replacement.getSelectors().addAll(x.getSelectors());
    List<CssProperty> properties = replacement.getProperties();

    if (repeatStyle == RepeatStyle.None
        || repeatStyle == RepeatStyle.Horizontal) {
      properties.add(new CssProperty("height", new ExpressionValue(instance
          + ".getHeight() + \"px\""), false));
    }

    if (repeatStyle == RepeatStyle.None || repeatStyle == RepeatStyle.Vertical) {
      properties.add(new CssProperty("width", new ExpressionValue(instance
          + ".getWidth() + \"px\""), false));
    }
    properties.add(new CssProperty("overflow", new IdentValue("hidden"), false));

    String repeatText;
    switch (repeatStyle) {
      case None:
        repeatText = " no-repeat";
        break;
      case Horizontal:
        repeatText = " repeat-x";
        break;
      case Vertical:
        repeatText = " repeat-y";
        break;
      case Both:
        repeatText = " repeat";
        break;
      default:
        throw new RuntimeException("Unknown repeatStyle " + repeatStyle);
    }

    String backgroundExpression = "\"url(\\\"\" + " + instance
        + ".getURL() + \"\\\") -\" + " + instance + ".getLeft() + \"px -\" + "
        + instance + ".getTop() + \"px " + repeatText + "\"";
    properties.add(new CssProperty("background", new ExpressionValue(
        backgroundExpression), false));

    // Retain any user-specified properties
    properties.addAll(x.getProperties());
View Full Code Here

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

          b.append("((" + asIf.getExpression() + ") ? " + expression + " : "
              + elseExpression + ") ");
          numExpressions = concatOp(numExpressions, b);

        } else if (x instanceof CssProperty) {
          CssProperty property = (CssProperty) x;

          validateValue(loopLogger, context.getClientBundleType(),
              property.getValues());

          // (expr) +
          b.append("(" + property.getValues().getExpression() + ") ");
          numExpressions = concatOp(numExpressions, b);

        } else {
          // This indicates that some magic node is slipping by our visitors
          loopLogger.log(TreeLogger.ERROR, "Unhandled substitution "
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.