|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectice.storm.DynamicObject
ice.pilots.html4.DNode
ice.pilots.html4.DElement
Implementation of DOM Element. Can be used standalone
| 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 |
| Constructor Summary | |
protected |
DElement(DDocument doc,
int id)
|
| Method Summary | |
protected void |
afterClone(boolean deep)
This method is meant to be after the Object.clone() call. |
protected int |
attrNameToId(String name)
|
Object |
execDynamicMethod(String name,
Object[] args,
DynEnv env)
Perform function-like actions for `name' with the given args. |
String |
getAttribute(int attrNameId)
|
String |
getAttribute(String name)
Retrieves an attribute value by name. |
int |
getAttributeAsInt(String name)
Retrieve the Attribute value as an integer. |
Attr |
getAttributeNode(String name)
Retrieves an attribute node by name. |
Attr |
getAttributeNodeNS(String namespaceURI,
String localName)
Retrieves an Attr node by local name and namespace URI. |
String |
getAttributeNS(String namespaceURI,
String localName)
Retrieves an attribute value by local name and namespace URI. |
NamedNodeMap |
getAttributes()
A NamedNodeMap containing the attributes of this node (if
it is an Element) or null otherwise. |
String |
getBgColor()
|
Viewport |
getChildViewport()
Find a viewport that this element holds if any. |
String |
getClassName()
The class attribute of the element. |
int |
getClientLeft()
|
int |
getClientTop()
|
int |
getClientWidth()
Retrieve the height of the visible element. |
String |
getColor()
|
String |
getDir()
Specifies the base direction of directionally neutral text and the directionality of tables. |
Object |
getDynamicValue(String name,
DynEnv env)
Returns the `key' field or Defs.NOT_FOUND if `name' does not exist. |
NodeList |
getElementsByTagName(String name)
Returns a NodeList of all descendant Elements
with a given tag name, in the order in which they are encountered in
a preorder traversal of this Element tree. |
NodeList |
getElementsByTagNameNS(String namespaceURI,
String localName)
Returns a NodeList of all the descendant
Elements with a given local name and namespace URI in
the order in which they are encountered in a preorder traversal of
this Element tree. |
protected DynamicObject |
getEmbeddedDocument()
Apply a default algorithm to check if this element contains embedded subdocumnet |
static DElement |
getEmbeddedViewHolder(Viewport view)
Get DElement that represent `view' in the parent document if any |
String |
getId()
The element's identifier. |
String |
getInnerHTML()
|
String |
getLang()
Language code defined in RFC 1766. |
String |
getLocalName()
Returns the local part of the qualified name of this node. |
String |
getName()
|
String |
getNamespaceURI()
The namespace URI of this node, or null if it is
unspecified. |
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 |
getOuterHTML()
|
String |
getPrefix()
The namespace prefix of this node, or null if it is
unspecified. |
CSSStyleDeclaration |
getStyle()
The style attribute. |
boolean |
getSynthetic()
|
String |
getTagName()
The name of the element. |
String |
getTitle()
The element's advisory title. |
boolean |
hasAttribute(String name)
Returns true when an attribute with a given name is
specified on this element or has a default value, false
otherwise. |
boolean |
hasAttributeNS(String namespaceURI,
String localName)
Returns true when an attribute with a given local name and
namespace URI is specified on this element or has a default value,
false otherwise. |
void |
insertAdjacentHTML(String where,
String what)
|
protected void |
onDAttrValueChange(DAttr attr)
|
void |
removeAttribute(String name)
Removes an attribute by name. |
Attr |
removeAttributeNode(Attr oldAttr)
Removes the specified attribute node. |
void |
removeAttributeNS(String namespaceURI,
String localName)
Removes an attribute by local name and namespace URI. |
Node |
removeNode(boolean detachChildren)
|
protected void |
setAttribute(int attrNameId,
String value)
|
void |
setAttribute(String name,
String value)
Adds a new attribute. |
Attr |
setAttributeNode(Attr newAttr)
Adds a new attribute node. |
Attr |
setAttributeNodeNS(Attr newAttr)
Adds a new attribute. |
void |
setAttributeNS(String namespaceURI,
String qualifiedName,
String value)
Adds a new attribute. |
void |
setBgColor(String value)
|
void |
setClassName(String value)
|
void |
setColor(String value)
|
void |
setCols(String value)
|
void |
setDir(String value)
|
int |
setDynamicValue(String name,
Object value,
DynEnv env)
Set field `name' to `value'. |
void |
setId(String value)
|
void |
setInnerHTML(String html)
|
void |
setLang(String value)
|
void |
setName(String value)
|
void |
setOuterHTML(String html)
|
void |
setRows(String value)
|
void |
setTitle(String value)
|
protected DNode |
swapDNode(DNode other)
|
Node |
swapNode(Node other)
|
String |
toString()
|
| 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, cloneNode, getChildNodes, getFirstChild, getLastChild, getNextSibling, getNodeValue, getOwnerDocument, getParentNode, getPreviousSibling, hasAttributes, hasChildNodes, insertBefore, isSupported, normalize, removeChild, replaceChild, setNodeValue, setPrefix |
| Constructor Detail |
protected DElement(DDocument doc,
int id)
| Method Detail |
protected void afterClone(boolean deep)
DNode
afterClone in class DNodedeep - True if the node is intended to be a deep child copyprotected void onDAttrValueChange(DAttr attr)
onDAttrValueChange in class DNodepublic final String getAttribute(int attrNameId)
protected void setAttribute(int attrNameId,
String value)
public short getNodeType()
Node
getNodeType in interface NodegetNodeType in class DNodepublic String getNodeName()
Node
getNodeName in interface NodegetNodeName in class DNodepublic String getTagName()
Element<elementExample id="demo"> ... </elementExample> ,
tagName has
the value "elementExample". Note that this is
case-preserving in XML, as are all of the operations of the DOM. The
HTML DOM returns the tagName of an HTML element in the
canonical uppercase form, regardless of the case in the source HTML
document.
getTagName in interface Elementprotected int attrNameToId(String name)
attrNameToId in class DNodepublic String getAttribute(String name)
Element
getAttribute in interface ElementAttr value as a string, or the empty string
if that attribute does not have a specified or default value.
public void setAttribute(String name,
String value)
ElementAttr node plus any
Text and EntityReference nodes, build the
appropriate subtree, and use setAttributeNode to assign
it as the value of an attribute.
setAttributeNS method.
setAttribute in interface Elementpublic void removeAttribute(String name)
ElementremoveAttributeNS method.
removeAttribute in interface Elementpublic Attr getAttributeNode(String name)
ElementgetAttributeNodeNS method.
getAttributeNode in interface ElementAttr node with the specified name (
nodeName) or null if there is no such
attribute.public Attr setAttributeNode(Attr newAttr)
ElementnodeName) is already present in the element, it is
replaced by the new one.
setAttributeNodeNS method.
setAttributeNode in interface ElementnewAttr attribute replaces an existing
attribute, the replaced Attr node is returned,
otherwise null is returned.public Attr removeAttributeNode(Attr oldAttr)
ElementAttr
has a default value it is immediately replaced. The replacing
attribute has the same namespace URI and local name, as well as the
original prefix, when applicable.
removeAttributeNode in interface ElementAttr node that was removed.public NodeList getElementsByTagName(String name)
ElementNodeList of all descendant Elements
with a given tag name, in the order in which they are encountered in
a preorder traversal of this Element tree.
getElementsByTagName in interface ElementElement nodes.public NamedNodeMap getAttributes()
NodeNamedNodeMap containing the attributes of this node (if
it is an Element) or null otherwise.
getAttributes in interface NodegetAttributes in class DNodepublic String getLocalName()
NodeELEMENT_NODE and
ATTRIBUTE_NODE and nodes created with a DOM Level 1
method, such as createElement from the
Document interface, this is always null.
getLocalName in interface NodegetLocalName in class DNodepublic String getPrefix()
Nodenull if it is
unspecified.
nodeName attribute, which holds the qualified name, as
well as the tagName and name attributes of
the Element and Attr interfaces, when
applicable.
namespaceURI and localName do not change.
ELEMENT_NODE and
ATTRIBUTE_NODE and nodes created with a DOM Level 1
method, such as createElement from the
Document interface, this is always null.
getPrefix in interface NodegetPrefix in class DNodepublic String getNamespaceURI()
Nodenull if it is
unspecified.
ELEMENT_NODE and
ATTRIBUTE_NODE and nodes created with a DOM Level 1
method, such as createElement from the
Document interface, this is always null.Per
the Namespaces in XML Specification an attribute does not inherit
its namespace from the element it is attached to. If an attribute is
not explicitly given a namespace, it simply has no namespace.
getNamespaceURI in interface NodegetNamespaceURI in class DNodepublic String getBgColor()
public void setBgColor(String value)
public String getColor()
public void setColor(String value)
public String getId()
HTMLElement
getId in interface HTMLElementpublic void setId(String value)
setId in interface HTMLElementpublic void setRows(String value)
public void setCols(String value)
public String getName()
public void setName(String value)
public String getClassName()
HTMLElement
getClassName in interface HTMLElementpublic void setClassName(String value)
setClassName in interface HTMLElementpublic String getTitle()
HTMLElement
getTitle in interface HTMLElementpublic void setTitle(String value)
setTitle in interface HTMLElementpublic String getLang()
HTMLElement
getLang in interface HTMLElementpublic void setLang(String value)
setLang in interface HTMLElementpublic String getDir()
HTMLElement
getDir in interface HTMLElementpublic void setDir(String value)
setDir in interface HTMLElementpublic CSSStyleDeclaration getStyle()
ElementCSSInlineStyle
getStyle in interface ElementCSSInlineStylepublic String toString()
public boolean getSynthetic()
public int getAttributeAsInt(String name)
name - The attribute name.
public String getAttributeNS(String namespaceURI,
String localName)
Element
getAttributeNS in interface ElementAttr value as a string, or the empty string
if that attribute does not have a specified or default value.
public void setAttributeNS(String namespaceURI,
String qualifiedName,
String value)
ElementqualifiedName, and
its value is changed to be the value parameter. This
value is a simple string; it is not parsed as it is being set. So any
markup (such as syntax to be recognized as an entity reference) is
treated as literal text, and needs to be appropriately escaped by the
implementation when it is written out. In order to assign an
attribute value that contains entity references, the user must create
an Attr node plus any Text and
EntityReference nodes, build the appropriate subtree,
and use setAttributeNodeNS or
setAttributeNode to assign it as the value of an
attribute.
setAttributeNS in interface Element
public void removeAttributeNS(String namespaceURI,
String localName)
Element
removeAttributeNS in interface Element
public Attr getAttributeNodeNS(String namespaceURI,
String localName)
ElementAttr node by local name and namespace URI.
HTML-only DOM implementations do not need to implement this method.
getAttributeNodeNS in interface ElementAttr node with the specified attribute local
name and namespace URI or null if there is no such
attribute.public Attr setAttributeNodeNS(Attr newAttr)
Element
setAttributeNodeNS in interface ElementnewAttr attribute replaces an existing
attribute with the same local name and namespace URI, the replaced
Attr node is returned, otherwise null is
returned.
public NodeList getElementsByTagNameNS(String namespaceURI,
String localName)
ElementNodeList of all the descendant
Elements with a given local name and namespace URI in
the order in which they are encountered in a preorder traversal of
this Element tree.
getElementsByTagNameNS in interface ElementNodeList object containing all the matched
Elements.public boolean hasAttribute(String name)
Elementtrue when an attribute with a given name is
specified on this element or has a default value, false
otherwise.
hasAttribute in interface Elementtrue if an attribute with the given name is
specified on this element or has a default value, false
otherwise.
public boolean hasAttributeNS(String namespaceURI,
String localName)
Elementtrue when an attribute with a given local name and
namespace URI is specified on this element or has a default value,
false otherwise. HTML-only DOM implementations do not
need to implement this method.
hasAttributeNS in interface Elementtrue if an attribute with the given local name
and namespace URI is specified or has a default value on this
element, false otherwise.public int getClientTop()
public int getClientLeft()
public int getClientWidth()
public void insertAdjacentHTML(String where,
String what)
public void setInnerHTML(String html)
public String getInnerHTML()
public void setOuterHTML(String html)
public String getOuterHTML()
public Node removeNode(boolean detachChildren)
public final Node swapNode(Node other)
protected DNode swapDNode(DNode other)
public static DElement getEmbeddedViewHolder(Viewport view)
public Viewport getChildViewport()
protected DynamicObject getEmbeddedDocument()
public Object getDynamicValue(String name,
DynEnv env)
DynamicObject
getDynamicValue in class DNode
public int setDynamicValue(String name,
Object value,
DynEnv env)
DynamicObject
setDynamicValue in class DNode
public Object execDynamicMethod(String name,
Object[] args,
DynEnv env)
DynamicObject
execDynamicMethod in class DNode
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||