org.apache.batik.css
Class CSSOMReadOnlyStyleDeclaration

java.lang.Object
  |
  +--org.apache.batik.css.CSSOMReadOnlyStyleDeclaration
All Implemented Interfaces:
CSSStyleDeclaration

public class CSSOMReadOnlyStyleDeclaration
extends java.lang.Object
implements CSSStyleDeclaration

This class implements the CSSStyleDeclaration interface.


Inner Class Summary
protected static class CSSOMReadOnlyStyleDeclaration.AuthorValueEntry
          To store a author value.
protected static class CSSOMReadOnlyStyleDeclaration.ImportantAuthorValueEntry
          To store an important author value.
protected static class CSSOMReadOnlyStyleDeclaration.ImportantUserAgentValueEntry
          To store an important user-agent value.
protected static class CSSOMReadOnlyStyleDeclaration.ImportantUserValueEntry
          To store an important user value.
protected static class CSSOMReadOnlyStyleDeclaration.PropertyMap
          To store the values.
protected static class CSSOMReadOnlyStyleDeclaration.UserAgentValueEntry
          To store a user-agent value.
protected static class CSSOMReadOnlyStyleDeclaration.UserValueEntry
          To store a user value.
protected static class CSSOMReadOnlyStyleDeclaration.ValueEntry
          This interface represents a value entry in the table.
 
Field Summary
static int AUTHOR_ORIGIN
          To tag the properties that comes from the author.
protected  Element parentElement
          The associated parent element.
protected  CSSOMReadOnlyStyleDeclaration.PropertyMap properties
          The properties.
static int USER_AGENT_ORIGIN
          To tag the properties that comes from a user agent.
static int USER_ORIGIN
          To tag the properties that comes from the user preferences.
protected  AbstractViewCSS viewCSS
          The ViewCSS.
 
Constructor Summary
CSSOMReadOnlyStyleDeclaration(AbstractViewCSS v, Element elt)
          Creates a new CSSOMReadOnlyStyleDeclaration object.
CSSOMReadOnlyStyleDeclaration(CSSOMReadOnlyStyleDeclaration sd)
          Creates a new CSSOMReadOnlyStyleDeclaration object.
 
Method Summary
protected static CSSOMReadOnlyStyleDeclaration.ValueEntry createValueEntry(CSSOMReadOnlyValue v, java.lang.String s, int p)
          Creates a new value entry.
 java.lang.String getCssText()
          DOM: Implements CSSStyleDeclaration.getCssText().
 int getLength()
          DOM: Implements CSSStyleDeclaration.getLength().
 CSSValue getLocalPropertyCSSValue(java.lang.String propertyName)
          Returns the local CSSValue.
 int getLocalPropertyOrigin(java.lang.String propertyName)
          Returns the local property origin.
 java.lang.String getLocalPropertyPriority(java.lang.String propertyName)
          Returns the local priority.
 CSSRule getParentRule()
          DOM: Implements CSSStyleDeclaration.getParentRule().
 CSSValue getPropertyCSSValue(java.lang.String propertyName)
          DOM: Implements CSSStyleDeclaration.getPropertyCSSValue(String).
 CSSOMReadOnlyValue getPropertyCSSValueInternal(java.lang.String propertyName)
          Internal version of getPropertyCSSValue().
 int getPropertyOrigin(java.lang.String propertyName)
          Returns a property origin.
 java.lang.String getPropertyPriority(java.lang.String propertyName)
          DOM: Implements CSSStyleDeclaration.getPropertyPriority(String).
 java.lang.String getPropertyValue(java.lang.String propertyName)
          DOM: Implements CSSStyleDeclaration.getPropertyValue(String).
 java.lang.String item(int index)
          DOM: Implements CSSStyleDeclaration.item(int).
 java.lang.String removeProperty(java.lang.String propertyName)
          DOM: Implements CSSStyleDeclaration.removeProperty(String).
 void setContext(AbstractViewCSS v, Element elt)
          Sets the declaration context.
 void setCssText(java.lang.String cssText)
          DOM: Implements CSSStyleDeclaration.setCssText(String).
 void setProperty(java.lang.String propertyName, java.lang.String value, java.lang.String prio)
          DOM: Implements CSSStyleDeclaration.setProperty(String,String,String).
 void setPropertyCSSValue(java.lang.String propertyName, CSSValue v, java.lang.String imp, int orig)
          Sets a property value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

USER_AGENT_ORIGIN

public static final int USER_AGENT_ORIGIN
To tag the properties that comes from a user agent.

USER_ORIGIN

public static final int USER_ORIGIN
To tag the properties that comes from the user preferences.

AUTHOR_ORIGIN

public static final int AUTHOR_ORIGIN
To tag the properties that comes from the author.

properties

protected CSSOMReadOnlyStyleDeclaration.PropertyMap properties
The properties.

viewCSS

protected AbstractViewCSS viewCSS
The ViewCSS.

parentElement

protected Element parentElement
The associated parent element.
Constructor Detail

CSSOMReadOnlyStyleDeclaration

public CSSOMReadOnlyStyleDeclaration(AbstractViewCSS v,
                                     Element elt)
Creates a new CSSOMReadOnlyStyleDeclaration object.

CSSOMReadOnlyStyleDeclaration

public CSSOMReadOnlyStyleDeclaration(CSSOMReadOnlyStyleDeclaration sd)
Creates a new CSSOMReadOnlyStyleDeclaration object.
Method Detail

setContext

public void setContext(AbstractViewCSS v,
                       Element elt)
