Package com.google.gwt.resources.css.ast

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


      addNode(r);
      currentRule = r;
    }

    public void startSelector(SelectorList selectors) throws CSSException {
      CssRule r;

      if (nextSelectorCreatesRule) {
        r = new CssRule();
        addNode(r);
        currentRule = r;
      } else {
        r = (CssRule) currentRule;
        nextSelectorCreatesRule = true;
      }

      for (int i = 0; i < selectors.getLength(); i++) {
        r.getSelectors().add(new CssSelector(valueOf(selectors.item(i))));
      }
    }
View Full Code Here


    }

    String instance = "(" + context.getImplementationSimpleSourceName()
        + ".this." + functionName.getExpression() + ")";

    CssRule replacement = new CssRule();
    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));
View Full Code Here

      addNode(r);
      currentRule = r;
    }

    public void startSelector(SelectorList selectors) throws CSSException {
      CssRule r;

      if (nextSelectorCreatesRule) {
        r = new CssRule();
        addNode(r);
        currentRule = r;
      } else {
        r = (CssRule) currentRule;
        nextSelectorCreatesRule = true;
      }

      for (int i = 0; i < selectors.getLength(); i++) {
        r.getSelectors().add(new CssSelector(valueOf(selectors.item(i))));
      }
    }
View Full Code Here

    assertEquals(0, elseNodes.size());
  }

  public void testVisit_IfElse_CssElseInElseNodes() {
    // given
    CssRule elseRule = new CssRule();
    elseNodes.add(elseRule);

    // when
    elseNodeCreator.visit(cssIf, null);
View Full Code Here

    assertTrue(((CssElse) elseNodes.get(0)).getNodes().contains(elseRule));
  }

  public void testVisit_IfElseWithSeveralRules_CssElseInElseNodesAndContainsAllRules() {
    // given
    CssRule elseRule1 = new CssRule();
    CssRule elseRule2 = new CssRule();
    CssRule elseRule3 = new CssRule();
    elseNodes.add(elseRule1);
    elseNodes.add(elseRule2);
    elseNodes.add(elseRule3);

    // when
View Full Code Here

  }

  public void testVisit_IfElifElse_CssElIfAndCssElseInElseNodes() {
    // given
    CssIf elifNode = mockCssIf(0);
    CssNode elseRule = new CssRule();
    when(elifNode.getElseNodes()).thenReturn(Arrays.<CssNode>asList(elseRule));
    elseNodes.add(elifNode);

    // when
    elseNodeCreator.visit(cssIf, null);
View Full Code Here

  public void testVisit_IfElifElifElse_2CssElIfAnd1CssElseInElseNodes() {
    // given
    CssIf elifNode0 = mockCssIf(0);
    CssIf elifNode1 = mockCssIf(1);
    when(elifNode0.getElseNodes()).thenReturn(Arrays.<CssNode>asList(elifNode1));
    CssNode elseRule = new CssRule();
    when(elifNode1.getElseNodes()).thenReturn(Arrays.<CssNode>asList(elseRule));
    elseNodes.add(elifNode0);

    // when
    elseNodeCreator.visit(cssIf, null);
View Full Code Here

    assertEquals(0, toVerify.getElseNodes().size());
  }

  private CssIf mockCssIf(int id) {
    CssIf elifNode = mock(CssIf.class);
    when(elifNode.getNodes()).thenReturn(Arrays.<CssNode>asList(new CssRule(), new CssRule(),
        new CssRule()));
    when(elifNode.getExpression()).thenReturn("expression" + id);
    when(elifNode.isNegated()).thenReturn(true);
    when(elifNode.getPropertyName()).thenReturn("propertyName" + id);
    when(elifNode.getPropertyValues()).thenReturn(new String[] {"propertyValue" + id});
View Full Code Here

      addNode(r);
      currentRule = r;
    }

    public void startSelector(SelectorList selectors) throws CSSException {
      CssRule r;

      if (nextSelectorCreatesRule) {
        r = new CssRule();
        addNode(r);
        currentRule = r;
      } else {
        r = (CssRule) currentRule;
        nextSelectorCreatesRule = true;
      }

      for (int i = 0; i < selectors.getLength(); i++) {
        r.getSelectors().add(new CssSelector(valueOf(selectors.item(i))));
      }
    }
View Full Code Here

      addNode(r);
      currentRule = r;
    }

    public void startSelector(SelectorList selectors) throws CSSException {
      CssRule r;

      if (nextSelectorCreatesRule) {
        r = new CssRule();
        addNode(r);
        currentRule = r;
      } else {
        r = (CssRule) currentRule;
        nextSelectorCreatesRule = true;
      }

      for (int i = 0; i < selectors.getLength(); i++) {
        r.getSelectors().add(new CssSelector(valueOf(selectors.item(i))));
      }
    }
View Full Code Here

TOP

Related Classes of com.google.gwt.resources.css.ast.CssRule

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.