public class CSSManager extends Object implements ICSSManager
| Constructor and Description |
|---|
CSSManager(FlexProject flexProject)
Initialize a CSS manager.
|
| Modifier and Type | Method and Description |
|---|---|
ICSSDocument |
getCSS(String cssFilename)
Get a CSS model from the CSS cache.
|
Collection<ICSSDocument> |
getCSSFromStyleModules() |
Collection<ICSSDocument> |
getCSSFromSWCDefaultStyle() |
Collection<ICSSDocument> |
getCSSFromThemes(Collection<ICompilerProblem> problems) |
ICSSDocument |
getDefaultCSS(File swcFile)
Get the model for "defaults.css" in the given SWC file.
|
Collection<ICompilationUnit> |
getDependentCompilationUnitsFromCSS(CSSCompilationSession session,
ICSSDocument cssDocument,
Collection<IDefinition> definitions,
Collection<ICompilerProblem> problems)
Find all the compilation units that the given
definitions depend
on in the given cssDocument. |
boolean |
isFlex3CSS()
In
compatibility-version=3 mode, the CSS selectors will be
emitted "as-is". |
public CSSManager(FlexProject flexProject)
flexProject - Owner project.public Collection<ICSSDocument> getCSSFromStyleModules()
getCSSFromStyleModules in interface ICSSManagerpublic Collection<ICSSDocument> getCSSFromSWCDefaultStyle()
getCSSFromSWCDefaultStyle in interface ICSSManagerpublic ICSSDocument getDefaultCSS(File swcFile)
ICSSManagergetDefaultCSS in interface ICSSManagerswcFile - SWC file.public Collection<ICompilationUnit> getDependentCompilationUnitsFromCSS(CSSCompilationSession session, ICSSDocument cssDocument, Collection<IDefinition> definitions, Collection<ICompilerProblem> problems)
ICSSManagerdefinitions depend
on in the given cssDocument.
For example, given the following CSS and
definition=[A, B, C]
A { x : ClassReference("M"); }
B { x : ClassReference("L"); }
P { x : ClassReference("N"); }
R { x : Embed("logo.jpg"); }
The result is a collection:
[ CompilationUnit(M), CompilationUnit(L), EmbedCompilationUnit(logo.jpg) ]
EmbedCompilationUnit's will be created for each "Embed()"
property and included in this discovery process.getDependentCompilationUnitsFromCSS in interface ICSSManagersession - CSS compilation session data.cssDocument - A CSS document model.definitions - A collection of externally visible definitions.problems - Problems collection.public Collection<ICSSDocument> getCSSFromThemes(Collection<ICompilerProblem> problems)
getCSSFromThemes in interface ICSSManagerproblems - Problems loading and parsing theme styles.public boolean isFlex3CSS()
ICSSManagercompatibility-version=3 mode, the CSS selectors will be
emitted "as-is". They will not be resolved to QNames of the components
definitions.
For example:
Button { font-size:12; }
.foo { font-weight:bold; }
will be compiled as:
object["Button"] = function() {
this.fontSize = 12;
};
object[".foo"] = function() {
this.fontWeight = "bold";
};
isFlex3CSS in interface ICSSManagerpublic ICSSDocument getCSS(String cssFilename)
ICSSManagergetCSS in interface ICSSManagercssFilename - Normalized path of a CSS file.Copyright © 2016 The Apache Software Foundation. All rights reserved.