Package flex2.compiler.css

Examples of flex2.compiler.css.StyleDef


        this.output = Configuration.getOutputPath(val, output);
  }

  public static ConfigurationInfo getOutputInfo()
  {
      return new ConfigurationInfo(1, "filename")
      {
          public boolean isRequired()
          {
              return false;
          }
View Full Code Here


              try
              {
                List l = cfgbuf.peekConfigurationVar(var);
                for (int j = 0, len = l == null ? 0 : l.size(); j < len; j++)
                {
                  ConfigurationValue val = (ConfigurationValue) l.get(j);
                  List valArgs = val.getArgs();
                  for (int k = 0, size = valArgs == null ? 0 : valArgs.size(); k < size; k++)
                  {
                    this.addComponent((String) valArgs.get(k));
                  }
                }
              }
              catch (ConfigurationException ex)
              {
              }
            }
            else if ("include-file".equals(var))
            {
              try
              {
                List l = cfgbuf.peekConfigurationVar(var);
                for (int j = 0, len = l == null ? 0 : l.size(); j < len; j++)
                {
                  ConfigurationValue val = (ConfigurationValue) l.get(j);
                  List valArgs = val.getArgs();
                  this.addArchiveFile((String) valArgs.get(0), new File((String) valArgs.get(1)));
                }
              }
              catch (ConfigurationException ex)
              {
              }
            }
            else if ("include-namespaces".equals(var))
            {
              try
              {
                List l = cfgbuf.peekConfigurationVar(var);
                for (int j = 0, len = l == null ? 0 : l.size(); j < len; j++)
                {
                  ConfigurationValue val = (ConfigurationValue) l.get(j);
                  List valArgs = val.getArgs();
                  for (int k = 0, size = valArgs == null ? 0 : valArgs.size(); k < size; k++)
                  {
                    try
                    {
                      this.addComponent(new URI((String) valArgs.get(k)));
                    }
                    catch (URISyntaxException ex)
                    {
                      ex.printStackTrace();
                    }
                  }
                }
              }
              catch (ConfigurationException ex)
              {
              }
            }
            else if ("include-resource-bundles".equals(var))
            {
              try
              {
                List l = cfgbuf.peekConfigurationVar(var);
                for (int j = 0, len = l == null ? 0 : l.size(); j < len; j++)
                {
                  ConfigurationValue val = (ConfigurationValue) l.get(j);
                  List valArgs = val.getArgs();
                  for (int k = 0, size = valArgs == null ? 0 : valArgs.size(); k < size; k++)
                  {
                    this.addResourceBundle((String) valArgs.get(k));
                  }
                }
              }
              catch (ConfigurationException ex)
              {
              }
            }
            else if ("include-sources".equals(var))
            {
              try
              {
                List l = cfgbuf.peekConfigurationVar(var);
                for (int j = 0, len = l == null ? 0 : l.size(); j < len; j++)
                {
                  ConfigurationValue val = (ConfigurationValue) l.get(j);
                  List valArgs = val.getArgs();
                  for (int k = 0, size = valArgs == null ? 0 : valArgs.size(); k < size; k++)
                  {
                    this.addComponent(new File((String) valArgs.get(k)));
                  }
                }
View Full Code Here

        Iterator<StyleDef> styleDefIterator = mxmlDocument.getStylesContainer().getStyleDefs().iterator();

        while (styleDefIterator.hasNext())
        {
            StyleDef styleDef = styleDefIterator.next();

            if (styleDef.isAdvanced())
            {
                for (StyleDeclaration styleDeclaration : styleDef.getDeclarations().values())
                {
                    StyleSelector selector = styleDeclaration.getSelector();

                    // selector = null;
                    ExpressionStatementNode selectorInitializer = generateNullInitializer(SELECTOR);
                    initFunctionStatementList = nodeFactory.statementList(initFunctionStatementList, selectorInitializer);

                    // conditions = null;
                    ExpressionStatementNode conditionsInitializer = generateNullInitializer(CONDITIONS);
                    initFunctionStatementList = nodeFactory.statementList(initFunctionStatementList, conditionsInitializer);

                    generateSelectorAncestor(selector, initFunctionStatementList);

                    // style = StyleManager.getStyleDeclaration("${selector.toString}");
                    ExpressionStatementNode expressionStatement = generateGetStyleDeclaration(selector.toString());
            initFunctionStatementList = nodeFactory.statementList(initFunctionStatementList, expressionStatement);

                    Node nullStyleDeclarationIfStatement = generateIfNullStyleDeclaration(styleDeclaration.getSubject(), selector);
                    initFunctionStatementList = nodeFactory.statementList(initFunctionStatementList,
                                                                          nullStyleDeclarationIfStatement);

                    if (styleDeclaration.hasProperties())
                    {
                        Node nullStyleFactoryIfStatement =
                            generateIfNullStyleFactory(styleDef, styleDeclaration);
                        initFunctionStatementList = nodeFactory.statementList(initFunctionStatementList,
                                                                              nullStyleFactoryIfStatement);
                    }

                    if (styleDeclaration.hasEffectStyles())
                    {
                        // effects = style.mx_internal::effects;
                        initFunctionStatementList =
                            nodeFactory.statementList(initFunctionStatementList, generateEffectsInitializer());

                        generateIfNullEffectsAndPushes(styleDef, styleDeclaration,
                                                       initFunctionStatementList);
                    }
                }
            }
            else
            {
                ExpressionStatementNode expressionStatement;

                if (styleDef.isTypeSelector())
                {
                    //style = StyleManager.getStyleDeclaration("${styleDef.typeName}");
                    expressionStatement = generateGetStyleDeclaration(styleDef.getSubject());
                }
                else
                {
                    //style = StyleManager.getStyleDeclaration(".${styleDef.typeName}");
                    expressionStatement = generateGetStyleDeclaration("." + styleDef.getSubject());
                }

                initFunctionStatementList = nodeFactory.statementList(initFunctionStatementList, expressionStatement);

            Node nullStyleDeclarationIfStatement = generateIfNullStyleDeclaration(styleDef);
            initFunctionStatementList = nodeFactory.statementList(initFunctionStatementList,
                                                                  nullStyleDeclarationIfStatement);

            if (styleDef.getStyles().size() > 0)
            {
                    Node nullStyleFactoryIfStatement =
                        generateIfNullStyleFactory(styleDef, null);
                initFunctionStatementList = nodeFactory.statementList(initFunctionStatementList,
                                                                      nullStyleFactoryIfStatement);
            }

            if (styleDef.getEffectStyles().size() > 0)
            {
                    initFunctionStatementList =
                        nodeFactory.statementList(initFunctionStatementList, generateEffectsInitializer());

                    generateIfNullEffectsAndPushes(styleDef, null,
View Full Code Here

     * StylesContainer.
     */
    private static int lookupTypeSelectorBackgroundColor(StylesContainer stylesContainer, String className)
    {
        int result = -1;
        StyleDef styleDef = stylesContainer.getStyleDef(className);
                       
        if (styleDef != null)
        {
            Map<String, StyleDeclaration> declarations = styleDef.getDeclarations();

            if (declarations != null)
            {
                for (StyleDeclaration styleDeclaration : declarations.values())
                {
View Full Code Here

     * StylesContainer.
     */
    private static int lookupClassSelectorBackgroundColor(StylesContainer stylesContainer, String styleName)
    {
        int result = -1;
        StyleDef styleDef = stylesContainer.getStyleDef("global");
                       
        if (styleDef != null)
        {
            Map<String, StyleDeclaration> declarations = styleDef.getDeclarations();

            if (declarations != null)
            {
                for (StyleDeclaration styleDeclaration : declarations.values())
                {
View Full Code Here

     * StylesContainer.
     */
    private static String lookupStyleName(StylesContainer stylesContainer, String className)
    {
        String result = null;
        StyleDef styleDef = stylesContainer.getStyleDef(className);
                       
        if (styleDef != null)
        {
            for (StyleDeclaration styleDeclaration : styleDef.getDeclarations().values())
            {
                Collection<StyleDeclarationBlock> blocks = styleDeclaration.getDeclarationBlocks();
                for (StyleDeclarationBlock block : blocks)
                {
                    StyleProperty styleProperty = block.getProperties().get("styleName");
View Full Code Here

     * StylesContainer.
     */
    private static int lookupTypeSelectorBackgroundColor(StylesContainer stylesContainer, String className)
    {
        int result = -1;
        StyleDef styleDef = stylesContainer.getStyleDef(className);
                       
        if (styleDef != null)
        {
            Map<String, StyleDeclaration> declarations = styleDef.getDeclarations();

            if (declarations != null)
            {
                for (StyleDeclaration styleDeclaration : declarations.values())
                {
View Full Code Here

     * StylesContainer.
     */
    private static int lookupClassSelectorBackgroundColor(StylesContainer stylesContainer, String styleName)
    {
        int result = -1;
        StyleDef styleDef = stylesContainer.getStyleDef("global");
                       
        if (styleDef != null)
        {
            Map<String, StyleDeclaration> declarations = styleDef.getDeclarations();

            if (declarations != null)
            {
                for (StyleDeclaration styleDeclaration : declarations.values())
                {
View Full Code Here

     * StylesContainer.
     */
    private static String lookupStyleName(StylesContainer stylesContainer, String className)
    {
        String result = null;
        StyleDef styleDef = stylesContainer.getStyleDef(className);
                       
        if (styleDef != null)
        {
            for (StyleDeclaration styleDeclaration : styleDef.getDeclarations().values())
            {
                Collection<StyleDeclarationBlock> blocks = styleDeclaration.getDeclarationBlocks();
                for (StyleDeclarationBlock block : blocks)
                {
                    StyleProperty styleProperty = block.getProperties().get("styleName");
View Full Code Here

        // it's not in the HashMap. let's locate it in the file system.
        File absolute = FileUtil.openFile(name);
        if (absolute != null && absolute.exists())
        {
            return new LocalFile(absolute);
        }
       
        File relative = FileUtil.openFile(fullName);
        if (relative != null && relative.exists())
        {
            return new LocalFile(relative);
        }
       
        return null;
    }
View Full Code Here

TOP

Related Classes of flex2.compiler.css.StyleDef

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.