|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.vaadin.sass.internal.tree.Node
com.vaadin.sass.internal.ScssStylesheet
public class ScssStylesheet
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class com.vaadin.sass.internal.tree.Node |
|---|
Node.BuildStringStrategy, Node.PrintStrategy, Node.ToStringStrategy |
| Field Summary |
|---|
| Fields inherited from class com.vaadin.sass.internal.tree.Node |
|---|
PRINT_STRATEGY, TO_STRING_STRATEGY |
| Constructor Summary | |
|---|---|
ScssStylesheet()
Read in a file SCSS and parse it into a ScssStylesheet |
|
| Method Summary | |
|---|---|
void |
addResolver(ScssStylesheetResolver resolver)
Adds the given resolver to the resolver list |
void |
addSourceUris(Collection<String> uris)
|
void |
compile()
Applies all the visitors and compiles SCSS into Css. |
void |
compile(ScssContext.UrlMode urlMode)
Applies all the visitors and compiles SCSS into Css. |
Node |
copy()
Copy a node (deep copy including children). |
static ScssStylesheet |
get(String identifier)
Main entry point for the SASS compiler. |
static ScssStylesheet |
get(String identifier,
ScssStylesheet parentStylesheet)
Main entry point for the SASS compiler. |
static ScssStylesheet |
get(String identifier,
ScssStylesheet parentStylesheet,
SCSSDocumentHandler documentHandler,
SCSSErrorHandler errorHandler)
Main entry point for the SASS compiler. |
String |
getCharset()
|
String |
getDirectory()
Returns the directory containing this style sheet |
String |
getFileName()
Returns the full file name for this style sheet |
String |
getPrefix()
|
List<ScssStylesheetResolver> |
getResolvers()
Retrieves a list of resolvers to use when resolving imports |
List<String> |
getSourceUris()
|
String |
printState()
Prints out the current state of the node tree. |
org.w3c.css.sac.InputSource |
resolveStylesheet(String identifier,
ScssStylesheet parentStylesheet)
|
void |
setCharset(String charset)
|
void |
setFile(File file)
|
void |
setPrefix(String prefix)
|
void |
setResolvers(List<ScssStylesheetResolver> resolvers)
Sets the list of resolvers to use when resolving imports |
String |
toString()
|
Collection<Node> |
traverse(ScssContext context)
Traverses a node and its children recursively, calling all the appropriate handlers via Node#traverse(). |
static void |
warning(String msg)
|
void |
write(Writer writer)
|
void |
write(Writer writer,
boolean minify)
|
| Methods inherited from class com.vaadin.sass.internal.tree.Node |
|---|
appendChild, copyChildren, getChildren, getNormalParentNode, getParentNode, replaceNode, replaceNodeAt, setChildren, traverseChildren, traverseChildren |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public ScssStylesheet()
file -
IOException| Method Detail |
|---|
public static ScssStylesheet get(String identifier)
throws org.w3c.css.sac.CSSException,
IOException
identifier - The file path. If null then null is returned.
org.w3c.css.sac.CSSException
IOException
public static ScssStylesheet get(String identifier,
ScssStylesheet parentStylesheet)
throws org.w3c.css.sac.CSSException,
IOException
identifier - The file path. If null then null is returned.parentStylesheet - Style sheet from which to inherit resolvers and encoding. May
be null.
org.w3c.css.sac.CSSException
IOException
public static ScssStylesheet get(String identifier,
ScssStylesheet parentStylesheet,
SCSSDocumentHandler documentHandler,
SCSSErrorHandler errorHandler)
throws org.w3c.css.sac.CSSException,
IOException
identifier - The file path. If null then null is returned.parentStylesheet - Style sheet from which to inherit resolvers and encoding. May
be null.documentHandler - Instance of document handler. May not be null.errorHandler - Instance of error handler. May not be null.
org.w3c.css.sac.CSSException
IOException
public org.w3c.css.sac.InputSource resolveStylesheet(String identifier,
ScssStylesheet parentStylesheet)
public List<ScssStylesheetResolver> getResolvers()
public void setResolvers(List<ScssStylesheetResolver> resolvers)
resolvers - the resolvers to setpublic void addResolver(ScssStylesheetResolver resolver)
resolver - The resolver to addpublic List<String> getSourceUris()
public void addSourceUris(Collection<String> uris)
public void compile()
throws Exception
Exception
public void compile(ScssContext.UrlMode urlMode)
throws Exception
urlMode - Specifies whether urls appearing in an scss style sheet are
taken to be absolute or relative. It is also possible to use
old Vaadin style urls (ScssContext.UrlMode.MIXED), where urls
are relative only when they appear in simple properties such
as "background-image:url(image.png)".
Absolute url mode means that urls appear in the output css in
the same form as they are in the source scss files. Relative
urls take into account the locations of imported scss files.
For instance, if a style sheets imports foo/bar.scss and
bar.scss contains url(baz.png), it will be output as
url(foo/baz.png) in relative mode and as url(baz.png) in
absolute mode.
Exceptionpublic String printState()
printState in class Nodepublic String toString()
toString in class Objectpublic Collection<Node> traverse(ScssContext context)
Node#traverse().
The node itself may be removed during the traversal and replaced with
other nodes at the same position or later on the child list of its
parent.
traverse in class Nodecontext - current compilation context
public void setFile(File file)
public String getDirectory()
public String getFileName()
public static final void warning(String msg)
public String getCharset()
public void setCharset(String charset)
public String getPrefix()
public void setPrefix(String prefix)
public Node copy()
Node
copy in class Node
public void write(Writer writer)
throws IOException
IOException
public void write(Writer writer,
boolean minify)
throws IOException
IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||