public class Document
extends com.google.gwt.dom.client.Document
See http://code.google.com/p/google-web-toolkit/issues/detail?id=3006 and http://code.google.com/p/google-web-toolkit/issues/detail?id=3053.
| Modifier | Constructor and Description |
|---|---|
protected |
Document()
Default constructor.
|
| Modifier and Type | Method and Description |
|---|---|
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(String data) |
DocumentFragment |
createDocumentFragment()
Creates an empty document fragment.
|
Range |
createRange()
We've added this method because at the time of writing
Document doesn't offer
support for creating a range. |
boolean |
execCommand(String command,
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.
|
void |
fireInnerHTMLChange(Element element)
Notify all listeners of the change to the given element's
innerHTML property. |
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. |
boolean |
isDesignMode() |
void |
open()
Opens a document stream for writing.
|
boolean |
queryCommandEnabled(String command) |
boolean |
queryCommandState(String command) |
boolean |
queryCommandSupported(String command) |
String |
queryCommandValue(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 |
setDesignMode(boolean designMode)
Puts this document in design mode or in view-only mode.
|
void |
write(String html)
Writes a string of text to a document stream opened by
open(). |
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.
|
createAnchorElement, createAreaElement, createAudioElement, createBaseElement, createBlockQuoteElement, createBlurEvent, createBRElement, createButtonElement, createButtonInputElement, createCanvasElement, createCaptionElement, createChangeEvent, createCheckInputElement, createClickEvent, createColElement, createColGroupElement, createContextMenuEvent, createDblClickEvent, createDelElement, createDivElement, createDLElement, createElement, createErrorEvent, createFieldSetElement, createFileInputElement, createFocusEvent, createFormElement, createFrameElement, createFrameSetElement, createHeadElement, createHElement, createHiddenInputElement, createHRElement, createHtmlEvent, createIFrameElement, createImageElement, createImageInputElement, createInsElement, createKeyCodeEvent, createKeyDownEvent, createKeyDownEvent, createKeyEvent, createKeyPressEvent, createKeyPressEvent, createKeyUpEvent, createKeyUpEvent, createLabelElement, createLegendElement, createLIElement, createLinkElement, createLoadEvent, createMapElement, createMetaElement, createMouseDownEvent, createMouseEvent, createMouseMoveEvent, createMouseOutEvent, createMouseOverEvent, createMouseUpEvent, createObjectElement, createOLElement, createOptGroupElement, createOptionElement, createParamElement, createPasswordInputElement, createPElement, createPreElement, createPushButtonElement, createQElement, createRadioInputElement, createResetButtonElement, createResetInputElement, createScriptElement, createScriptElement, createScrollEvent, createSelectElement, createSelectElement, createSourceElement, createSpanElement, createStyleElement, createSubmitButtonElement, createSubmitInputElement, createTableElement, createTBodyElement, createTDElement, createTextAreaElement, createTextInputElement, createTextNode, createTFootElement, createTHeadElement, createTHElement, createTitleElement, createTRElement, createULElement, createUniqueId, createVideoElement, enableScrolling, get, getBody, getBodyOffsetLeft, getBodyOffsetTop, getClientHeight, getClientWidth, getCompatMode, getDocumentElement, getDomain, getElementById, getElementsByTagName, getHead, getReferrer, getScrollHeight, getScrollLeft, getScrollTop, getScrollWidth, getTitle, getURL, importNode, isCSS1Compat, setScrollLeft, setScrollTop, setTitleappendChild, as, cloneNode, getChild, getChildCount, getChildNodes, getFirstChild, getLastChild, getNextSibling, getNodeName, getNodeType, getNodeValue, getOwnerDocument, getParentElement, getParentNode, getPreviousSibling, hasChildNodes, hasParentElement, insertAfter, insertBefore, insertFirst, is, isOrHasChild, removeAllChildren, removeChild, removeFromParent, replaceChild, setNodeValueprotected Document()
public final com.google.gwt.dom.client.Node createComment(String data)
data - contains the data to be added to the comment.public final DocumentFragment createDocumentFragment()
A DocumentFragment is a minimal document object that has no parent. It supports the following DOM 2 methods: appendChild, cloneNode, hasAttributes, hasChildNodes, insertBefore, normalize, removeChild, replaceChild.
It also supports the following DOM 2 properties: attributes, childNodes, firstChild, lastChild, localName, namespaceURI, nextSibling, nodeName, nodeType, nodeValue, ownerDocument, parentNode, prefix, previousSibling, textContent.
Various other methods can take a document fragment as an argument (e.g. Node interface methods such as appendChild and insertBefore), in which case the children of the fragment are appended or inserted, not the fragment itself.
public final Selection getSelection()
Document doesn't offer
support for retrieving the current selection.public final Range createRange()
Document doesn't offer
support for creating a range.
See 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)
We've added this method because at time of writing
Document.importNode(Node, boolean) is not well implemented.
See http://code.google.com/p/google-web-toolkit/issues/detail?id=3006.
externalNode - The node from another document to be imported.deep - Indicates whether the children of the given node need to be imported.public final Iterator<com.google.gwt.dom.client.Node> getIterator(com.google.gwt.dom.client.Node startNode)
startNode.
See http://www.w3.org/TR/DOM-Level-2-Traversal-Range/traversal.html#Traversal-Document.
startNode - node to start iteration fromDepthFirstPreOrderIteratorpublic final boolean execCommand(String command, 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 String queryCommandValue(String command)
command - The name of the command to query.null.public final boolean queryCommandEnabled(String command)
command - The name of the command to query.public final boolean queryCommandState(String command)
command - The name of the command to query.public final boolean queryCommandSupported(String command)
command - The name of the command to query.public final void open()
public final void close()
public final void write(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.public final void fireInnerHTMLChange(Element element)
innerHTML property.
NOTE: Normally, only Element.xSetInnerHTML(String) should call this method.
element - The element whose innerHTML property has changed.Element.xSetInnerHTML(String)public final void setDesignMode(boolean designMode)
NOTE: The standard implementation of this method sets the value of the designMode DOM document property.
We set the value of the contentEditable property on the document's body instead, if the browser doesn't
fully support the designMode property.
designMode - true to enter design mode, false to go back to view-only modepublic final boolean isDesignMode()
true if this document is in design mode, false otherwisesetDesignMode(boolean)Copyright © 2004–2016 XWiki. All rights reserved.