diff options
author | Andrew John Hughes <gnu_andrew@member.fsf.org> | 2006-11-04 18:55:49 +0000 |
---|---|---|
committer | Andrew John Hughes <gnu_andrew@member.fsf.org> | 2006-11-04 18:55:49 +0000 |
commit | 237bdd93058f891ae4567cf4e051c5831bd4646b (patch) | |
tree | 61bf13ecf1942efef4ef00642e2ff0f4318a9fb7 /javax/swing/text/html/StyleSheet.java | |
parent | e36d2a50b5a1a677c7ecaf926e73a5dac386c1ef (diff) | |
download | classpath-237bdd93058f891ae4567cf4e051c5831bd4646b.tar.gz |
2006-11-04 Andrew John Hughes <gnu_andrew@member.fsf.org>
* Merge of HEAD-->generics-branch for 2006/10/29 to 2006/11/04.
Diffstat (limited to 'javax/swing/text/html/StyleSheet.java')
-rw-r--r-- | javax/swing/text/html/StyleSheet.java | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/javax/swing/text/html/StyleSheet.java b/javax/swing/text/html/StyleSheet.java index 520076652..703a3864a 100644 --- a/javax/swing/text/html/StyleSheet.java +++ b/javax/swing/text/html/StyleSheet.java @@ -38,7 +38,6 @@ exception statement from your version. */ package javax.swing.text.html; -import gnu.classpath.NotImplementedException; import gnu.javax.swing.text.html.css.CSSColor; import gnu.javax.swing.text.html.css.CSSParser; import gnu.javax.swing.text.html.css.CSSParserCallback; @@ -53,6 +52,7 @@ import java.awt.Graphics; import java.io.IOException; import java.io.Reader; import java.io.Serializable; +import java.io.StringReader; import java.net.URL; import java.util.ArrayList; import java.util.Enumeration; @@ -94,8 +94,10 @@ public class StyleSheet extends StyleContext /** * Parses CSS stylesheets using the parser in gnu/javax/swing/html/css. + * + * This is package private to avoid accessor methods. */ - private class CSSStyleSheetParserCallback + class CSSStyleSheetParserCallback implements CSSParserCallback { /** @@ -405,9 +407,20 @@ public class StyleSheet extends StyleContext * @param rule - the rule to add to the sheet */ public void addRule(String rule) - throws NotImplementedException { - // FIXME: Implement. + CSSStyleSheetParserCallback cb = new CSSStyleSheetParserCallback(); + // FIXME: Handle ref. + StringReader in = new StringReader(rule); + CSSParser parser = new CSSParser(in, cb); + try + { + parser.parse(); + } + catch (IOException ex) + { + // Shouldn't happen. And if, then we + assert false; + } } /** |