|
||||||||||
| 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 |
|---|
children, parentNode, PRINT_STRATEGY, TO_STRING_STRATEGY |
| Constructor Summary | |
|---|---|
ScssStylesheet()
Read in a file SCSS and parse it into a ScssStylesheet |
|
| Method Summary | |
|---|---|
void |
addChild(int index,
VariableNode node)
|
void |
addResolver(ScssStylesheetResolver resolver)
Adds the given resolver to the resolver list |
static void |
addVariable(VariableNode node)
|
static void |
closeVariableScope(Map<String,VariableNode> originalScope)
End a scope for variables, replacing all active variables with those from the original scope (obtained from openVariableScope()). |
void |
compile()
Applies all the visitors and compiles SCSS into Css. |
static ScssStylesheet |
get()
|
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 |
static FunctionDefNode |
getFunctionDefinition(String name)
|
static HashMap<Node,Node> |
getLastNodeAdded()
|
static MixinDefNode |
getMixinDefinition(String name)
|
List<ScssStylesheetResolver> |
getResolvers()
Retrieves a list of resolvers to use when resolving imports |
static VariableNode |
getVariable(String string)
|
static ArrayList<VariableNode> |
getVariables()
|
static Map<String,VariableNode> |
openVariableScope()
Start a new scope for variables. |
String |
printState()
Prints out the current state of the node tree. |
void |
removeEmptyBlocks(Node node)
|
org.w3c.css.sac.InputSource |
resolveStylesheet(String identifier,
ScssStylesheet parentStylesheet)
|
void |
setCharset(String charset)
|
void |
setFile(File file)
|
void |
setResolvers(List<ScssStylesheetResolver> resolvers)
Sets the list of resolvers to use when resolving imports |
String |
toString()
|
void |
traverse()
Method for manipulating the data contained within the Node. |
boolean |
traverse(Node node)
Traverses a node and its children recursively, calling all the appropriate handlers via Node.traverse(). |
static void |
warning(String msg)
|
| Methods inherited from class com.vaadin.sass.internal.tree.Node |
|---|
appendAll, appendChild, appendChild, appendChildrenAfter, copy, getChildren, getParentNode, hasChildren, removeChild, setChildren |
| 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 add
public void compile()
throws Exception
Exceptionpublic String printState()
printState in class Nodepublic String toString()
toString in class Object
public void addChild(int index,
VariableNode node)
public static ScssStylesheet get()
public void traverse()
NodeNode.
Traversing a node is allowed to modify the node, replace it with one or
more nodes at the same or later position in its parent and modify the
children of the node, but not modify or remove preceding nodes in its
parent.
traverse in class Nodepublic boolean traverse(Node node)
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.
node - node to traverse
public static Map<String,VariableNode> openVariableScope()
closeVariableScope(Map)
call at the end of the scope (unmodifiable map).public static void closeVariableScope(Map<String,VariableNode> originalScope)
openVariableScope()).
originalScope - original scopepublic void removeEmptyBlocks(Node node)
public static void addVariable(VariableNode node)
public static VariableNode getVariable(String string)
public static ArrayList<VariableNode> getVariables()
public static MixinDefNode getMixinDefinition(String name)
public static FunctionDefNode getFunctionDefinition(String name)
public void setFile(File file)
public String getDirectory()
public String getFileName()
public static HashMap<Node,Node> getLastNodeAdded()
public static final void warning(String msg)
public String getCharset()
public void setCharset(String charset)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||