public class CSSRule extends SourceLocation implements ICSSRule
Modifier and Type | Field and Description |
---|---|
protected List<ICSSNode> |
children
A list of children nodes.
|
UNKNOWN
Constructor and Description |
---|
CSSRule(List<CSSMediaQueryCondition> mediaQueries,
List<CSSSelector> selectorGroup,
List<CSSProperty> properties,
org.antlr.runtime.tree.CommonTree tree,
org.antlr.runtime.TokenStream tokenStream) |
Modifier and Type | Method and Description |
---|---|
int |
getArity()
Get the node's child count.
|
com.google.common.collect.ImmutableList<ICSSMediaQueryCondition> |
getMediaQueryConditions()
Get a list of media query conditions associated with this CSS rule.
|
ICSSNode |
getNthChild(int index)
Get the node's nth child.
|
CSSModelTreeType |
getOperator()
Get the node's type.
|
com.google.common.collect.ImmutableList<ICSSProperty> |
getProperties()
Get the CSS properties in their declared order.
|
com.google.common.collect.ImmutableList<ICSSSelector> |
getSelectorGroup()
Get all the subjects in the selector group in their declared order.
|
String |
toString()
Print out a rule in Flex CSS syntax.
|
String |
toStringTree()
Recursively print out the text representation of the tree.
|
getAbsoluteEnd, getAbsoluteStart, getColumn, getEnd, getEndColumn, getEndLine, getLine, getLineColumnString, getOffsetsString, getSourcePath, getSourcePathString, getStart, setColumn, setEnd, setEndColumn, setEndLine, setLine, setSourceLocation, setSourcePath, setStart, span, span
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getArity, getNthChild, getOperator, toStringTree
getAbsoluteEnd, getAbsoluteStart, getColumn, getEnd, getEndColumn, getEndLine, getLine, getSourcePath, getStart
public CSSRule(List<CSSMediaQueryCondition> mediaQueries, List<CSSSelector> selectorGroup, List<CSSProperty> properties, org.antlr.runtime.tree.CommonTree tree, org.antlr.runtime.TokenStream tokenStream)
public com.google.common.collect.ImmutableList<ICSSMediaQueryCondition> getMediaQueryConditions()
ICSSRule
getMediaQueryConditions
in interface ICSSRule
ICSSMediaQueryCondition
objects; Null if the
rule is not enclosed in a media query.public com.google.common.collect.ImmutableList<ICSSSelector> getSelectorGroup()
ICSSRule
A CSS rule can have one or many selectors separated by comma(s). Each selector has a subject.
The element of the right most simple selector in an
ICSSSelector
is the subject of the current selector
object.
Example: selector subject.
Subject for "s|HBox s|Button.round s|Label.dark
" is "Label".
Subject for "s|Panel .noskin
" is "*". (".noskin
" is the
implicit form of "*.noskin
").
The subject selector is the root of the combination of simple selectors in this "chain".
Example: selector combination.
A > B C ~ D E
"E" is the subject. Its linked to "D" as descendant; "D" is linked
to "C" as general sibling; "B" is the child of "A".
Starting from the subject, you can walk up the chain right to left.
Example: CSS rule with selector group.
s|HBox .rounded s|Label.big, s|VBox .rounded s|Label.small { fontWeight:bold; }The return value for the above rule would be list
[s|Label, s|Label]
.getSelectorGroup
in interface ICSSRule
public com.google.common.collect.ImmutableList<ICSSProperty> getProperties()
ICSSRule
getProperties
in interface ICSSRule
public String toString()
toString
in class SourceLocation
public String toStringTree()
toStringTree
in interface ICSSNode
public int getArity()
ICSSNode
DefaultAdapter
.public ICSSNode getNthChild(int index)
ICSSNode
DefaultAdapter
.getNthChild
in interface ICSSNode
index
- Child index.public CSSModelTreeType getOperator()
ICSSNode
DefaultAdapter
.getOperator
in interface ICSSNode
Copyright © 2016 The Apache Software Foundation. All rights reserved.