com.sencha.gxt.core.client.dom
Class XDOM

java.lang.Object
  extended by com.sencha.gxt.core.client.dom.XDOM

public class XDOM
extends java.lang.Object

Provides additional static methods that allow you to manipulate the browser's Document Object Model (DOM).

See Also:
DOM

Field Summary
static SafeStyles EMPTY_SAFE_STYLE
          An empty safe styles instance.
 
Constructor Summary
XDOM()
           
 
Method Summary
static XElement create(SafeHtml html)
          Creates a new element from the given markup.
static XElement create(java.lang.String html)
          Creates an element form the given markup.
static Element createElementNS(java.lang.String ns, java.lang.String tag)
          Creates an element of the given name space and tag.
static Element createTextNode(java.lang.String text)
          Creates a text node from the given text.
static java.lang.String getAutoIdPrefix()
          Returns the auto id prefix.
static int getBodyScrollLeft()
          Returns the body elements horizontal scroll.
static int getBodyScrollTop()
          Return the body elements vertical scroll.
static int getDocumentHeight()
          Returns the document's height.
static int getDocumentWidth()
          Returns the document width.
static Element getHead()
          Returns the HTML head element.
static int getScrollBarWidth()
          Returns the width of the scroll bar.
static int getTopZIndex()
          Increments and returns the top z-index value.
static int getTopZIndex(int i)
          Increments and returns the top z-index value.
static java.lang.String getUniqueId()
          Returns an unique id.
static int getViewHeight(boolean full)
          Returns the view height.
static int getViewportHeight()
          Returns the viewport height.
static Size getViewportSize()
          Returns the viewports size.
static int getViewportWidth()
          Returns the viewport width.
static int getViewWidth(boolean full)
          Returns the view width.
static void setAutoIdPrefix(java.lang.String autoIdPrefix)
          Sets the auto id prefix which is prepended to the auto id counter when generating auto ids (defaults to 'x-auto').
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EMPTY_SAFE_STYLE

public static final SafeStyles EMPTY_SAFE_STYLE
An empty safe styles instance.

Constructor Detail

XDOM

public XDOM()
Method Detail

create

public static XElement create(SafeHtml html)
Creates a new element from the given markup.

Parameters:
html - the markup
Returns:
the new element

create

public static XElement create(java.lang.String html)
Creates an element form the given markup.

Parameters:
html - the markup
Returns:
the new element

createElementNS

public static Element createElementNS(java.lang.String ns,
                                      java.lang.String tag)
Creates an element of the given name space and tag.

Parameters:
ns - the name space of the element
tag - the tag of the element
Returns:
name space element

createTextNode

public static Element createTextNode(java.lang.String text)
Creates a text node from the given text.

Parameters:
text - the text to insert inside the node
Returns:
text node

getAutoIdPrefix

public static java.lang.String getAutoIdPrefix()
Returns the auto id prefix.

Returns:
the auto id prefix

getBodyScrollLeft

public static int getBodyScrollLeft()
Returns the body elements horizontal scroll.

Returns:
the scroll amount in pixels

getBodyScrollTop

public static int getBodyScrollTop()
Return the body elements vertical scroll.

Returns:
the scroll amount in pixels

getDocumentHeight

public static int getDocumentHeight()
Returns the document's height.

Returns:
the document height

getDocumentWidth

public static int getDocumentWidth()
Returns the document width.

Returns:
the document width

getHead

public static Element getHead()
Returns the HTML head element.

Returns:
the head

getScrollBarWidth

public static int getScrollBarWidth()
Returns the width of the scroll bar.

Returns:
the scroll bar width

getTopZIndex

public static int getTopZIndex()
Increments and returns the top z-index value. Use this value to ensure the z-index is the highest value of all elements in the DOM.

Returns:
the z-index

getTopZIndex

public static int getTopZIndex(int i)
Increments and returns the top z-index value. Use this value to ensure the z-index is the highest value of all elements in the DOM.

Parameters:
i - the increment amount
Returns:
the z-index

getUniqueId

public static java.lang.String getUniqueId()
Returns an unique id.

Returns:
the id

getViewHeight

public static int getViewHeight(boolean full)
Returns the view height.

Parameters:
full - true to return the document height, false for viewport height
Returns:
the view height

getViewportHeight

public static int getViewportHeight()
Returns the viewport height.

Returns:
the viewport height

getViewportSize

public static Size getViewportSize()
Returns the viewports size.

Returns:
the viewport size

getViewportWidth

public static int getViewportWidth()
Returns the viewport width.

Returns:
the viewport width

getViewWidth

public static int getViewWidth(boolean full)
Returns the view width.

Parameters:
full - true to return the document width, false for viewport width
Returns:
the view width

setAutoIdPrefix

public static void setAutoIdPrefix(java.lang.String autoIdPrefix)
Sets the auto id prefix which is prepended to the auto id counter when generating auto ids (defaults to 'x-auto').

Parameters:
autoIdPrefix - the auto id prefix


Copyright © 2012. All Rights Reserved.