Sets the declaration context.

getCssText

public java.lang.String getCssText()
DOM: Implements CSSStyleDeclaration.getCssText().
Specified by:
getCssText in interface CSSStyleDeclaration
Following copied from interface: org.w3c.dom.css.CSSStyleDeclaration
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 declaration is readonly or a property is readonly.

setCssText

public void setCssText(java.lang.String cssText)
                throws DOMException
DOM: Implements CSSStyleDeclaration.setCssText(String). Throws a NO_MODIFICATION_ALLOWED_ERR DOMException.
Specified by:
setCssText in interface CSSStyleDeclaration
Following copied from interface: org.w3c.dom.css.CSSStyleDeclaration
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 declaration is readonly or a property is readonly.

getPropertyValue

public java.lang.String getPropertyValue(java.lang.String propertyName)
DOM: Implements CSSStyleDeclaration.getPropertyValue(String).
Specified by:
getPropertyValue in interface CSSStyleDeclaration
Following copied from interface: org.w3c.dom.css.CSSStyleDeclaration
Parameters:
propertyName - The name of the CSS property. See the CSS property index.
Returns:
Returns the value of the property if it has been explicitly set for this declaration block. Returns the empty string if the property has not been set.

getPropertyCSSValue

public CSSValue getPropertyCSSValue(java.lang.String propertyName)
DOM: Implements CSSStyleDeclaration.getPropertyCSSValue(String).
Specified by:
getPropertyCSSValue in interface CSSStyleDeclaration
Following copied from interface: org.w3c.dom.css.CSSStyleDeclaration
Parameters:
propertyName - The name of the CSS property. See the CSS property index.
Returns:
Returns the value of the property if it has been explicitly set for this declaration block. Returns null if the property has not been set.

getPropertyCSSValueInternal

public CSSOMReadOnlyValue getPropertyCSSValueInternal(java.lang.String propertyName)
Internal version of getPropertyCSSValue().

getLocalPropertyCSSValue

public CSSValue getLocalPropertyCSSValue(java.lang.String propertyName)
Returns the local CSSValue.

setPropertyCSSValue

public void setPropertyCSSValue(java.lang.String propertyName,
                                CSSValue v,
                                java.lang.String imp,
                                int orig)
Sets a property value.

getPropertyOrigin

public int getPropertyOrigin(java.lang.String propertyName)
Returns a property origin.

getLocalPropertyOrigin

public int getLocalPropertyOrigin(java.lang.String propertyName)
Returns the local property origin.

removeProperty

public java.lang.String removeProperty(java.lang.String propertyName)
                                throws DOMException
DOM: Implements CSSStyleDeclaration.removeProperty(String).
Specified by:
removeProperty in interface CSSStyleDeclaration
Following copied from interface: org.w3c.dom.css.CSSStyleDeclaration
Parameters:
propertyName - The name of the CSS property. See the CSS property index.
Returns:
Returns the value of the property if it has been explicitly set for this declaration block. Returns the empty string if the property has not been set or the property name does not correspond to a known CSS property.
Throws:
DOMException - NO_MODIFICATION_ALLOWED_ERR: Raised if this declaration is readonly or the property is readonly.

getPropertyPriority

public java.lang.String getPropertyPriority(java.lang.String propertyName)
DOM: Implements CSSStyleDeclaration.getPropertyPriority(String).
Specified by:
getPropertyPriority in interface CSSStyleDeclaration
Following copied from interface: org.w3c.dom.css.CSSStyleDeclaration
Parameters:
propertyName - The name of the CSS property. See the CSS property index.
Returns:
A string representing the priority (e.g. "important") if one exists. The empty string if none exists.

getLocalPropertyPriority

public java.lang.String getLocalPropertyPriority(java.lang.String propertyName)
Returns the local priority.

setProperty

public void setProperty(java.lang.String propertyName,
                        java.lang.String value,
                        java.lang.String prio)
                 throws DOMException
DOM: Implements CSSStyleDeclaration.setProperty(String,String,String).
Specified by:
setProperty in interface CSSStyleDeclaration
Following copied from interface: org.w3c.dom.css.CSSStyleDeclaration
Parameters:
propertyName - The name of the CSS property. See the CSS property index.
value - The new value of the property.
priority - The new priority of the property (e.g. "important").
Throws:
DOMException - SYNTAX_ERR: Raised if the specified value has a syntax error and is unparsable.
NO_MODIFICATION_ALLOWED_ERR: Raised if this declaration is readonly or the property is readonly.

getLength

public int getLength()
DOM: Implements CSSStyleDeclaration.getLength().
Specified by:
getLength in interface CSSStyleDeclaration

item

public java.lang.String item(int index)
DOM: Implements CSSStyleDeclaration.item(int).
Specified by:
item in interface CSSStyleDeclaration
Following copied from interface: org.w3c.dom.css.CSSStyleDeclaration
Parameters:
index - Index of the property name to retrieve.
Returns:
The name of the property at this ordinal position. The empty string if no property exists at this position.

getParentRule

public CSSRule getParentRule()
DOM: Implements CSSStyleDeclaration.getParentRule().
Specified by:
getParentRule in interface CSSStyleDeclaration
Returns:
null.

createValueEntry

protected static CSSOMReadOnlyStyleDeclaration.ValueEntry createValueEntry(CSSOMReadOnlyValue v,
                                                                           java.lang.String s,
                                                                           int p)
Creates a new value entry.


Copyright © 2001 Apache Software Foundation. All Rights Reserved.