Package flex2.compiler.css

Examples of flex2.compiler.css.StylesContainer


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

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


    projector = getVirtualFile(path, cfgval);
  }

    public static ConfigurationInfo getProjectorInfo()
    {
        return new ConfigurationInfo()
        {
            public boolean isHidden()
            {
                return true;
            }
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

        {
            CompilationUnit u = (CompilationUnit) units.get(i);

            if (u.isRoot())
            {
                StylesContainer stylesContainer =
                    (StylesContainer) symbolTable.getContext().getAttribute(StylesContainer.class.getName());
                StylesContainer rootStylesContainer = u.getStylesContainer();

                // If the backgroundColor wasn't specified inline, go looking for it in CSS.
                if ((u.swfMetaData == null) || (u.swfMetaData.getValue("backgroundColor") == null))
                {
                    QName qName = u.topLevelDefinitions.last();
                   
                    if (qName != null)
                    {
                        String def = qName.toString();
                        lookupBackgroundColor(stylesContainer, rootStylesContainer, u.styleName,
                                              NameFormatter.toDot(def), symbolTable, configuration);
                    }
                }

                if (rootStylesContainer != null)
                {
                    // Swap in root's Logger, so warnings get associated correctly.
                    Logger originalLogger = ThreadLocalToolkit.getLogger();
                    ThreadLocalToolkit.setLogger(u.getSource().getLogger());
                    rootStylesContainer.validate(symbolTable, nameMappings, u.getStandardDefs(),
                                                 compilerConfiguration.getThemeNames(), null);
                    ThreadLocalToolkit.setLogger(originalLogger);
                }

                Source source = u.getSource();
View Full Code Here

          // We also need styles for an AS file that subclasses Application or Module.
                    if (u.loaderClass != null || u.loaderClassBase != null)
                    {
                        CompilerConfiguration compilerConfig = configuration.getCompilerConfiguration();

                        StylesContainer stylesContainer =
                            (StylesContainer) symbolTable.getContext().getAttribute(StylesContainer.class.getName());

                        if (stylesContainer == null)
                        {
                            stylesContainer = new StylesContainer(compilerConfig, u, symbolTable.perCompileData);
                            stylesContainer.setNameMappings(nameMappings);
                            symbolTable.getContext().setAttribute(StylesContainer.class.getName(), stylesContainer);
                        }

                        // locate style defaults each time through,
                        // because new dependencies could have brought
                        // in new SWC files with a defaults.css file.
                        List<VirtualFile> cssFiles = compilerConfig.getDefaultsCssFiles();
                        Set<String> cssFilesSet = new HashSet<String>();
                       
                        for (VirtualFile cssFile : cssFiles )
                        {
                            cssFilesSet.add(cssFile.getName());
                        }
                       
                        locateStyleDefaults(units, compilerConfig);
                       
                        cssFiles = compilerConfig.getDefaultsCssFiles();
                        Set<String> addedCssFilesSet = null;
                       
                        if (!cssFilesSet.isEmpty())
                        {
                            Set<String> secondCssFilesSet = new HashSet<String>();
                           
                            for (VirtualFile cssFile : cssFiles )
                            {
                                secondCssFilesSet.add(cssFile.getName());
                            }
                           
                            addedCssFilesSet = new HashSet<String>();
                            for (String cssName : secondCssFilesSet )
                            {
                                if (!cssFilesSet.contains(cssName))
                                {
                                    addedCssFilesSet.add(cssName);
                                }
                            }
                        }
                       
                        stylesContainer.loadDefaultStyles();
                        stylesContainer.validate(symbolTable, nameMappings, u.getStandardDefs(), compilerConfig.getThemeNames(), addedCssFilesSet);

                        List<CULinkable> linkables = new LinkedList<CULinkable>();

                        for (Iterator it2 = units.iterator(); it2.hasNext();)
                        {
                            linkables.add( new CULinkable( (CompilationUnit) it2.next() ) );
                        }

                        try
                        {
                            LinkState state = new LinkState(linkables, new HashSet(), configuration.getIncludes(), new HashSet<String>());

                            // C: generate style classes for components which we want to link in.
                            List<Source> styleSources = new ArrayList<Source>();
                            generatedSources = stylesContainer.processDependencies(styleSources, state.getDefNames(), resources,
                                                                    u.getSource().getRelativePath().replace('/', '.'),
                                                                    u.getSource().getShortName());

                            // Sweep through and remove any previous style sources.
                            Iterator<Source> iterator = sources.iterator();
View Full Code Here

        atResources = new TreeMap<String, AtResource>();
        typeRefs = new TreeSet<String>();
       
        designLayers = new HashMap<DesignLayerNode, DesignLayer>();

        stylesContainer = new StylesContainer(mxmlConfiguration, unit, typeTable.getPerCompileData());
        unit.setStylesContainer(stylesContainer);
        showDeprecationWarnings = mxmlConfiguration.showDeprecationWarnings();
        allowDuplicateDefaultStyleDeclarations = mxmlConfiguration.getAllowDuplicateDefaultStyleDeclarations();
       
        stylesContainer.setMxmlDocument(this);
View Full Code Here

        {
            CompilationUnit u = (CompilationUnit) units.get(i);

            if (u.isRoot())
            {
                StylesContainer stylesContainer =
                    (StylesContainer) symbolTable.getContext().getAttribute(StylesContainer.class.getName());
                StylesContainer rootStylesContainer = u.getStylesContainer();

                // If the backgroundColor wasn't specified inline, go looking for it in CSS.
                if ((u.swfMetaData == null) || (u.swfMetaData.getValue("backgroundColor") == null))
                {
                    QName qName = u.topLevelDefinitions.last();
                   
                    if (qName != null)
                    {
                        String def = qName.toString();
                        lookupBackgroundColor(stylesContainer, rootStylesContainer, u.styleName,
                                              NameFormatter.toDot(def), symbolTable, configuration);
                    }
                }

                if (rootStylesContainer != null)
                {
                    // Swap in root's Logger, so warnings get associated correctly.
                    Logger originalLogger = ThreadLocalToolkit.getLogger();
                    ThreadLocalToolkit.setLogger(u.getSource().getLogger());
                    rootStylesContainer.validate(symbolTable, nameMappings, u.getStandardDefs(),
                                                 compilerConfiguration.getThemeNames(), null);
                    ThreadLocalToolkit.setLogger(originalLogger);
                }

                Source source = u.getSource();
View Full Code Here

          // We also need styles for an AS file that subclasses Application or Module.
                    if (u.loaderClass != null || u.loaderClassBase != null)
                    {
                        CompilerConfiguration compilerConfig = configuration.getCompilerConfiguration();

                        StylesContainer stylesContainer =
                            (StylesContainer) symbolTable.getContext().getAttribute(StylesContainer.class.getName());

                        if (stylesContainer == null)
                        {
                            stylesContainer = new StylesContainer(compilerConfig, u, symbolTable.perCompileData);
                            stylesContainer.setNameMappings(nameMappings);
                            symbolTable.getContext().setAttribute(StylesContainer.class.getName(), stylesContainer);
                        }

                        // locate style defaults each time through,
                        // because new dependencies could have brought
                        // in new SWC files with a defaults.css file.
                        List<VirtualFile> cssFiles = compilerConfig.getDefaultsCssFiles();
                        Set<String> cssFilesSet = new HashSet<String>();
                       
                        for (VirtualFile cssFile : cssFiles )
                        {
                            cssFilesSet.add(cssFile.getName());
                        }
                       
                        locateStyleDefaults(units, compilerConfig);
                       
                        cssFiles = compilerConfig.getDefaultsCssFiles();
                        Set<String> addedCssFilesSet = null;
                       
                        if (!cssFilesSet.isEmpty())
                        {
                            Set<String> secondCssFilesSet = new HashSet<String>();
                           
                            for (VirtualFile cssFile : cssFiles )
                            {
                                secondCssFilesSet.add(cssFile.getName());
                            }
                           
                            addedCssFilesSet = new HashSet<String>();
                            for (String cssName : secondCssFilesSet )
                            {
                                if (!cssFilesSet.contains(cssName))
                                {
                                    addedCssFilesSet.add(cssName);
                                }
                            }
                        }
                       
                        stylesContainer.loadDefaultStyles();
                        stylesContainer.validate(symbolTable, nameMappings, u.getStandardDefs(), compilerConfig.getThemeNames(), addedCssFilesSet);

                        List<CULinkable> linkables = new LinkedList<CULinkable>();

                        for (Iterator it2 = units.iterator(); it2.hasNext();)
                        {
                            linkables.add( new CULinkable( (CompilationUnit) it2.next() ) );
                        }

                        try
                        {
                            LinkState state = new LinkState(linkables, new HashSet(), configuration.getIncludes(), new HashSet<String>());

                            // C: generate style classes for components which we want to link in.
                            List<Source> styleSources = new ArrayList<Source>();
                            generatedSources = stylesContainer.processDependencies(styleSources, state.getDefNames(), resources,
                                                                    u.getSource().getRelativePath().replace('/', '.'),
                                                                    u.getSource().getShortName());

                            // Sweep through and remove any previous style sources.
                            Iterator<Source> iterator = sources.iterator();
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

     *
     * @param includeSource A source file.
     */
    public void addComponent(File includeSource)
    {
        sources.add(new LocalFile(includeSource));
    }
View Full Code Here

TOP

Related Classes of flex2.compiler.css.StylesContainer

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.