|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.swing.text.html.StyleSheet.CssParser
Default parser for CSS specifications that get loaded into the StyleSheet.
This class is NOT thread safe, do not ask it to parse while it is in the middle of parsing.
Field Summary | |
(package private) URL |
base
Where the CSS stylesheet lives. |
(package private) MutableAttributeSet |
declaration
|
(package private) boolean |
isLink
True if the attributes are coming from a linked/imported style. |
(package private) CSSParser |
parser
|
(package private) boolean |
parsingDeclaration
True if parsing a declaration, that is the Reader will not contain a selector. |
(package private) String |
propertyName
Name of the current property. |
(package private) Vector |
selectors
|
(package private) Vector |
selectorTokens
|
Constructor Summary | |
(package private) |
StyleSheet.CssParser()
|
Method Summary | |
private void |
addSelector()
|
void |
endRule()
Invoked when the end of a rule is encountered. |
void |
handleImport(String importString)
Invoked when a valid @import is encountered, will call importStyleSheet if a
MalformedURLException is not thrown in creating
the URL. |
void |
handleProperty(String property)
Invoked when a property name is encountered. |
void |
handleSelector(String selector)
A selector has been encountered. |
void |
handleValue(String value)
Invoked when a property value is encountered. |
void |
parse(URL base,
Reader r,
boolean parseDeclaration,
boolean isLink)
Parse the given CSS stream |
AttributeSet |
parseDeclaration(Reader r)
Parses the passed in CSS declaration into an AttributeSet. |
AttributeSet |
parseDeclaration(String string)
Parses the passed in CSS declaration into an AttributeSet. |
void |
startRule()
Invoked when the start of a rule is encountered. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
Vector selectors
Vector selectorTokens
String propertyName
MutableAttributeSet declaration
boolean parsingDeclaration
boolean isLink
URL base
CSSParser parser
Constructor Detail |
StyleSheet.CssParser()
Method Detail |
public AttributeSet parseDeclaration(String string)
public AttributeSet parseDeclaration(Reader r) throws IOException
IOException
public void parse(URL base, Reader r, boolean parseDeclaration, boolean isLink) throws IOException
IOException
public void handleImport(String importString)
importStyleSheet
if a
MalformedURLException
is not thrown in creating
the URL.
handleImport
in interface CSSParser.CSSParserCallback
public void handleSelector(String selector)
handleSelector
in interface CSSParser.CSSParserCallback
public void startRule()
startRule
in interface CSSParser.CSSParserCallback
public void handleProperty(String property)
handleProperty
in interface CSSParser.CSSParserCallback
public void handleValue(String value)
handleValue
in interface CSSParser.CSSParserCallback
public void endRule()
endRule
in interface CSSParser.CSSParserCallback
private void addSelector()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |