org.apache.batik.css
Class CSSOMStyleRule

java.lang.Object
  |
  +--org.apache.batik.css.AbstractCSSRule
        |
        +--org.apache.batik.css.CSSOMStyleRule
All Implemented Interfaces:
CSSPropertyChangeListener, CSSRule, CSSStyleDeclarationChangeListener, CSSStyleRule

public class CSSOMStyleRule
extends AbstractCSSRule
implements CSSStyleRule, CSSStyleDeclarationChangeListener

This class implements the CSSStyleRule interface.


Inner Class Summary
protected  class CSSOMStyleRule.StyleRuleHandler
          To handle the parsing of a style rule.
 
Field Summary
protected  java.net.URL baseURI
          The base URI.
protected  ValueFactoryMap factories
          The value factory map.
protected  ExtendedParser parser
          The CSS parser.
protected  DocumentHandler ruleHandler
          The CSS document handler.
protected  SelectorList selectors
          The selectors.
protected  CSSOMStyleDeclaration style
          The declaration-block of this rule set.
protected  CSSStyleRuleChangeSupport styleRuleChangeSupport
          The Style rule change support.
 
Fields inherited from class org.apache.batik.css.AbstractCSSRule
CONDITION_FACTORY, parentRule, parentStyleSheet, SELECTOR_FACTORY
 
Fields inherited from interface org.w3c.dom.css.CSSRule
CHARSET_RULE, FONT_FACE_RULE, IMPORT_RULE, MEDIA_RULE, PAGE_RULE, STYLE_RULE, UNKNOWN_RULE
 
Constructor Summary
CSSOMStyleRule(CSSStyleSheet ss, CSSRule pr, Parser p, ValueFactoryMap m)
          Creates a new rule set.
 
Method Summary
 void addCSSStyleRuleChangeListener(CSSStyleRuleChangeListener listener)
          Adds a CSSStyleRuleChangeListener to the listener list.
 void cssPropertyChange(CSSPropertyChangeEvent evt)
          Called when a CSS property is changed.
 void cssStyleDeclarationChangeCancel(CSSStyleDeclarationChangeEvent evt)
          Called a CSS declaration change has been cancelled.
 void cssStyleDeclarationChangeEnd(CSSStyleDeclarationChangeEvent evt)
          Called after a CSS declaration was changed.
 void cssStyleDeclarationChangeStart(CSSStyleDeclarationChangeEvent evt)
          Called before a CSS declaration will be changed.
 void fireCSSStyleRuleChangeCancel()
          Reports the cancellation of a CSSStyleRule update to any registered listeners.
 void fireCSSStyleRuleChangeEnd()
          Reports the end of a CSSStyleRule update to any registered listeners.
 void fireCSSStyleRuleChangeStart()
          Reports the start of a CSSStyleRule update to any registered listeners.
 java.net.URL getBaseURI()
          Returns the base URI.
 java.lang.String getCssText()
          DOM: Implements CSSRule.getCssText().
 SelectorList getSelectors()
          Returns the selectors.
 java.lang.String getSelectorText()
          DOM: Implements CSSStyleRule.getSelectorText().
 CSSStyleDeclaration getStyle()
          DOM: Implements CSSStyleRule.getStyle().
 short getType()
          DOM: Implements CSSRule.getType().
 void removeCSSStyleRuleChangeListener(CSSStyleRuleChangeListener listener)
          Removes a CSSStyleRuleChangeListener from the listener list.
 void setBaseURI(java.net.URL url)
          Sets the base URI.
 void setCssText(java.lang.String cssText)
          DOM: Implements CSSRule.setCssText(String).
 void setSelectors(SelectorList s)
          Sets the selectors.
 void setSelectorText(java.lang.String selectorText)
          DOM: Implements CSSStyleRule.setSelectorText(String).
 
Methods inherited from class org.apache.batik.css.AbstractCSSRule
getParentRule, getParentStyleSheet
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.w3c.dom.css.CSSRule
getParentRule, getParentStyleSheet
 

Field Detail

selectors

protected SelectorList selectors
The selectors.

style

protected CSSOMStyleDeclaration style
The declaration-block of this rule set.

parser

protected ExtendedParser parser
The CSS parser.

factories

protected ValueFactoryMap factories
The value factory map.

ruleHandler

protected DocumentHandler ruleHandler
The CSS document handler.

styleRuleChangeSupport

protected CSSStyleRuleChangeSupport styleRuleChangeSupport
The Style rule change support.

baseURI

protected java.net.URL baseURI
The base URI.
Constructor Detail

CSSOMStyleRule

public CSSOMStyleRule(CSSStyleSheet ss,
                      CSSRule pr,
                      Parser p,
                      ValueFactoryMap m)
Creates a new rule set.
Method Detail

setBaseURI

public void setBaseURI(java.net.URL url)
Sets the base URI.

getBaseURI

public java.net.URL getBaseURI()
Returns the base URI.

