|
||||||||||
| 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 selection and range.
| 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(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(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. 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, 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, getReferrer, getScrollHeight, getScrollLeft, getScrollTop, getScrollWidth, getTitle, getURL, importNode, isCSS1Compat, setScrollLeft, setScrollTop, setTitle |
| Methods inherited from class com.google.gwt.dom.client.Node |
|---|
appendChild, as, cloneNode, getChild, getChildCount, getChildNodes, getFirstChild, getLastChild, getNextSibling, getNodeName, getNodeType, getNodeValue, getOwnerDocument, getParentElement, getParentNode, getPreviousSibling, hasChildNodes, hasParentElement, insertAfter, insertBefore, insertFirst, is, isOrHasChild, removeChild, removeFromParent, replaceChild, setNodeValue |
| Methods inherited from class com.google.gwt.core.client.JavaScriptObject |
|---|
cast, createArray, createFunction, createObject, equals, hashCode, toSource, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
protected Document()
| Method Detail |
|---|
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()
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.
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.
public final 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(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)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||