// 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();