|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.google.gwt.core.client.JavaScriptObject
com.google.gwt.dom.client.Node
com.google.gwt.dom.client.Document
org.xwiki.gwt.dom.client.Document
public class Document
Extends the document implementation provided by GWT to add support for multi-window, selection and range.
http://code.google.com/p/google-web-toolkit/issues/detail?id=2772,
http://code.google.com/p/google-web-toolkit/issues/detail?id=3006,
http://code.google.com/p/google-web-toolkit/issues/detail?id=3053| Field Summary |
|---|
| Fields inherited from class com.google.gwt.dom.client.Node |
|---|
DOCUMENT_NODE, ELEMENT_NODE, TEXT_NODE |
| Constructor Summary | |
|---|---|
protected |
Document()
Default constructor. |
| Method Summary | |
|---|---|
void |
addInnerHTMLListener(InnerHTMLListener listener)
Registers a new listener for changes to innerHTML property of element within this document. |
void |
close()
Closes a document stream for writing. |
com.google.gwt.dom.client.Node |
createComment(java.lang.String data)
|
DocumentFragment |
createDocumentFragment()
Creates an empty document fragment. A DocumentFragment is a minimal document object that has no parent. |
Range |
createRange()
We've added this method because at the time of writing Document doesn't offer
support for creating a range. |
boolean |
execCommand(java.lang.String command,
java.lang.String parameter)
When an HTML document has been switched to designMode, the document object exposes the execCommand method which allows one to run commands to manipulate the contents of the editable region. |
Element |
getDocumentElement()
|
java.util.Iterator<com.google.gwt.dom.client.Node> |
getIterator(com.google.gwt.dom.client.Node startNode)
Returns an iterator for the depth-first pre-order strategy, starting in startNode. |
Selection |
getSelection()
We've added this method because at the time of writing Document doesn't offer
support for retrieving the current selection. |
void |
open()
Opens a document stream for writing. |
boolean |
queryCommandEnabled(java.lang.String command)
|
boolean |
queryCommandState(java.lang.String command)
|
boolean |
queryCommandSupported(java.lang.String command)
|
java.lang.String |
queryCommandValue(java.lang.String command)
|
void |
removeInnerHTMLListener(InnerHTMLListener listener)
Stop sending notifications to the given listener when the innerHTML property, of some element
included in this document, changes. |
void |
write(java.lang.String html)
Writes a string of text to a document stream opened by open(). |
com.google.gwt.dom.client.BaseElement |
xCreateBaseElement()
|
com.google.gwt.dom.client.BRElement |
xCreateBRElement()
Creates a <br> element. |
com.google.gwt.dom.client.ButtonElement |
xCreateButtonElement()
Creates a <button> element. |
com.google.gwt.dom.client.DivElement |
xCreateDivElement()
Creates a <div> element. |
Element |
xCreateElement(java.lang.String tagName)
Creates a new element. We've added this method because at the time of writing Document doesn't offer
support for multi-window. |
com.google.gwt.dom.client.HRElement |
xCreateHRElement()
Creates a <hr> element. |
com.google.gwt.dom.client.ImageElement |
xCreateImageElement()
Creates a <img> element. |
com.google.gwt.dom.client.LIElement |
xCreateLIElement()
Creates a <li> element. |
com.google.gwt.dom.client.LinkElement |
xCreateLinkElement()
Creates a <link> element. |
com.google.gwt.dom.client.ParagraphElement |
xCreatePElement()
Creates a <p> element. |
com.google.gwt.dom.client.ScriptElement |
xCreateScriptElement()
Creates a <script> element. |
com.google.gwt.dom.client.SpanElement |
xCreateSpanElement()
Creates a <span> element. |
com.google.gwt.dom.client.Node |
xImportNode(com.google.gwt.dom.client.Node externalNode,
boolean deep)
Creates a copy of a node from an external document that can be inserted into this document. We've added this method because at time of writing Document.importNode(Node, boolean) is not well implemented. |
| Methods inherited from class com.google.gwt.dom.client.Document |
|---|
createAnchorElement, createAreaElement, createBaseElement, createBlockQuoteElement, createBRElement, createButtonElement, createCaptionElement, createCheckInputElement, createColElement, createColGroupElement, createDelElement, createDivElement, createDLElement, createElement, createFieldSetElement, createFileInputElement, createFormElement, createFrameElement, createFrameSetElement, createHeadElement, createHElement, createHiddenInputElement, createHRElement, createIFrameElement, createImageElement, createImageInputElement, createInsElement, createLabelElement, createLegendElement, createLIElement, createLinkElement, createMapElement, createMetaElement, createObjectElement, createOLElement, createOptGroupElement, createOptionElement, createParamElement, createPasswordInputElement, createPElement, createPreElement, createQElement, createRadioInputElement, createScriptElement, createSelectElement, createSelectElement, createSpanElement, createStyleElement, createTableElement, createTBodyElement, createTDElement, createTextAreaElement, createTextInputElement, createTextNode, createTFootElement, createTHeadElement, createTHElement, createTitleElement, createTRElement, createULElement, createUniqueId, get, getBody, getBodyOffsetLeft, getBodyOffsetTop, getDomain, getElementById, getElementsByTagName, getReferrer, getTitle, getURL, importNode, setTitle |
| Methods inherited from class com.google.gwt.dom.client.Node |
|---|
appendChild, cloneNode, getChildNodes, getFirstChild, getLastChild, getNextSibling, getNodeName, getNodeType, getNodeValue, getOwnerDocument, getParentNode, getPreviousSibling, hasChildNodes, insertBefore, removeChild, replaceChild, setNodeValue |
| Methods inherited from class com.google.gwt.core.client.JavaScriptObject |
|---|
cast, createArray, createFunction, createObject, equals, hashCode, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
protected Document()
| Method Detail |
|---|
public final Element xCreateElement(java.lang.String tagName)
Document doesn't offer
support for multi-window. This means that currently, using GWT's API we can create elements only within the
document of the host page. Since com.google.gwt.user.client.ui.RichTextArea is based on an in-line frame
which has its own window and document we have to be able to create elements within the edited document.
tagName - the tag name of the element to be created
http://code.google.com/p/google-web-toolkit/issues/detail?id=2772public final com.google.gwt.dom.client.Node createComment(java.lang.String data)
data - contains the data to be added to the comment.
public final com.google.gwt.dom.client.LinkElement xCreateLinkElement()
public final com.google.gwt.dom.client.ScriptElement xCreateScriptElement()
public final com.google.gwt.dom.client.BRElement xCreateBRElement()
public final com.google.gwt.dom.client.ParagraphElement xCreatePElement()
public final com.google.gwt.dom.client.DivElement xCreateDivElement()
public final com.google.gwt.dom.client.SpanElement xCreateSpanElement()
public final com.google.gwt.dom.client.BaseElement xCreateBaseElement()
public final com.google.gwt.dom.client.HRElement xCreateHRElement()
public final com.google.gwt.dom.client.ImageElement xCreateImageElement()
public final com.google.gwt.dom.client.LIElement xCreateLIElement()
public final com.google.gwt.dom.client.ButtonElement xCreateButtonElement()
public final Selection getSelection()
Document doesn't offer
support for retrieving the current selection.
http://code.google.com/p/google-web-toolkit/issues/detail?id=3053public final Range createRange()
Document doesn't offer
support for creating a range.
http://code.google.com/p/google-web-toolkit/issues/detail?id=3053
public final com.google.gwt.dom.client.Node xImportNode(com.google.gwt.dom.client.Node externalNode,
boolean deep)
Document.importNode(Node, boolean) is not well implemented.
externalNode - The node from another document to be imported.deep - Indicates whether the children of the given node need to be imported.
http://code.google.com/p/google-web-toolkit/issues/detail?id=3006public final java.util.Iterator<com.google.gwt.dom.client.Node> getIterator(com.google.gwt.dom.client.Node startNode)
startNode.
startNode - node to start iteration from
DepthFirstPreOrderIterator},
http://www.w3.org/TR/DOM-Level-2-Traversal-Range/traversal.html#Traversal-Document
public final boolean execCommand(java.lang.String command,
java.lang.String parameter)
command - The name of the command.parameter - Some commands (such as insertimage) require an extra value argument (the image's url). Pass an
argument of null if no argument is needed.
public final java.lang.String queryCommandValue(java.lang.String command)
command - The name of the command to query.
null.public final boolean queryCommandEnabled(java.lang.String command)
command - The name of the command to query.
public final boolean queryCommandState(java.lang.String command)
command - The name of the command to query.
public final boolean queryCommandSupported(java.lang.String command)
command - The name of the command to query.
public final Element getDocumentElement()
public final DocumentFragment createDocumentFragment()
public final void open()
public final void close()
public final void write(java.lang.String html)
open().
html - a string containing the HTML to be written to the document.public final void addInnerHTMLListener(InnerHTMLListener listener)
innerHTML property of element within this document.
listener - The listener to be registered.public final void removeInnerHTMLListener(InnerHTMLListener listener)
innerHTML property, of some element
included in this document, changes.
listener - The listener to be unregistered.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||