org.xwiki.gwt.dom.client
Class DocumentFragment

java.lang.Object
  extended by com.google.gwt.core.client.JavaScriptObject
      extended by com.google.gwt.dom.client.Node
          extended by org.xwiki.gwt.dom.client.DocumentFragment

public final class DocumentFragment
extends com.google.gwt.dom.client.Node

A fragment of a DOM document.
We've added this class because at the time of writing GWT doesn't offer a similar implementation.

Version:
$Id: 71173ae6df2e004093447500161e28cf851867e0 $
See Also:
"http://code.google.com/p/google-web-toolkit/issues/detail?id=2955"

Field Summary
 
Fields inherited from class com.google.gwt.dom.client.Node
DOCUMENT_NODE, ELEMENT_NODE, TEXT_NODE
 
Constructor Summary
protected DocumentFragment()
          Default constructor.
 
Method Summary
static DocumentFragment as(com.google.gwt.dom.client.Node node)
          Assert that the given Node is a DocumentFragment and automatically typecast it.
 String getInnerHTML()
           
 String getInnerText()
           
static boolean is(com.google.gwt.dom.client.Node node)
          Determine whether the given Node can be cast to a DocumentFragment.
 
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

DocumentFragment

protected DocumentFragment()
Default constructor. Needs to be protected because all instances are created from JavaScript.

Method Detail

is

public static boolean is(com.google.gwt.dom.client.Node node)
Determine whether the given Node can be cast to a DocumentFragment. A null node will cause this method to return false.

Parameters:
node - a DOM node
Returns:
true if the given node is a document fragment, false otherwise

as

public static DocumentFragment as(com.google.gwt.dom.client.Node node)
Assert that the given Node is a DocumentFragment and automatically typecast it.

Parameters:
node - a document fragment DOM node
Returns:
the given node, casted to a document fragment

getInnerHTML

public String getInnerHTML()
Returns:
the HTML serialization of this document fragment

getInnerText

public String getInnerText()
Returns:
the text, without mark-up, found within this document fragment


Copyright © 2004-2013 XWiki. All Rights Reserved.