ice.pilots.html4
Class DStyleDeclaration

java.lang.Object
  extended byice.storm.DynamicObject
      extended byice.storm.DynamicList
          extended byice.pilots.html4.DStyleDeclaration
All Implemented Interfaces:
CSSStyleDeclaration

public class DStyleDeclaration
extends DynamicList
implements CSSStyleDeclaration


Field Summary
 
Fields inherited from class ice.storm.DynamicObject
NOT_FOUND, SETD_IGNORE, SETD_NOT_FOUND, SETD_OK
 
Constructor Summary
protected DStyleDeclaration(DOM dom, DCSSRule parentRule, DElement e)
           
 
Method Summary
protected  void dispatchDOMEvent(short type, String name, String value)
          Utility to dispatch the CSSModified MutationEvent on Element closest to this rule.
 Object execDynamicMethod(String name, Object[] args, DynEnv env)
          Perform function-like actions for `name' with the given args.
protected  Object[] getCSSDeclFields(String propName)
           
 String getCssText()
          The parsable textual representation of the declaration block (excluding the surrounding curly braces).
 Object getDynamicValue(String name, DynEnv env)
          Returns the `key' field or Defs.NOT_FOUND if `name' does not exist.
 int getLength()
          The number of properties that have been explicitly set in this declaration block.
 CSSRule getParentRule()
          The CSS rule that contains this declaration block or null if this CSSStyleDeclaration is not attached to a CSSRule.
 CSSValue getPropertyCSSValue(String propertyName)
          Used to retrieve the object representation of the value of a CSS property if it has been explicitly set within this declaration block.
 String getPropertyPriority(String propertyName)
          Used to retrieve the priority of a CSS property (e.g.
 String getPropertyValue(String propertyName)
          Used to retrieve the value of a CSS property if it has been explicitly set within this declaration block.
 String item(int idx)
          Used to retrieve the properties that have been explicitly set in this declaration block.
 String removeProperty(String propertyName)
          Used to remove a CSS property if it has been explicitly set within this declaration block.
protected  Object script_item(int index, DynEnv env)
          Returns null if not found
protected  Object script_namedItem(String name, DynEnv env)
          Returns null if not found
 void setCssText(String cssText)
           
 int setDynamicValue(String name, Object value, DynEnv env)
          Set field `name' to `value'.
 void setProperty(String propertyName, String value, String priority)
          Used to set a property value and priority within this declaration block.
 void setSlot(String name, Object value, DynEnv env)
          Set named slot to `value'.
 String toString()
           
protected  void updateCSSDecl(String propName, Object value, int type)
           
 
Methods inherited from class ice.storm.DynamicList
getEnumeratableIds, getMethodPropertySource, getSlot, getSlot, script_tags
 
Methods inherited from class ice.storm.DynamicObject
deleteSlot, deleteSlot, getDynamicScopeParent, getScriptDataLock, getScriptWrapper, hasSlot, hasSlot, javaReflectionTarget, readOnlySlots, script_toSource, script_toString, setScriptWrapperIfAbsent, setSlot, unlinkAllSlots
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DStyleDeclaration

protected DStyleDeclaration(DOM dom,
                            DCSSRule parentRule,
                            DElement e)
Method Detail

getCssText

public String getCssText()
Description copied from interface: CSSStyleDeclaration
The parsable textual representation of the declaration block (excluding the surrounding curly braces). Setting this attribute will result in the parsing of the new value and resetting of all the properties in the declaration block including the removal or addition of properties.

Specified by:
getCssText in interface CSSStyleDeclaration

setCssText

public void setCssText(String cssText)
Specified by:
setCssText in interface CSSStyleDeclaration

getPropertyValue

public String getPropertyValue(String propertyName)
Description copied from interface: CSSStyleDeclaration
Used to retrieve the value of a CSS property if it has been explicitly set within this declaration block.

Specified by:
getPropertyValue in interface 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(String propertyName)
Description copied from interface: CSSStyleDeclaration
Used to retrieve the object representation of the value of a CSS property if it has been explicitly set within this declaration block. This method returns null if the property is a shorthand property. Shorthand property values can only be accessed and modified as strings, using the getPropertyValue and setProperty methods.

Specified by:
getPropertyCSSValue in interface 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.

getCSSDeclFields

protected Object[] getCSSDeclFields(String propName)

updateCSSDecl

protected void updateCSSDecl(String propName,
                             Object value,
                             int type)

removeProperty

public String removeProperty(String propertyName)
Description copied from interface: CSSStyleDeclaration
Used to remove a CSS property if it has been explicitly set within this declaration block.

Specified by:
removeProperty in interface 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.

getPropertyPriority

public String getPropertyPriority(String propertyName)
Description copied from interface: CSSStyleDeclaration
Used to retrieve the priority of a CSS property (e.g. the "important" qualifier) if the property has been explicitly set in this declaration block.

Specified by:
getPropertyPriority in interface 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.

setProperty

public void setProperty(String propertyName,
                        String value,
                        String priority)
Description copied from interface: CSSStyleDeclaration
Used to set a property value and priority within this declaration block.

Specified by:
setProperty in interface 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").

getLength

public int getLength()
Description copied from interface: CSSStyleDeclaration
The number of properties that have been explicitly set in this declaration block. The range of valid indices is 0 to length-1 inclusive.

Specified by:
getLength in interface CSSStyleDeclaration
Specified by:
getLength in class DynamicList

item

public String item(int idx)
Description copied from interface: CSSStyleDeclaration
Used to retrieve the properties that have been explicitly set in this declaration block. The order of the properties retrieved using this method does not have to be the order in which they were set. This method can be used to iterate over all properties in this declaration block.

Specified by:
item in interface CSSStyleDeclaration
Parameters:
idx - 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.

script_item

protected Object script_item(int index,
                             DynEnv env)
Description copied from class: DynamicList
Returns null if not found

Specified by:
script_item in class DynamicList

getParentRule

public CSSRule getParentRule()
Description copied from interface: CSSStyleDeclaration
The CSS rule that contains this declaration block or null if this CSSStyleDeclaration is not attached to a CSSRule.

Specified by:
getParentRule in interface CSSStyleDeclaration

script_namedItem

protected Object script_namedItem(String name,
                                  DynEnv env)
Description copied from class: DynamicList
Returns null if not found

Specified by:
script_namedItem in class DynamicList

setSlot

public void setSlot(String name,
                    Object value,
                    DynEnv env)
Description copied from class: DynamicObject
Set named slot to `value'. If `value' should be converted to some type, use `env' for conversions

Overrides:
setSlot in class DynamicObject

toString

public String toString()

dispatchDOMEvent

protected final void dispatchDOMEvent(short type,
                                      String name,
                                      String value)
Utility to dispatch the CSSModified MutationEvent on Element closest to this rule.

Parameters:
type - The exact type of style-change
name - The name of the style which was affected
value - The new value

getDynamicValue

public Object getDynamicValue(String name,
                              DynEnv env)
Description copied from class: DynamicObject
Returns the `key' field or Defs.NOT_FOUND if `name' does not exist. Returns `FUNCTION_MARK' if `name' represent a function that can be invoke via execDynamicMethod. Note that returned `null' indicates that value is present but set to null.

Overrides:
getDynamicValue in class DynamicList

setDynamicValue

public int setDynamicValue(String name,
                           Object value,
                           DynEnv env)
Description copied from class: DynamicObject
Set field `name' to `value'. Use `env' to unwrap `value' to a particular type or store it as is

Overrides:
setDynamicValue in class DynamicList

execDynamicMethod

public Object execDynamicMethod(String name,
                                Object[] args,
                                DynEnv env)
Description copied from class: DynamicObject
Perform function-like actions for `name' with the given args. Returns the result or Defs.NOT_FOUND if name is not associated with function action. Should return result of env.wrapVoid() to indicate method without return value. Use `env' to unwrap `args' elements to a particular type.

Overrides:
execDynamicMethod in class DynamicList