|
GWT 2.7.0 | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.google.gwt.core.client.JavaScriptObject com.google.gwt.dom.client.Node com.google.gwt.dom.client.Document
public class Document
A Document is the root of the HTML hierarchy and holds the entire content. Besides providing access to the hierarchy, it also provides some convenience methods for accessing certain sets of information from the document.
Field Summary |
---|
Fields inherited from class com.google.gwt.dom.client.Node |
---|
DOCUMENT_NODE, ELEMENT_NODE, TEXT_NODE |
Constructor Summary | |
---|---|
protected |
Document()
|
Method Summary | |
---|---|
AnchorElement |
createAnchorElement()
Creates an <a> element. |
AreaElement |
createAreaElement()
Creates an <area> element. |
AudioElement |
createAudioElement()
Creates an <audio> element. |
BaseElement |
createBaseElement()
Creates a <base> element. |
QuoteElement |
createBlockQuoteElement()
Creates a <blockquote> element. |
NativeEvent |
createBlurEvent()
Creates a 'blur' event. |
BRElement |
createBRElement()
Creates a <br> element. |
ButtonElement |
createButtonElement()
Deprecated. use createPushButtonElement() ,
createResetButtonElement() or
createSubmitButtonElement() instead. |
InputElement |
createButtonInputElement()
Creates an <input type='button'> element. |
CanvasElement |
createCanvasElement()
Creates a <canvas> element. |
TableCaptionElement |
createCaptionElement()
Creates a <caption> element. |
NativeEvent |
createChangeEvent()
Creates a 'change' event. |
InputElement |
createCheckInputElement()
Creates an <input type='checkbox'> element. |
NativeEvent |
createClickEvent(int detail,
int screenX,
int screenY,
int clientX,
int clientY,
boolean ctrlKey,
boolean altKey,
boolean shiftKey,
boolean metaKey)
Creates a 'click' event. |
TableColElement |
createColElement()
Creates a <col> element. |
TableColElement |
createColGroupElement()
Creates a <colgroup> element. |
NativeEvent |
createContextMenuEvent()
Creates a 'contextmenu' event. |
NativeEvent |
createDblClickEvent(int detail,
int screenX,
int screenY,
int clientX,
int clientY,
boolean ctrlKey,
boolean altKey,
boolean shiftKey,
boolean metaKey)
Creates a 'dblclick' event. |
ModElement |
createDelElement()
Creates a <del> element. |
DivElement |
createDivElement()
Creates a <div> element. |
DListElement |
createDLElement()
Creates a <dl> element. |
Element |
createElement(java.lang.String tagName)
Creates a new element. |
NativeEvent |
createErrorEvent()
Creates an 'error' event. |
FieldSetElement |
createFieldSetElement()
Creates a <fieldset> element. |
InputElement |
createFileInputElement()
Creates an <input type='file'> element. |
NativeEvent |
createFocusEvent()
Creates a 'focus' event. |
FormElement |
createFormElement()
Creates a <form> element. |
FrameElement |
createFrameElement()
Creates a <frame> element. |
FrameSetElement |
createFrameSetElement()
Creates a <frameset> element. |
HeadElement |
createHeadElement()
Creates a <head> element. |
HeadingElement |
createHElement(int n)
Creates an <h(n)> element. |
InputElement |
createHiddenInputElement()
Creates an <input type='hidden'> element. |
HRElement |
createHRElement()
Creates an <hr> element. |
NativeEvent |
createHtmlEvent(java.lang.String type,
boolean canBubble,
boolean cancelable)
Creates an event. |
IFrameElement |
createIFrameElement()
Creates an <iframe> element. |
ImageElement |
createImageElement()
Creates an <img> element. |
InputElement |
createImageInputElement()
Creates an <input type='image'> element. |
ModElement |
createInsElement()
Creates an <ins> element. |
NativeEvent |
createKeyCodeEvent(java.lang.String type,
boolean ctrlKey,
boolean altKey,
boolean shiftKey,
boolean metaKey,
int keyCode)
Creates a key-code event ('keydown' or 'keyup'). |
NativeEvent |
createKeyDownEvent(boolean ctrlKey,
boolean altKey,
boolean shiftKey,
boolean metaKey,
int keyCode)
Creates a 'keydown' event. |
NativeEvent |
createKeyDownEvent(boolean ctrlKey,
boolean altKey,
boolean shiftKey,
boolean metaKey,
int keyCode,
int charCode)
Deprecated. as of GWT2.1 (keydown events don't have a charCode), use createKeyDownEvent(boolean, boolean, boolean, boolean, int) |
NativeEvent |
createKeyEvent(java.lang.String type,
boolean canBubble,
boolean cancelable,
boolean ctrlKey,
boolean altKey,
boolean shiftKey,
boolean metaKey,
int keyCode,
int charCode)
Deprecated. use createKeyCodeEvent(String, boolean, boolean, boolean, boolean, int)
or
createKeyPressEvent(boolean, boolean, boolean, boolean, int) |
NativeEvent |
createKeyPressEvent(boolean ctrlKey,
boolean altKey,
boolean shiftKey,
boolean metaKey,
int charCode)
Creates a 'keypress' event. |
NativeEvent |
createKeyPressEvent(boolean ctrlKey,
boolean altKey,
boolean shiftKey,
boolean metaKey,
int keyCode,
int charCode)
Deprecated. as of GWT 2.1 (keypress events don't have a keyCode), use createKeyPressEvent(boolean, boolean, boolean, boolean, int) |
NativeEvent |
createKeyUpEvent(boolean ctrlKey,
boolean altKey,
boolean shiftKey,
boolean metaKey,
int keyCode)
Creates a 'keyup' event. |
NativeEvent |
createKeyUpEvent(boolean ctrlKey,
boolean altKey,
boolean shiftKey,
boolean metaKey,
int keyCode,
int charCode)
Deprecated. as of GWT 2.1 (keyup events don't have a charCode), use createKeyUpEvent(boolean, boolean, boolean, boolean, int) |
LabelElement |
createLabelElement()
Creates a <label> element. |
LegendElement |
createLegendElement()
Creates a <legend> element. |
LIElement |
createLIElement()
Creates a <li> element. |
LinkElement |
createLinkElement()
Creates a <link> element. |
NativeEvent |
createLoadEvent()
Creates a 'load' event. |
MapElement |
createMapElement()
Creates a <map> element. |
MetaElement |
createMetaElement()
Creates a <meta> element. |
NativeEvent |
createMouseDownEvent(int detail,
int screenX,
int screenY,
int clientX,
int clientY,
boolean ctrlKey,
boolean altKey,
boolean shiftKey,
boolean metaKey,
int button)
Creates a 'mousedown' event. |
NativeEvent |
createMouseEvent(java.lang.String type,
boolean canBubble,
boolean cancelable,
int detail,
int screenX,
int screenY,
int clientX,
int clientY,
boolean ctrlKey,
boolean altKey,
boolean shiftKey,
boolean metaKey,
int button,
Element relatedTarget)
Creates an mouse event. |
NativeEvent |
createMouseMoveEvent(int detail,
int screenX,
int screenY,
int clientX,
int clientY,
boolean ctrlKey,
boolean altKey,
boolean shiftKey,
boolean metaKey,
int button)
Creates a 'mousemove' event. |
NativeEvent |
createMouseOutEvent(int detail,
int screenX,
int screenY,
int clientX,
int clientY,
boolean ctrlKey,
boolean altKey,
boolean shiftKey,
boolean metaKey,
int button,
Element relatedTarget)
Creates a 'mouseout' event. |
NativeEvent |
createMouseOverEvent(int detail,
int screenX,
int screenY,
int clientX,
int clientY,
boolean ctrlKey,
boolean altKey,
boolean shiftKey,
boolean metaKey,
int button,
Element relatedTarget)
Creates a 'mouseover' event. |
NativeEvent |
createMouseUpEvent(int detail,
int screenX,
int screenY,
int clientX,
int clientY,
boolean ctrlKey,
boolean altKey,
boolean shiftKey,
boolean metaKey,
int button)
Creates a 'mouseup' event. |
ObjectElement |
createObjectElement()
Creates a <object> element. |
OListElement |
createOLElement()
Creates an <ol> element. |
OptGroupElement |
createOptGroupElement()
Creates an <optgroup> element. |
OptionElement |
createOptionElement()
Creates an <option> element. |
ParamElement |
createParamElement()
Creates a <param> element. |
InputElement |
createPasswordInputElement()
Creates an <input type='password'> element. |
ParagraphElement |
createPElement()
Creates a <p> element. |
PreElement |
createPreElement()
Creates a <pre> element. |
ButtonElement |
createPushButtonElement()
Creates a <button type='button'> element. |
QuoteElement |
createQElement()
Creates a <q> element. |
InputElement |
createRadioInputElement(java.lang.String name)
Creates an <input type='radio'> element. |
ButtonElement |
createResetButtonElement()
Creates a <button type='reset'> element. |
InputElement |
createResetInputElement()
Creates an <input type='reset'> element. |
ScriptElement |
createScriptElement()
Creates a <script> element. |
ScriptElement |
createScriptElement(java.lang.String source)
Creates a <script> element. |
NativeEvent |
createScrollEvent()
Creates a 'scroll' event. |
SelectElement |
createSelectElement()
Creates a <select> element. |
SelectElement |
createSelectElement(boolean multiple)
Deprecated. |
SourceElement |
createSourceElement()
Creates an <source> element. |
SpanElement |
createSpanElement()
Creates a <span> element. |
StyleElement |
createStyleElement()
Creates a <style> element. |
ButtonElement |
createSubmitButtonElement()
Creates a <button type='submit'> element. |
InputElement |
createSubmitInputElement()
Creates an <input type='submit'> element. |
TableElement |
createTableElement()
Creates a <table> element. |
TableSectionElement |
createTBodyElement()
Creates a <tbody> element. |
TableCellElement |
createTDElement()
Creates a <td> element. |
TextAreaElement |
createTextAreaElement()
Creates a <textarea> element. |
InputElement |
createTextInputElement()
Creates an <input type='text'> element. |
Text |
createTextNode(java.lang.String data)
Creates a text node. |
TableSectionElement |
createTFootElement()
Creates a <tfoot> element. |
TableSectionElement |
createTHeadElement()
Creates a <thead> element. |
TableCellElement |
createTHElement()
Creates a <th> element. |
TitleElement |
createTitleElement()
Creates a <title> element. |
TableRowElement |
createTRElement()
Creates a <tr> element. |
UListElement |
createULElement()
Creates a <ul> element. |
java.lang.String |
createUniqueId()
Creates an identifier guaranteed to be unique within this document. |
VideoElement |
createVideoElement()
Creates a <video> element. |
void |
enableScrolling(boolean enable)
Enables or disables scrolling of the document. |
static Document |
get()
Gets the default document. |
BodyElement |
getBody()
The element that contains the content for the document. |
int |
getBodyOffsetLeft()
Returns the left offset between the absolute coordinate system and the body's positioning context. |
int |
getBodyOffsetTop()
Returns the top offset between the absolute coordinate system and the body's positioning context. |
int |
getClientHeight()
The height of the document's client area. |
int |
getClientWidth()
The width of the document's client area. |
java.lang.String |
getCompatMode()
Gets the document's "compatibility mode", typically used for determining whether the document is in "quirks" or "strict" mode. |
Element |
getDocumentElement()
Gets the document's element. |
java.lang.String |
getDomain()
The domain name of the server that served the document, or null if the server cannot be identified by a domain name. |
Element |
getElementById(java.lang.String elementId)
Returns the Element whose id is given by elementId. |
NodeList<Element> |
getElementsByTagName(java.lang.String tagName)
Returns a NodeList of all the Elements with a given
tag name in the order in which they are encountered in a preorder traversal
of the document tree. |
HeadElement |
getHead()
The element that contains metadata about the document, including links to or definitions of scripts and style sheets. |
java.lang.String |
getReferrer()
Returns the URI of the page that linked to this page. |
int |
getScrollHeight()
The height of the scrollable area of the document. |
int |
getScrollLeft()
The number of pixels that the document's content is scrolled from the left. |
int |
getScrollTop()
The number of pixels that the document's content is scrolled from the top. |
int |
getScrollWidth()
The width of the scrollable area of the document. |
java.lang.String |
getTitle()
Gets the title of a document as specified by the TITLE element in the head of the document. |
java.lang.String |
getURL()
Gets the absolute URI of this document. |
(package private) Element |
getViewportElement()
Gets the document's viewport element. |
void |
importNode(Node node,
boolean deep)
Imports a node from another document to this document. |
boolean |
isCSS1Compat()
Determines whether the document's "compatMode" is "CSS1Compat". |
void |
setScrollLeft(int left)
Sets the number of pixels that the document's content is scrolled from the left. |
void |
setScrollTop(int top)
Sets the number of pixels that the document's content is scrolled from the top. |
void |
setTitle(java.lang.String title)
Sets the title of a document as specified by the TITLE element in the head of the document. |
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, removeAllChildren, removeChild, removeFromParent, replaceChild, setNodeValue |
Methods inherited from class com.google.gwt.core.client.JavaScriptObject |
---|
cast, createArray, 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 static Document get()
public final AnchorElement createAnchorElement()
public final AreaElement createAreaElement()
public final AudioElement createAudioElement()
public final BaseElement createBaseElement()
public final QuoteElement createBlockQuoteElement()
public final NativeEvent createBlurEvent()
public final BRElement createBRElement()
@Deprecated public final ButtonElement createButtonElement()
createPushButtonElement()
,
createResetButtonElement()
or
createSubmitButtonElement()
instead.
Warning! The button type is actually implementation-dependent and is read-only.
public final InputElement createButtonInputElement()
public final CanvasElement createCanvasElement()
public final TableCaptionElement createCaptionElement()
public final NativeEvent createChangeEvent()
public final InputElement createCheckInputElement()
public final NativeEvent createClickEvent(int detail, int screenX, int screenY, int clientX, int clientY, boolean ctrlKey, boolean altKey, boolean shiftKey, boolean metaKey)
Note that this method does not allow the event's 'button' field to be specified, because not all browsers support it reliably for click events.
detail
- the event's detail propertyscreenX
- the event's screen-relative x-positionscreenY
- the event's screen-relative y-positionclientX
- the event's client-relative x-positionclientY
- the event's client-relative y-positionctrlKey
- true
if the ctrl key is depressedaltKey
- true
if the alt key is depressedshiftKey
- true
if the shift key is depressedmetaKey
- true
if the meta key is depressed
public final TableColElement createColElement()
public final TableColElement createColGroupElement()
public final NativeEvent createContextMenuEvent()
public final NativeEvent createDblClickEvent(int detail, int screenX, int screenY, int clientX, int clientY, boolean ctrlKey, boolean altKey, boolean shiftKey, boolean metaKey)
Note that this method does not allow the event's 'button' field to be specified, because not all browsers support it reliably for click events.
Note that on some browsers, this may cause 'click' events to be synthesized as well.
detail
- the event's detail propertyscreenX
- the event's screen-relative x-positionscreenY
- the event's screen-relative y-positionclientX
- the event's client-relative x-positionclientY
- the event's client-relative y-positionctrlKey
- true
if the ctrl key is depressedaltKey
- true
if the alt key is depressedshiftKey
- true
if the shift key is depressedmetaKey
- true
if the meta key is depressed
public final ModElement createDelElement()
public final DivElement createDivElement()
public final DListElement createDLElement()
public final Element createElement(java.lang.String tagName)
tagName
- the tag name of the element to be created
public final NativeEvent createErrorEvent()
public final FieldSetElement createFieldSetElement()
public final InputElement createFileInputElement()
public final NativeEvent createFocusEvent()
public final FormElement createFormElement()
public final FrameElement createFrameElement()
public final FrameSetElement createFrameSetElement()
public final HeadElement createHeadElement()
public final HeadingElement createHElement(int n)
n
- the type of heading, from 1 to 6 inclusive
public final InputElement createHiddenInputElement()
public final HRElement createHRElement()
public final NativeEvent createHtmlEvent(java.lang.String type, boolean canBubble, boolean cancelable)
While this method may be used to create events directly, it is generally
preferable to use existing helper methods such as
createFocusEvent()
.
Also, note that on Internet Explorer the 'canBubble' and 'cancelable' arguments will be ignored (the event's behavior is inferred by the browser based upon its type).
type
- the type of event (e.g., BrowserEvents.FOCUS, BrowserEvents.LOAD, etc)canBubble
- true
if the event should bubblecancelable
- true
if the event should be cancelable
public final IFrameElement createIFrameElement()
public final ImageElement createImageElement()
public final InputElement createImageInputElement()
public final ModElement createInsElement()
public final NativeEvent createKeyCodeEvent(java.lang.String type, boolean ctrlKey, boolean altKey, boolean shiftKey, boolean metaKey, int keyCode)
While this method may be used to create events directly, it is generally
preferable to use existing helper methods such as
createKeyDownEvent(boolean, boolean, boolean, boolean, int)
or
createKeyUpEvent(boolean, boolean, boolean, boolean, int)
.
type
- the type of event (e.g., BrowserEvents.KEYDOWN, BrowserEvents.KEYPRESS, etc)ctrlKey
- true
if the ctrl key is depressedaltKey
- true
if the alt key is depressedshiftKey
- true
if the shift key is depressedmetaKey
- true
if the meta key is depressedkeyCode
- the key-code to be set on the event
public final NativeEvent createKeyDownEvent(boolean ctrlKey, boolean altKey, boolean shiftKey, boolean metaKey, int keyCode)
ctrlKey
- true
if the ctrl key is depressedaltKey
- true
if the alt key is depressedshiftKey
- true
if the shift key is depressedmetaKey
- true
if the meta key is depressedkeyCode
- the key-code to be set on the event
@Deprecated public final NativeEvent createKeyDownEvent(boolean ctrlKey, boolean altKey, boolean shiftKey, boolean metaKey, int keyCode, int charCode)
createKeyDownEvent(boolean, boolean, boolean, boolean, int)
ctrlKey
- true
if the ctrl key is depressedaltKey
- true
if the alt key is depressedshiftKey
- true
if the shift key is depressedmetaKey
- true
if the meta key is depressedkeyCode
- the key-code to be set on the eventcharCode
- the char-code to be set on the event
@Deprecated public final NativeEvent createKeyEvent(java.lang.String type, boolean canBubble, boolean cancelable, boolean ctrlKey, boolean altKey, boolean shiftKey, boolean metaKey, int keyCode, int charCode)
createKeyCodeEvent(String, boolean, boolean, boolean, boolean, int)
or
createKeyPressEvent(boolean, boolean, boolean, boolean, int)
While this method may be used to create events directly, it is generally
preferable to use existing helper methods such as
createKeyPressEvent(boolean, boolean, boolean, boolean, int, int)
.
Also, note that on Internet Explorer the 'canBubble' and 'cancelable' arguments will be ignored (the event's behavior is inferred by the browser based upon its type).
type
- the type of event (e.g., BrowserEvents.KEYDOWN, BrowserEvents.KEYPRESS, etc)canBubble
- true
if the event should bubblecancelable
- true
if the event should be cancelablectrlKey
- true
if the ctrl key is depressedaltKey
- true
if the alt key is depressedshiftKey
- true
if the shift key is depressedmetaKey
- true
if the meta key is depressedkeyCode
- the key-code to be set on the eventcharCode
- the char-code to be set on the event
public final NativeEvent createKeyPressEvent(boolean ctrlKey, boolean altKey, boolean shiftKey, boolean metaKey, int charCode)
ctrlKey
- true
if the ctrl key is depressedaltKey
- true
if the alt key is depressedshiftKey
- true
if the shift key is depressedmetaKey
- true
if the meta key is depressedcharCode
- the char-code to be set on the event
@Deprecated public final NativeEvent createKeyPressEvent(boolean ctrlKey, boolean altKey, boolean shiftKey, boolean metaKey, int keyCode, int charCode)
createKeyPressEvent(boolean, boolean, boolean, boolean, int)
ctrlKey
- true
if the ctrl key is depressedaltKey
- true
if the alt key is depressedshiftKey
- true
if the shift key is depressedmetaKey
- true
if the meta key is depressedkeyCode
- the key-code to be set on the eventcharCode
- the char-code to be set on the event
public final NativeEvent createKeyUpEvent(boolean ctrlKey, boolean altKey, boolean shiftKey, boolean metaKey, int keyCode)
ctrlKey
- true
if the ctrl key is depressedaltKey
- true
if the alt key is depressedshiftKey
- true
if the shift key is depressedmetaKey
- true
if the meta key is depressedkeyCode
- the key-code to be set on the event
@Deprecated public final NativeEvent createKeyUpEvent(boolean ctrlKey, boolean altKey, boolean shiftKey, boolean metaKey, int keyCode, int charCode)
createKeyUpEvent(boolean, boolean, boolean, boolean, int)
ctrlKey
- true
if the ctrl key is depressedaltKey
- true
if the alt key is depressedshiftKey
- true
if the shift key is depressedmetaKey
- true
if the meta key is depressedkeyCode
- the key-code to be set on the eventcharCode
- the char-code to be set on the event
public final LabelElement createLabelElement()
public final LegendElement createLegendElement()
public final LIElement createLIElement()
public final LinkElement createLinkElement()
public final NativeEvent createLoadEvent()
public final MapElement createMapElement()
public final MetaElement createMetaElement()
public final NativeEvent createMouseDownEvent(int detail, int screenX, int screenY, int clientX, int clientY, boolean ctrlKey, boolean altKey, boolean shiftKey, boolean metaKey, int button)
detail
- the event's detail propertyscreenX
- the event's screen-relative x-positionscreenY
- the event's screen-relative y-positionclientX
- the event's client-relative x-positionclientY
- the event's client-relative y-positionctrlKey
- true
if the ctrl key is depressedaltKey
- true
if the alt key is depressedshiftKey
- true
if the shift key is depressedmetaKey
- true
if the meta key is depressedbutton
- the event's button property (values from
NativeEvent.BUTTON_LEFT
et al)
public final NativeEvent createMouseEvent(java.lang.String type, boolean canBubble, boolean cancelable, int detail, int screenX, int screenY, int clientX, int clientY, boolean ctrlKey, boolean altKey, boolean shiftKey, boolean metaKey, int button, Element relatedTarget)
While this method may be used to create events directly, it is generally
preferable to use existing helper methods such as
createClickEvent(int, int, int, int, int, boolean, boolean, boolean, boolean)
.
Also, note that on Internet Explorer the 'canBubble' and 'cancelable' arguments will be ignored (the event's behavior is inferred by the browser based upon its type).
type
- the type of event (e.g., BrowserEvents.FOCUS, BrowserEvents.LOAD, etc)canBubble
- true
if the event should bubblecancelable
- true
if the event should be cancelabledetail
- the event's detail propertyscreenX
- the event's screen-relative x-positionscreenY
- the event's screen-relative y-positionclientX
- the event's client-relative x-positionclientY
- the event's client-relative y-positionctrlKey
- true
if the ctrl key is depressedaltKey
- true
if the alt key is depressedshiftKey
- true
if the shift key is depressedmetaKey
- true
if the meta key is depressedbutton
- the event's button property (values from
NativeEvent.BUTTON_LEFT
et al)relatedTarget
- the event's related target (only relevant for
mouseover and mouseout events)
public final NativeEvent createMouseMoveEvent(int detail, int screenX, int screenY, int clientX, int clientY, boolean ctrlKey, boolean altKey, boolean shiftKey, boolean metaKey, int button)
detail
- the event's detail propertyscreenX
- the event's screen-relative x-positionscreenY
- the event's screen-relative y-positionclientX
- the event's client-relative x-positionclientY
- the event's client-relative y-positionctrlKey
- true
if the ctrl key is depressedaltKey
- true
if the alt key is depressedshiftKey
- true
if the shift key is depressedmetaKey
- true
if the meta key is depressedbutton
- the event's button property (values from
NativeEvent.BUTTON_LEFT
et al)
public final NativeEvent createMouseOutEvent(int detail, int screenX, int screenY, int clientX, int clientY, boolean ctrlKey, boolean altKey, boolean shiftKey, boolean metaKey, int button, Element relatedTarget)
detail
- the event's detail propertyscreenX
- the event's screen-relative x-positionscreenY
- the event's screen-relative y-positionclientX
- the event's client-relative x-positionclientY
- the event's client-relative y-positionctrlKey
- true
if the ctrl key is depressedaltKey
- true
if the alt key is depressedshiftKey
- true
if the shift key is depressedmetaKey
- true
if the meta key is depressedbutton
- the event's button property (values from
NativeEvent.BUTTON_LEFT
et al)relatedTarget
- the event's related target
public final NativeEvent createMouseOverEvent(int detail, int screenX, int screenY, int clientX, int clientY, boolean ctrlKey, boolean altKey, boolean shiftKey, boolean metaKey, int button, Element relatedTarget)
detail
- the event's detail propertyscreenX
- the event's screen-relative x-positionscreenY
- the event's screen-relative y-positionclientX
- the event's client-relative x-positionclientY
- the event's client-relative y-positionctrlKey
- true
if the ctrl key is depressedaltKey
- true
if the alt key is depressedshiftKey
- true
if the shift key is depressedmetaKey
- true
if the meta key is depressedbutton
- the event's button property (values from
NativeEvent.BUTTON_LEFT
et al)relatedTarget
- the event's related target
public final NativeEvent createMouseUpEvent(int detail, int screenX, int screenY, int clientX, int clientY, boolean ctrlKey, boolean altKey, boolean shiftKey, boolean metaKey, int button)
detail
- the event's detail propertyscreenX
- the event's screen-relative x-positionscreenY
- the event's screen-relative y-positionclientX
- the event's client-relative x-positionclientY
- the event's client-relative y-positionctrlKey
- true
if the ctrl key is depressedaltKey
- true
if the alt key is depressedshiftKey
- true
if the shift key is depressedmetaKey
- true
if the meta key is depressedbutton
- the event's button property (values from
NativeEvent.BUTTON_LEFT
et al)
public final ObjectElement createObjectElement()
public final OListElement createOLElement()
public final OptGroupElement createOptGroupElement()
public final OptionElement createOptionElement()
public final ParamElement createParamElement()
public final InputElement createPasswordInputElement()
public final ParagraphElement createPElement()
public final PreElement createPreElement()
public final ButtonElement createPushButtonElement()
public final QuoteElement createQElement()
public final InputElement createRadioInputElement(java.lang.String name)
name
- the name of the radio input (used for grouping)
public final ButtonElement createResetButtonElement()
public final InputElement createResetInputElement()
public final ScriptElement createScriptElement()
public final ScriptElement createScriptElement(java.lang.String source)
source
- the source code to set inside the element
public final NativeEvent createScrollEvent()
public final SelectElement createSelectElement()
@Deprecated public final SelectElement createSelectElement(boolean multiple)
multiple
- true
to allow multiple-selection
public final SourceElement createSourceElement()
public final SpanElement createSpanElement()
public final StyleElement createStyleElement()
public final ButtonElement createSubmitButtonElement()
public final InputElement createSubmitInputElement()
public final TableElement createTableElement()
public final TableSectionElement createTBodyElement()
public final TableCellElement createTDElement()
public final TextAreaElement createTextAreaElement()
public final InputElement createTextInputElement()
public final Text createTextNode(java.lang.String data)
data
- the text node's initial text
public final TableSectionElement createTFootElement()
public final TableSectionElement createTHeadElement()
public final TableCellElement createTHElement()
public final TitleElement createTitleElement()
public final TableRowElement createTRElement()
public final UListElement createULElement()
public final java.lang.String createUniqueId()
public final VideoElement createVideoElement()
public final void enableScrolling(boolean enable)
enable
- whether scrolling should be enabled or disabledpublic final BodyElement getBody()
public final int getBodyOffsetLeft()
For example, to position an element directly under the mouse cursor (assuming you are handling a mouse event), do the following:
Event event; Document doc; DivElement child; // assume absolutely-positioned child of the body // Get the event location in absolute coordinates. int absX = event.getClientX() + Window.getScrollLeft(); int absY = event.getClientY() + Window.getScrollTop(); // Position the child element, adjusting for the difference between the // absolute coordinate system and the body's positioning coordinates. child.getStyle().setPropertyPx("left", absX - doc.getBodyOffsetLeft()); child.getStyle().setPropertyPx("top", absY - doc.getBodyOffsetTop());
public final int getBodyOffsetTop()
getBodyOffsetLeft()
public final int getClientHeight()
public final int getClientWidth()
public final java.lang.String getCompatMode()
public final Element getDocumentElement()
public final java.lang.String getDomain()
null
if none existspublic final Element getElementById(java.lang.String elementId)
Element
whose id is given by elementId. If no such
element exists, returns null. Behavior is not defined if more than one
element has this id.
elementId
- the unique id value for an element
public final NodeList<Element> getElementsByTagName(java.lang.String tagName)
NodeList
of all the Elements
with a given
tag name in the order in which they are encountered in a preorder traversal
of the document tree.
tagName
- the name of the tag to match on (the special value
"*"
matches all tags)
public final HeadElement getHead()
public final java.lang.String getReferrer()
public final int getScrollHeight()
public final int getScrollLeft()
If the document is in RTL mode, this method will return a negative value of the number of pixels scrolled from the right.
public final int getScrollTop()
public final int getScrollWidth()
public final java.lang.String getTitle()
public final java.lang.String getURL()
public final void importNode(Node node, boolean deep)
Node.getParentNode()
is null).
The source node is not altered or removed from the original document; this
method creates a new copy of the source node.
For all nodes, importing a node creates a node object owned by the
importing document, with attribute values identical to the source node's
nodeName and nodeType, plus the attributes related to namespaces (prefix,
localName, and namespaceURI). As in the cloneNode operation on a Node, the
source node is not altered. Additional information is copied as appropriate
to the nodeType, attempting to mirror the behavior expected if a fragment
of XML or HTML source was copied from one document to another, recognizing
that the two documents may have different DTDs in the XML case.
node
- the node to importdeep
- If true
, recursively import the subtree under the
specified node; if false
, import only the node
itself, as explained abovepublic final boolean isCSS1Compat()
true
if the document is in CSS1Compat modepublic final void setScrollLeft(int left)
left
- the document's left scroll positionpublic final void setScrollTop(int top)
top
- the document's top scroll positionpublic final void setTitle(java.lang.String title)
title
- the document's new titlefinal Element getViewportElement()
|
GWT 2.7.0 | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |