ice.pilots.html4
Class DTextNode

java.lang.Object
  extended byice.storm.DynamicObject
      extended byice.pilots.html4.DNode
          extended byice.pilots.html4.DTextNode
All Implemented Interfaces:
CharacterData, Cloneable, EventTarget, Node, Text

public class DTextNode
extends DNode
implements Text, CharacterData

This class contains the text for a given box parsed from the HTML. This object has no knowledge of the greater layout concerns of the TextBox. This object now physically reverses the text if the associated TextBox indicates the text is to be reversed.


Field Summary
 
Fields inherited from class ice.pilots.html4.DNode
doc, first, last, next, parent, prev
 
Fields inherited from class ice.storm.DynamicObject
NOT_FOUND, SETD_IGNORE, SETD_NOT_FOUND, SETD_OK
 
Fields inherited from interface org.w3c.dom.Node
ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, NOTATION_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE
 
Method Summary
 void appendData(String arg)
          Append the string to the end of the character data of the node.
protected  DNode appendDChild(DNode n)
           
 Node cloneNode(boolean deep)
          Returns a duplicate of this node, i.e., serves as a generic copy constructor for nodes.
 void deleteData(int offset, int count)
          not implemented
 Object execDynamicMethod(String name, Object[] args, DynEnv env)
          Perform function-like actions for `name' with the given args.
 String getData()
          The character data of the node that implements this interface.
 Object getDynamicValue(String name, DynEnv env)
          Returns the `key' field or Defs.NOT_FOUND if `name' does not exist.
protected  DNode getFirstDChild()
           
protected  DNode getLastDChild()
           
 int getLength()
          The number of 16-bit units that are available through data and the substringData method below.
 String getNodeName()
          The name of this node, depending on its type; see the table above.
 short getNodeType()
          A code representing the type of the underlying object, as defined above.
 String getNodeValue()
          The value of this node, depending on its type; see the table above.
 void init()
          Init the linebreaks.
 void insertData(int offset, String arg)
          Insert a string at the specified 16-bit unit offset.
 void normalize()
          Fuse a sequence of sibling text elements into one.
protected  DNode removeDChild(DNode node)
           
 void replaceData(int offset, int count, String arg)
          not implemented
 void setData(String data)
          Set the contents of this DTextNode.
 int setDynamicValue(String name, Object value, DynEnv env)
          Set field `name' to `value'.
 void setNodeValue(String nodeValue)
           
 Text splitText(int offset)
          not implemented
 String substringData(int offset, int count)
          Extracts a range of data from the node.
 String toString()
           
 
Methods inherited from class ice.pilots.html4.DNode
addEventListener, afterClone, appendChild, attrNameToId, clone, clone, contains, deleteSlot, dispatchEvent, getAll, getAttributes, getChildNodes, getDAttr, getDAttrCount, getDAttrFromIndex, getDAttrListHead, getDAttrValueOrNull, getDParent, getDynamicScopeParent, getFirstChild, getInnerText, getLastChild, getLocalName, getNameId, getNamespaceURI, getNextDSibling, getNextSibling, getOuterText, getOwnerDDocument, getOwnerDocument, getParentDNode, getParentNode, getPilot, getPrefix, getPreviousDSibling, getPreviousSibling, getRootDNode, getRootNode, getSlot, hasAttributes, hasChildNodes, hasSlot, insertBefore, insertDChildBefore, isSupported, onDAttrValueChange, removeAllDAttrs, removeChild, removeDAttr, removeDAttr, removeEventListener, replaceChild, replaceDChild, setDAttr, setDAttr, setInnerText, setOuterText, setParent, setPrefix, setSlot, unlinkAllSlots
 
Methods inherited from class ice.storm.DynamicObject
deleteSlot, getEnumeratableIds, getMethodPropertySource, getScriptDataLock, getScriptWrapper, getSlot, hasSlot, javaReflectionTarget, readOnlySlots, script_toSource, script_toString, setScriptWrapperIfAbsent, setSlot
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.w3c.dom.Node
appendChild, getAttributes, getChildNodes, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, hasAttributes, hasChildNodes, insertBefore, isSupported, removeChild, replaceChild, setPrefix
 

Method Detail

init