getType

public short getType()
DOM: Implements CSSRule.getType().
Specified by:
getType in interface CSSRule
Returns:
CSSRule.STYLE_RULE.

getCssText

public java.lang.String getCssText()
DOM: Implements CSSRule.getCssText().
Specified by:
getCssText in interface CSSRule
Following copied from interface: org.w3c.dom.css.CSSRule
Throws:
DOMException - SYNTAX_ERR: Raised if the specified CSS string value has a syntax error and is unparsable.
INVALID_MODIFICATION_ERR: Raised if the specified CSS string value represents a different type of rule than the current one.
HIERARCHY_REQUEST_ERR: Raised if the rule cannot be inserted at this point in the style sheet.
NO_MODIFICATION_ALLOWED_ERR: Raised if the rule is readonly.

setCssText

public void setCssText(java.lang.String cssText)
                throws DOMException
DOM: Implements CSSRule.setCssText(String).
Specified by:
setCssText in interface CSSRule
Following copied from interface: org.w3c.dom.css.CSSRule
Throws:
DOMException - SYNTAX_ERR: Raised if the specified CSS string value has a syntax error and is unparsable.
INVALID_MODIFICATION_ERR: Raised if the specified CSS string value represents a different type of rule than the current one.
HIERARCHY_REQUEST_ERR: Raised if the rule cannot be inserted at this point in the style sheet.
NO_MODIFICATION_ALLOWED_ERR: Raised if the rule is readonly.

getSelectorText

public java.lang.String getSelectorText()
DOM: Implements CSSStyleRule.getSelectorText().
Specified by:
getSelectorText in interface CSSStyleRule
Following copied from interface: org.w3c.dom.css.CSSStyleRule
Throws:
DOMException - SYNTAX_ERR: Raised if the specified CSS string value has a syntax error and is unparsable.
NO_MODIFICATION_ALLOWED_ERR: Raised if this rule is readonly.

setSelectorText

public void setSelectorText(java.lang.String selectorText)
                     throws DOMException
DOM: Implements CSSStyleRule.setSelectorText(String).
Specified by:
setSelectorText in interface CSSStyleRule
Following copied from interface: org.w3c.dom.css.CSSStyleRule
Throws:
DOMException - SYNTAX_ERR: Raised if the specified CSS string value has a syntax error and is unparsable.
NO_MODIFICATION_ALLOWED_ERR: Raised if this rule is readonly.

setSelectors

public void setSelectors(SelectorList s)
Sets the selectors.

getSelectors

public SelectorList getSelectors()
Returns the selectors.

getStyle

public CSSStyleDeclaration getStyle()
DOM: Implements CSSStyleRule.getStyle().
Specified by:
getStyle in interface CSSStyleRule

addCSSStyleRuleChangeListener

public void addCSSStyleRuleChangeListener(CSSStyleRuleChangeListener listener)
Adds a CSSStyleRuleChangeListener to the listener list.
Parameters:
listener - The CSSStyleRuleChangeListener to be added

removeCSSStyleRuleChangeListener

public void removeCSSStyleRuleChangeListener(CSSStyleRuleChangeListener listener)
Removes a CSSStyleRuleChangeListener from the listener list.
Parameters:
listener - The CSSStyleRuleChangeListener to be removed

cssStyleDeclarationChangeStart

public void cssStyleDeclarationChangeStart(CSSStyleDeclarationChangeEvent evt)
Called before a CSS declaration will be changed.
Specified by:
cssStyleDeclarationChangeStart in interface CSSStyleDeclarationChangeListener

cssStyleDeclarationChangeCancel

public void cssStyleDeclarationChangeCancel(CSSStyleDeclarationChangeEvent evt)
Called a CSS declaration change has been cancelled.
Specified by:
cssStyleDeclarationChangeCancel in interface CSSStyleDeclarationChangeListener

cssStyleDeclarationChangeEnd

public void cssStyleDeclarationChangeEnd(CSSStyleDeclarationChangeEvent evt)
Called after a CSS declaration was changed.
Specified by:
cssStyleDeclarationChangeEnd in interface CSSStyleDeclarationChangeListener

cssPropertyChange

public void cssPropertyChange(CSSPropertyChangeEvent evt)
Called when a CSS property is changed.
Specified by:
cssPropertyChange in interface CSSPropertyChangeListener

fireCSSStyleRuleChangeStart

public void fireCSSStyleRuleChangeStart()
Reports the start of a CSSStyleRule update to any registered listeners.

fireCSSStyleRuleChangeCancel

public void fireCSSStyleRuleChangeCancel()
Reports the cancellation of a CSSStyleRule update to any registered listeners.

fireCSSStyleRuleChangeEnd

public void fireCSSStyleRuleChangeEnd()
Reports the end of a CSSStyleRule update to any registered listeners.


Copyright © 2001 Apache Software Foundation. All Rights Reserved.