Package org.apache.flex.compiler.tree.mxml

Examples of org.apache.flex.compiler.tree.mxml.IMXMLStyleNode


  public ICSSDocument getCSSNodeBase(String code) {
        final List<ICompilerProblem> problems = new ArrayList<ICompilerProblem>();

        IMXMLFileNode fileNode = super.getMXMLFileNode(getPrefix() + code + getPostfix());
    IMXMLStyleNode styleNode = (IMXMLStyleNode) findFirstDescendantOfType(fileNode, IMXMLStyleNode.class);
   
    assertNotNull("styleNode", styleNode );   
         
    return styleNode.getCSSDocument(problems);
  }
View Full Code Here


public class MXMLStyleNodeTests extends MXMLNodeBaseTests
{
  private IMXMLStyleNode getMXMLStyleNode(String[] code)
  {
    IMXMLFileNode fileNode = getMXMLFileNode(code);
    IMXMLStyleNode node = (IMXMLStyleNode)findFirstDescendantOfType(fileNode, IMXMLStyleNode.class);
    assertThat("getNodeID", node.getNodeID(), is(ASTNodeID.MXMLStyleID));
    assertThat("getName", node.getName(), is("Style"));
    return node;
  }
View Full Code Here

  {
    String[] code = new String[]
    {
      "<fx:Style/>"
    };
    IMXMLStyleNode node = getMXMLStyleNode(code);
    assertThat("getChildCount", node.getChildCount(), is(0));
   
    ICSSDocument cssDoc = node.getCSSDocument(null);
    assertThat(cssDoc, is(CSSDocumentCache.EMPTY_CSS_DOCUMENT));
  }
View Full Code Here

  {
    String[] code = new String[]
    {
      "<fx:Style></fx:Style>"
    };
    IMXMLStyleNode node = getMXMLStyleNode(code);
    assertThat("getChildCount", node.getChildCount(), is(0));
   
    ICSSDocument cssDoc = node.getCSSDocument(null);
    assertThat(cssDoc, is(CSSDocumentCache.EMPTY_CSS_DOCUMENT));
  }
View Full Code Here

  {
    String[] code = new String[]
    {
      "<fx:Style/> \t\r\n<fx:Style/>"
    };
    IMXMLStyleNode node = getMXMLStyleNode(code);
    assertThat("getChildCount", node.getChildCount(), is(0));
   
    ICSSDocument cssDoc = node.getCSSDocument(null);
    assertThat(cssDoc, is(CSSDocumentCache.EMPTY_CSS_DOCUMENT));
  }
View Full Code Here

      "<fx:Style>",
      "    Button { font-size: 20; color: red }",
      "    CheckBox { font-size: 16 }",
      "</fx:Style>"
    };
    IMXMLStyleNode node = getMXMLStyleNode(code);
    assertThat("getChildCount", node.getChildCount(), is(0));
    ICSSDocument css = node.getCSSDocument(null);
    ImmutableList<ICSSRule> rules = css.getRules();
    assertThat("rules", rules.size(), is(2));
    assertThat("rule 0 name", rules.get(0).getSelectorGroup().get(0).getElementName(), is("Button"));
    assertThat("rule 1 name", rules.get(1).getSelectorGroup().get(0).getElementName(), is("CheckBox"));
  }
View Full Code Here

      "<fx:Style>",
      "    @namespace \"library://ns.adobe.com/flex/mx\";",
      "    @namespace \"library://ns.adobe.com/flex/mx\";",
      "</fx:Style>"
    };
    IMXMLStyleNode node = getMXMLStyleNode(code);
    assertThat("getChildCount", node.getChildCount(), is(0));
    ICSSDocument css = node.getCSSDocument(null);
    ImmutableList<ICSSNamespaceDefinition> namespaces = css.getAtNamespaces();
    assertThat("namespaces", namespaces.size(), is(2));
    assertThat("namespace 0 prefix ", namespaces.get(0).getPrefix(), is((String)null));
    assertThat("namespace 0 uri", namespaces.get(0).getURI(), is("library://ns.adobe.com/flex/mx"));
    assertThat("namespace 1 prefix", namespaces.get(1).getPrefix(), is((String)null));
View Full Code Here

TOP

Related Classes of org.apache.flex.compiler.tree.mxml.IMXMLStyleNode

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.