public void init()
Init the linebreaks.


normalize

public void normalize()
Fuse a sequence of sibling text elements into one.

Specified by:
normalize in interface Node
Overrides:
normalize in class DNode

getNodeType

public short getNodeType()
Description copied from interface: Node
A code representing the type of the underlying object, as defined above.

Specified by:
getNodeType in interface Node
Overrides:
getNodeType in class DNode

getNodeName

public String getNodeName()
Description copied from interface: Node
The name of this node, depending on its type; see the table above.

Specified by:
getNodeName in interface Node
Overrides:
getNodeName in class DNode

getNodeValue

public String getNodeValue()
Description copied from interface: Node
The value of this node, depending on its type; see the table above. When it is defined to be null, setting it has no effect.

Specified by:
getNodeValue in interface Node
Overrides:
getNodeValue in class DNode

setNodeValue

public void setNodeValue(String nodeValue)
Specified by:
setNodeValue in interface Node
Overrides:
setNodeValue in class DNode

appendDChild

protected DNode appendDChild(DNode n)
Overrides:
appendDChild in class DNode

removeDChild

protected DNode removeDChild(DNode node)
Overrides:
removeDChild in class DNode

getFirstDChild

protected DNode getFirstDChild()
Overrides:
getFirstDChild in class DNode

getLastDChild

protected DNode getLastDChild()
Overrides:
getLastDChild in class DNode

getData

public String getData()
Description copied from interface: CharacterData
The character data of the node that implements this interface. The DOM implementation may not put arbitrary limits on the amount of data that may be stored in a CharacterData node. However, implementation limits may mean that the entirety of a node's data may not fit into a single DOMString. In such cases, the user may call substringData to retrieve the data in appropriately sized pieces.

Specified by:
getData in interface CharacterData

setData

public void setData(String data)
Set the contents of this DTextNode.

Specified by:
setData in interface CharacterData
Parameters:
data - String containing the new contents of this node.

getLength

public int getLength()
Description copied from interface: CharacterData
The number of 16-bit units that are available through data and the substringData method below. This may have the value zero, i.e., CharacterData nodes may be empty.

Specified by:
getLength in interface CharacterData

substringData

public String substringData(int offset,
                            int count)
Description copied from interface: CharacterData
Extracts a range of data from the node.

Specified by:
substringData in interface CharacterData
Returns:
The specified substring. If the sum of offset and count exceeds the length, then all 16-bit units to the end of the data are returned.

appendData

public void appendData(String arg)
Description copied from interface: CharacterData
Append the string to the end of the character data of the node. Upon success, data provides access to the concatenation of data and the DOMString specified.

Specified by:
appendData in interface CharacterData

insertData

public void insertData(int offset,
                       String arg)
Description copied from interface: CharacterData
Insert a string at the specified 16-bit unit offset.

Specified by:
insertData in interface CharacterData

deleteData

public void deleteData(int offset,
                       int count)
not implemented

Specified by:
deleteData in interface CharacterData

replaceData

public void replaceData(int offset,
                        int count,
                        String arg)
not implemented

Specified by:
replaceData in interface CharacterData

splitText

public Text splitText(int offset)
not implemented

Specified by:
splitText in interface Text
Returns:
The new node, of the same type as this node.

cloneNode

public Node cloneNode(boolean deep)
Description copied from interface: Node
Returns a duplicate of this node, i.e., serves as a generic copy constructor for nodes. The duplicate node has no parent; ( parentNode is null.).
Cloning an Element copies all attributes and their values, including those generated by the XML processor to represent defaulted attributes, but this method does not copy any text it contains unless it is a deep clone, since the text is contained in a child Text node. Cloning an Attribute directly, as opposed to be cloned as part of an Element cloning operation, returns a specified attribute ( specified is true). Cloning any other type of node simply returns a copy of this node.
Note that cloning an immutable subtree results in a mutable copy, but the children of an EntityReference clone are readonly . In addition, clones of unspecified Attr nodes are specified. And, cloning Document, DocumentType, Entity, and Notation nodes is implementation dependent.

Specified by:
cloneNode in interface Node
Overrides:
cloneNode in class DNode

toString

public String toString()

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 DNode

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 DNode

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 DNode