|
|||||||||||
| 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.DDocument
Implementation of DOM Level 2 Document. It can be used standalone (without HTML4 rendering engine).
| Field Summary | |
protected Names |
names
|
static boolean |
STRICT
|
| 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 |
DDocument(DOMImplementation impl)
|
protected |
DDocument(ThePilot pilot,
DOM implementation)
|
| Method Summary | |
void |
addStyleSheet(DStyleSheet s)
Add a StyleSheet to this document |
protected DNode |
appendDChild(DNode node)
|
protected void |
clear()
|
protected void |
clearRootElement()
clear root element |
void |
close()
Closes a document stream opened by open() and forces
rendering. |
protected DAttr |
createAttribute(int attrNameId)
|
Attr |
createAttribute(String name)
Creates an Attr of the given name. |
Attr |
createAttributeNS(String namespaceURI,
String qualifiedName)
Creates an attribute of the given qualified name and namespace URI. |
CDATASection |
createCDATASection(String data)
not implemented |
Comment |
createComment(String data)
not implemented |
DocumentFragment |
createDocumentFragment()
Creates an empty DocumentFragment object. |
DOMEvent |
createDOMEvent(int id)
|
DOMEvent |
createDOMEvent(int id,
DNode target)
|
protected DTextNode |
createDTextNode(char[] buf,
int offset,
int length,
boolean isPre)
|
protected DTextNode |
createDTextNode(String data)
|
protected DTextNode |
createDTextNode(String data,
boolean isPre)
|
protected DElement |
createElement(int tagId)
|
Element |
createElement(String tagName)
Creates an element of the type specified. |
Element |
createElementNS(String namespaceURI,
String qualifiedName)
Creates an element of the given qualified name and namespace URI. |
Element |
createElementWithNameSpace(String localName,
String namespace)
|
EntityReference |
createEntityReference(String name)
not implemented |
Event |
createEvent(String eventType)
|
ProcessingInstruction |
createProcessingInstruction(String target,
String data)
not implemented |
Text |
createTextNode(String data)
Creates a Text node given the specified string. |
protected void |
evalScriptHandlerListeners(DNode n,
DOMEvent de,
Object handler)
|
Object |
execDynamicMethod(String name,
Object[] args,
DynEnv env)
Perform function-like actions for `name' with the given args. |
String |
getAlinkColor()
|
DAllList |
getAll()
|
HTMLCollection |
getAnchors()
A collection of all the anchor ( A) elements in a document
with a value for the name attribute.Note. |
HTMLCollection |
getApplets()
A collection of all the OBJECT elements that include
applets and APPLET (deprecated) elements in a document. |
boolean |
getAsync()
|
String |
getBaseTarget()
|
URL |
getBaseURL()
|
String |
getBgColor()
|
HTMLElement |
getBody()
Returns BODY element or FRAMESET element |
String |
getCookie()
The cookies associated with this document. |
DElement |
getDBody()
|
String |
getDefaultCharset()
|
AbstractView |
getDefaultView()
The default AbstractView for this Document,
or null if none available. |
DocumentType |
getDoctype()
The Document Type Declaration (see DocumentType)
associated with this document. |
DElement |
getDocumentDElement()
|
Element |
getDocumentElement()
This is a convenience attribute that allows direct access to the child node that is the root element of the document. |
Viewport |
getDocumentVieport()
Deprecated. Please use . |
Viewport |
getDocumentViewport()
|
DOM |
getDom()
|
String |
getDomain()
The domain name of the server that served the document, or null if the server cannot be identified by a domain
name. |
TheView |
getDomView()
|
Object |
getDynamicScopeParent()
This is only relevant to support scope chain during event handler execution. |
Object |
getDynamicValue(String name,
DynEnv env)
Returns the `key' field or Defs.NOT_FOUND if `name' does not exist. |
Element |
getElementById(String elementId)
Returns the Element whose ID is given by
elementId. |
NodeList |
getElementsByName(String elementName)
Returns the (possibly empty) collection of elements whose name value is given by elementName. |
NodeList |
getElementsByTagName(String tagName)
Returns a NodeList of all the Elements with a
given tag name in the order in which they are encountered in a
preorder traversal of the Document tree. |
NodeList |
getElementsByTagNameNS(String namespaceURI,
String localName)
Returns a NodeList of all the Elements with a
given local name and namespace URI in the order in which they are
encountered in a preorder traversal of the Document tree. |
String |
getFgColor()
|
HTMLCollection |
getForms()
A collection of all the forms of a document. |
DElement |
getHead()
|
int |
getHeight()
|
HTMLCollection |
getImages()
A collection of all the IMG elements in a document. |
DOMImplementation |
getImplementation()
The DOMImplementation object that handles this document. |
String |
getLastModified()
|
String |
getLinkColor()
|
HTMLCollection |
getLinks()
A collection of all AREA elements and anchor (
A) elements in a document with a value for the
href attribute. |
HTMLCollection |
getMaps()
|
int |
getMutation()
|
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. |
ThePilot |
getPilot()
|
String |
getReferrer()
Returns the URI of the page that linked to this page. |
DRange |
getSelection()
|
Object |
getSlot(String name,
DynEnv env)
|
StyleSheetList |
getStyleSheets()
A list containing all the style sheets explicitly linked into or embedded in a document. |
String |
getTitle()
The title of a document as specified by the TITLE element
in the head of the document. |
String |
getURL()
The complete URI of the document. |
String |
getVlinkColor()
|
int |
getWidth()
|
Node |
importNode(Node importedNode,
boolean deep)
Imports a node from another document to this document. |
boolean |
isRTL()
|
void |
mutate()
|
void |
open()
Note. |
void |
processEvent(int id,
DNode target)
|
protected DNode |
removeDChild(DNode node)
|
void |
removeStyleSheet(DStyleSheet s)
Remove a StyleSheet from this document |
String |
resolveUrl(String urlFragment)
Resolve a relative url against this document's base url. |
URL |
resolveURL(String loc)
Deprecated. Use resolveUrl(String). |
protected void |
script_load(DynEnv env,
String urlFragment)
This implements the load method of document, which can be executed from javascript. |
protected void |
script_loadXML(String xmltext)
Replace the current document with the content of the xmltext argument. |
void |
setAlinkColor(String v)
|
void |
setAsync(boolean asyncstat)
|
void |
setBaseUrl(String url)
|
void |
setBgColor(String v)
|
void |
setBody(HTMLElement e)
|
void |
setCookie(String text)
|
int |
setDynamicValue(String name,
Object value,
DynEnv env)
Set field `name' to `value'. |
void |
setFgColor(String v)
|
void |
setHtmlMode(boolean flag)
|
void |
setLinkColor(String v)
|
void |
setTitle(String text)
|
void |
setVlinkColor(String v)
|
protected String |
transformNode(Document stylesheet)
Transforms the current document into a new document, using the stylesheet document supplied as an argument.?The text of the transformed document is returned. |
protected void |
transformNodeToObject(Document stylesheet,
Document result)
Transforms the current document into a new document, using the stylesheet document supplied as an argument.?The transformed document is returned. |
void |
write(String str)
Write a string of text to a document stream opened by open(). |
void |
writeln(String str)
Write a string of text followed by a newline character to a document stream opened by open(). |
| 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, toString, wait, wait, wait |
| Methods inherited from interface org.w3c.dom.Node |
appendChild, cloneNode, getAttributes, getChildNodes, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNodeValue, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, hasAttributes, hasChildNodes, insertBefore, isSupported, normalize, removeChild, replaceChild, setNodeValue, setPrefix |
| Field Detail |
public static boolean STRICT
protected Names names
| Constructor Detail |
protected DDocument(DOMImplementation impl)
protected DDocument(ThePilot pilot,
DOM implementation)
| Method Detail |
public final int getMutation()
public final void mutate()
public boolean isRTL()
public void setHtmlMode(boolean flag)
protected void clear()
public final ThePilot getPilot()
getPilot in class DNodepublic final Viewport getDocumentVieport()
getDocumentViewport.
public final Viewport getDocumentViewport()
public Event createEvent(String eventType)
createEvent in interface DocumentEventEventpublic DOMEvent createDOMEvent(int id)
public final DOMEvent createDOMEvent(int id,
DNode target)
public void processEvent(int id,
DNode target)
protected void evalScriptHandlerListeners(DNode n,
DOMEvent de,
Object handler)
protected DElement createElement(int tagId)
protected DTextNode createDTextNode(char[] buf,
int offset,
int length,
boolean isPre)
protected DTextNode createDTextNode(String data,
boolean isPre)
protected final DTextNode createDTextNode(String data)
protected DAttr createAttribute(int attrNameId)
protected DNode appendDChild(DNode node)
appendDChild in class DNodeprotected DNode removeDChild(DNode node)
removeDChild in class DNodepublic String getNodeName()
Node
getNodeName in interface NodegetNodeName in class DNodepublic short getNodeType()
Node
getNodeType in interface NodegetNodeType in class DNodepublic DocumentType getDoctype()
DocumentDocumentType)
associated with this document. For HTML documents as well as XML
documents without a document type declaration this returns
null. The DOM Level 2 does not support editing the
Document Type Declaration. docType cannot be altered in
any way, including through the use of methods inherited from the
Node interface, such as insertNode or
removeNode.
getDoctype in interface Documentpublic final DOMImplementation getImplementation()
DocumentDOMImplementation object that handles this document. A
DOM application may use objects from multiple implementations.
getImplementation in interface Documentpublic DOM getDom()
public final Element getDocumentElement()
Document
getDocumentElement in interface Documentpublic DElement getDocumentDElement()
public Element createElement(String tagName)
DocumentElement interface, so attributes
can be specified directly on the returned object.
Attr nodes representing them are automatically created
and attached to the element.
createElementNS method.
createElement in interface DocumentElement object with the
nodeName attribute set to tagName, and
localName, prefix, and
namespaceURI set to null.public DocumentFragment createDocumentFragment()
DocumentDocumentFragment object.
createDocumentFragment in interface DocumentDocumentFragment.public final Text createTextNode(String data)
DocumentText node given the specified string.
createTextNode in interface DocumentText object.public Comment createComment(String data)
createComment in interface DocumentComment object.public CDATASection createCDATASection(String data)
createCDATASection in interface DocumentCDATASection object.
public ProcessingInstruction createProcessingInstruction(String target,
String data)
createProcessingInstruction in interface DocumentProcessingInstruction object.public Attr createAttribute(String name)
DocumentAttr of the given name. Note that the
Attr instance can then be set on an Element
using the setAttributeNode method.
createAttributeNS method.
createAttribute in interface DocumentAttr object with the nodeName
attribute set to name, and localName,
prefix, and namespaceURI set to
null. The value of the attribute is the empty string.public EntityReference createEntityReference(String name)
createEntityReference in interface DocumentEntityReference object.public NodeList getElementsByTagName(String tagName)
DocumentNodeList of all the Elements with a
given tag name in the order in which they are encountered in a
preorder traversal of the Document tree.
getElementsByTagName in interface DocumentNodeList object containing all the matched
Elements.public String getTitle()
HTMLDocumentTITLE element
in the head of the document.
getTitle in interface HTMLDocumentpublic void setTitle(String text)
setTitle in interface HTMLDocumentpublic String getReferrer()
HTMLDocument
getReferrer in interface HTMLDocumentpublic URL getBaseURL()
public String getDomain()
HTMLDocumentnull if the server cannot be identified by a domain
name.
getDomain in interface HTMLDocumentpublic final String getURL()
HTMLDocument
getURL in interface HTMLDocumentpublic final HTMLElement getBody()
getBody in interface HTMLDocumentpublic DElement getDBody()
public void setBody(HTMLElement e)
setBody in interface HTMLDocumentpublic HTMLCollection getImages()
HTMLDocumentIMG elements in a document. The
behavior is limited to IMG elements for backwards
compatibility.
getImages in interface HTMLDocumentpublic HTMLCollection getApplets()
HTMLDocumentOBJECT elements that include
applets and APPLET (deprecated) elements in a document.
getApplets in interface HTMLDocumentpublic HTMLCollection getLinks()
HTMLDocumentAREA elements and anchor (
A) elements in a document with a value for the
href attribute.
getLinks in interface HTMLDocumentpublic HTMLCollection getForms()
HTMLDocument
getForms in interface HTMLDocumentpublic HTMLCollection getAnchors()
HTMLDocumentA) elements in a document
with a value for the name attribute.Note. For reasons of
backwards compatibility, the returned set of anchors only contains
those anchors created with the name attribute, not those
created with the id attribute.
getAnchors in interface HTMLDocumentpublic HTMLCollection getMaps()
public String getCookie()
HTMLDocumentname=value;expires=date.
getCookie in interface HTMLDocumentpublic void setCookie(String text)
setCookie in interface HTMLDocumentpublic String getLastModified()
public String getDefaultCharset()
public void open()
HTMLDocument
open in interface HTMLDocumentpublic void close()
HTMLDocumentopen() and forces
rendering.
close in interface HTMLDocumentpublic void write(String str)
HTMLDocumentopen(). The text is parsed into the document's structure
model.
write in interface HTMLDocumentpublic void writeln(String str)
HTMLDocumentopen(). The text is parsed into the
document's structure model.
writeln in interface HTMLDocumentpublic Element getElementById(String elementId)
DocumentElement whose ID is given by
elementId. If no such element exists, returns
null. Behavior is not defined if more than one element
has this ID. The DOM implementation must have
information that says which attributes are of type ID. Attributes
with the name "ID" are not of type ID unless so defined.
Implementations that do not know whether attributes are of type ID or
not are expected to return null.
getElementById in interface Documentpublic NodeList getElementsByName(String elementName)
HTMLDocumentname value is given by elementName.
getElementsByName in interface HTMLDocumentpublic StyleSheetList getStyleSheets()
DocumentStyle
getStyleSheets in interface DocumentStylepublic final AbstractView getDefaultView()
DocumentViewAbstractView for this Document,
or null if none available.
getDefaultView in interface DocumentViewpublic TheView getDomView()
public Element createElementWithNameSpace(String localName,
String namespace)
public int getWidth()
public int getHeight()
public DAllList getAll()
getAll in class DNodepublic DRange getSelection()
public boolean getAsync()
public void setAsync(boolean asyncstat)
protected void script_load(DynEnv env,
String urlFragment)
throws IOException
IOException
protected void script_loadXML(String xmltext)
throws IOException
IOException
protected String transformNode(Document stylesheet)
throws IOException
IOException
protected void transformNodeToObject(Document stylesheet,
Document result)
throws IOException
IOException
public Object getSlot(String name,
DynEnv env)
getSlot in class DNodepublic void addStyleSheet(DStyleSheet s)
public void removeStyleSheet(DStyleSheet s)
public URL resolveURL(String loc)
resolveUrl(String).
public String resolveUrl(String urlFragment)
public void setBaseUrl(String url)