Java Doc for DOM.java in  » Ajax » GWT » com » google » gwt » user » client » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Ajax » GWT » com.google.gwt.user.client 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   com.google.gwt.user.client.DOM

DOM
public class DOM (Code)
This class provides a set of static methods that allow you to manipulate the browser's Document Object Model (DOM). It contains methods for manipulating both com.google.gwt.user.client.Element elements and com.google.gwt.user.client.Event events .




Method Summary
public static  voidaddEventPreview(EventPreview preview)
     Adds an event preview to the preview stack.
public static  voidappendChild(Element parent, Element child)
     Appends one element to another's list of children.
public static  booleancompare(Element elem1, Element elem2)
     Compares two elements for equality (note that reference equality is not sufficient to determine equality among elements on most browsers).
public static  ElementcreateAnchor()
     Creates an HTML A element.
public static  ElementcreateButton()
     Creates an HTML BUTTON element.
public static  ElementcreateCaption()
     Creates an HTML CAPTION element.
public static  ElementcreateCol()
     Creates an HTML COL element.
public static  ElementcreateColGroup()
     Creates an HTML COLGROUP element.
public static  ElementcreateDiv()
     Creates an HTML DIV element.
public static  ElementcreateElement(String tagName)
     Creates an HTML element.
public static  ElementcreateFieldSet()
     Creates an HTML FIELDSET element.
public static  ElementcreateForm()
     Creates an HTML FORM element.
public static  ElementcreateIFrame()
     Creates an HTML IFRAME element.
public static  ElementcreateImg()
     Creates an HTML IMG element.
public static  ElementcreateInputCheck()
     Creates an HTML INPUT type='CHECK' element.
public static  ElementcreateInputPassword()
     Creates an HTML INPUT type='PASSWORD' element.
public static  ElementcreateInputRadio(String name)
     Creates an HTML INPUT type='RADIO' element.
public static  ElementcreateInputText()
     Creates an HTML INPUT type='TEXT' element.
public static  ElementcreateLabel()
     Creates an HTML LABEL element.
public static  ElementcreateLegend()
     Creates an HTML LEGEND element.
public static  ElementcreateOptions()
     Creates an HTML OPTIONS element.
public static  ElementcreateSelect()
     Creates a single-selection HTML SELECT element.
public static  ElementcreateSelect(boolean multiple)
     Creates an HTML SELECT element.
public static  ElementcreateSpan()
     Creates an HTML SPAN element.
public static  ElementcreateTBody()
     Creates an HTML TBODY element.
public static  ElementcreateTD()
     Creates an HTML TD element.
public static  ElementcreateTFoot()
     Creates an HTML TFOOT element.
public static  ElementcreateTH()
     Creates an HTML TH element.
public static  ElementcreateTHead()
     Creates an HTML THEAD element.
public static  ElementcreateTR()
     Creates an HTML TR element.
public static  ElementcreateTable()
     Creates an HTML TABLE element.
public static  ElementcreateTextArea()
     Creates an HTML TEXTAREA element.
static  voiddispatchEvent(Event evt, Element elem, EventListener listener)
     This method is called directly by native code when any event is fired.
public static  voideventCancelBubble(Event evt, boolean cancel)
     Cancels bubbling for the given event.
public static  booleaneventGetAltKey(Event evt)
     Gets whether the ALT key was depressed when the given event occurred.
public static  inteventGetButton(Event evt)
     Gets the mouse buttons that were depressed when the given event occurred.
public static  inteventGetClientX(Event evt)
     Gets the mouse x-position within the browser window's client area.
public static  inteventGetClientY(Event evt)
     Gets the mouse y-position within the browser window's client area.
public static  booleaneventGetCtrlKey(Event evt)
     Gets whether the CTRL key was depressed when the given event occurred.
public static  EventeventGetCurrentEvent()
     Gets the current event that is being fired.
public static  ElementeventGetCurrentTarget(Event evt)
     Gets the current target element of the given event.
public static  ElementeventGetFromElement(Event evt)
     Gets the element from which the mouse pointer was moved (only valid for Event.ONMOUSEOVER ).
public static  inteventGetKeyCode(Event evt)
     Gets the key code associated with this event.

For Event.ONKEYPRESS , this method returns the Unicode value of the character generated.

public static  booleaneventGetMetaKey(Event evt)
     Gets whether the META key was depressed when the given event occurred.
public static  inteventGetMouseWheelVelocityY(Event evt)
     Gets the velocity of the mouse wheel associated with the event along the Y axis.

The velocity of the event is an artifical measurement for relative comparisons of wheel activity.

public static  booleaneventGetRepeat(Event evt)
     Gets the key-repeat state of this event.
public static  inteventGetScreenX(Event evt)
     Gets the mouse x-position on the user's display.
public static  inteventGetScreenY(Event evt)
     Gets the mouse y-position on the user's display.
public static  booleaneventGetShiftKey(Event evt)
     Gets whether the shift key was depressed when the given event occurred.
public static  ElementeventGetTarget(Event evt)
     Returns the element that was the actual target of the given event.
public static  ElementeventGetToElement(Event evt)
     Gets the element to which the mouse pointer was moved (only valid for Event.ONMOUSEOUT ).
public static  inteventGetType(Event evt)
     Gets the enumerated type of this event (as defined in Event ).
public static  StringeventGetTypeString(Event evt)
     Gets the type of the given event as a string.
public static  voideventPreventDefault(Event evt)
     Prevents the browser from taking its default action for the given event.
public static  voideventSetKeyCode(Event evt, char key)
     Sets the key code associated with the given keyboard event.
public static  StringeventToString(Event evt)
     Returns a stringized version of the event.
public static  intgetAbsoluteLeft(Element elem)
     Gets an element's absolute left coordinate in the document's coordinate system.
public static  intgetAbsoluteTop(Element elem)
     Gets an element's absolute top coordinate in the document's coordinate system.
public static  StringgetAttribute(Element elem, String attr)
     Gets any named attribute from an element, as a string.
public static  booleangetBooleanAttribute(Element elem, String attr)
     Gets a boolean attribute on the given element.
public static  ElementgetCaptureElement()
     Gets the element that currently has mouse capture.
public static  ElementgetChild(Element parent, int index)
     Gets an element's n-th child element.
public static  intgetChildCount(Element parent)
     Gets the number of child elements present in a given parent element.
public static  intgetChildIndex(Element parent, Element child)
     Gets the index of a given child element within its parent.
public static  StringgetElementAttribute(Element elem, String attr)
     Gets the named attribute from the element.
public static  ElementgetElementById(String id)
     Gets the element associated with the given unique id within the entire document.
public static  StringgetElementProperty(Element elem, String prop)
     Gets any named property from an element, as a string.
public static  booleangetElementPropertyBoolean(Element elem, String prop)
     Gets any named property from an element, as a boolean.
public static  intgetElementPropertyInt(Element elem, String prop)
     Gets any named property from an element, as an int.
public static  intgetEventsSunk(Element elem)
     Gets the current set of events sunk by a given element.
public static  ElementgetFirstChild(Element elem)
     Gets the first child element of the given element.
public static  StringgetImgSrc(Element img)
     Gets the src attribute of an img element.
public static  StringgetInnerHTML(Element elem)
     Gets an HTML representation of an element's children.
public static  StringgetInnerText(Element elem)
     Gets the text contained within an element.
public static  intgetIntAttribute(Element elem, String attr)
     Gets an integer attribute on a given element.
public static  intgetIntStyleAttribute(Element elem, String attr)
     Gets an integer attribute on a given element's style.
public static  ElementgetNextSibling(Element elem)
     Gets an element's next sibling element.
public static  ElementgetParent(Element elem)
     Gets an element's parent element.
public static  StringgetStyleAttribute(Element elem, String attr)
     Gets an attribute of the given element's style.
public static  voidinsertBefore(Element parent, Element child, Element before)
     Inserts an element as a child of the given parent element, before another child of that parent.
public static  voidinsertChild(Element parent, Element child, int index)
     Inserts an element as a child of the given parent element.
public static  voidinsertListItem(Element select, String item, String value, int index)
     Creates an <option> element and inserts it as a child of the specified <select> element.
public static  booleanisOrHasChild(Element parent, Element child)
     Determine whether one element is equal to, or the child of, another.
static  booleanpreviewEvent(Event evt)
     This method is called directly by native code when event preview is being used.
public static  voidreleaseCapture(Element elem)
     Releases mouse capture on the given element.
public static  voidremoveChild(Element parent, Element child)
     Removes a child element from the given parent element.
public static  voidremoveElementAttribute(Element elem, String attr)
     Removes the named attribute from the given element.
public static  voidremoveEventPreview(EventPreview preview)
     Removes an element from the preview stack.
public static  voidscrollIntoView(Element elem)
     Scrolls the given element into view.

This method crawls up the DOM hierarchy, adjusting the scrollLeft and scrollTop properties of each scrollable element to ensure that the specified element is completely in view.

public static  voidsetAttribute(Element elem, String attr, String value)
     Sets an attribute on the given element.
public static  voidsetBooleanAttribute(Element elem, String attr, boolean value)
     Sets a boolean attribute on the given element.
public static  voidsetCapture(Element elem)
     Sets mouse-capture on the given element.
public static  voidsetElementAttribute(Element elem, String attr, String value)
     Sets an attribute on a given element.
public static  voidsetElementProperty(Element elem, String prop, String value)
     Sets a property on the given element.
public static  voidsetElementPropertyBoolean(Element elem, String prop, boolean value)
     Sets a boolean property on the given element.
public static  voidsetElementPropertyInt(Element elem, String prop, int value)
     Sets an int property on the given element.
public static  voidsetEventListener(Element elem, EventListener listener)
     Sets the EventListener to receive events for the given element.
public static  voidsetImgSrc(Element img, String src)
     Sets the src attribute of an img element.
public static  voidsetInnerHTML(Element elem, String html)
     Sets the HTML contained within an element.
public static  voidsetInnerText(Element elem, String text)
     Sets the text contained within an element.
public static  voidsetIntAttribute(Element elem, String attr, int value)
     Sets an integer attribute on the given element.
public static  voidsetIntStyleAttribute(Element elem, String attr, int value)
     Sets an integer attribute on the given element's style.
public static  voidsetOptionText(Element select, String text, int index)
     Sets the option text of the given select object.
public static  voidsetStyleAttribute(Element elem, String attr, String value)
     Sets an attribute on the given element's style.
public static  voidsinkEvents(Element elem, int eventBits)
     Sets the current set of events sunk by a given element.
public static  StringtoString(Element elem)
     Returns a stringized version of the element.
public static  intwindowGetClientHeight()
     Gets the height of the browser window's client area excluding the scroll bar.
public static  intwindowGetClientWidth()
     Gets the width of the browser window's client area excluding the vertical scroll bar.



Method Detail
addEventPreview
public static void addEventPreview(EventPreview preview)(Code)
Adds an event preview to the preview stack. As long as this preview remains on the top of the stack, it will receive all events before they are fired to their listeners. Note that the event preview will receive all events, including those received due to bubbling, whereas normal event handlers only receive explicitly sunk events.
Parameters:
  preview - the event preview to be added to the stack.



appendChild
public static void appendChild(Element parent, Element child)(Code)
Appends one element to another's list of children.
Parameters:
  parent - the parent element
Parameters:
  child - its new child



compare
public static boolean compare(Element elem1, Element elem2)(Code)
Compares two elements for equality (note that reference equality is not sufficient to determine equality among elements on most browsers).
Parameters:
  elem1 - the first element to be compared
Parameters:
  elem2 - the second element to be compared true if they are in fact the same element
See Also:   DOM.isOrHasChild(Element,Element)



createAnchor
public static Element createAnchor()(Code)
Creates an HTML A element. the newly-created element



createButton
public static Element createButton()(Code)
Creates an HTML BUTTON element. the newly-created element



createCaption
public static Element createCaption()(Code)
Creates an HTML CAPTION element. the newly-created element



createCol
public static Element createCol()(Code)
Creates an HTML COL element. the newly-created element



createColGroup
public static Element createColGroup()(Code)
Creates an HTML COLGROUP element. the newly-created element



createDiv
public static Element createDiv()(Code)
Creates an HTML DIV element. the newly-created element



createElement
public static Element createElement(String tagName)(Code)
Creates an HTML element.
Parameters:
  tagName - the HTML tag of the element to be created the newly-created element



createFieldSet
public static Element createFieldSet()(Code)
Creates an HTML FIELDSET element. the newly-created element



createForm
public static Element createForm()(Code)
Creates an HTML FORM element. the newly-created element



createIFrame
public static Element createIFrame()(Code)
Creates an HTML IFRAME element. the newly-created element



createImg
public static Element createImg()(Code)
Creates an HTML IMG element. the newly-created element



createInputCheck
public static Element createInputCheck()(Code)
Creates an HTML INPUT type='CHECK' element. the newly-created element



createInputPassword
public static Element createInputPassword()(Code)
Creates an HTML INPUT type='PASSWORD' element. the newly-created element



createInputRadio
public static Element createInputRadio(String name)(Code)
Creates an HTML INPUT type='RADIO' element.
Parameters:
  name - the name of the group with which this radio button will beassociated the newly-created element



createInputText
public static Element createInputText()(Code)
Creates an HTML INPUT type='TEXT' element. the newly-created element



createLabel
public static Element createLabel()(Code)
Creates an HTML LABEL element. the newly-created element



createLegend
public static Element createLegend()(Code)
Creates an HTML LEGEND element. the newly-created element



createOptions
public static Element createOptions()(Code)
Creates an HTML OPTIONS element. the newly-created element



createSelect
public static Element createSelect()(Code)
Creates a single-selection HTML SELECT element. Equivalent to
 createSelect(false)
 
the newly-created element



createSelect
public static Element createSelect(boolean multiple)(Code)
Creates an HTML SELECT element.
Parameters:
  multiple - true if multiple selection of options is allowed the newly-created element



createSpan
public static Element createSpan()(Code)
Creates an HTML SPAN element. the newly-created element



createTBody
public static Element createTBody()(Code)
Creates an HTML TBODY element. the newly-created element



createTD
public static Element createTD()(Code)
Creates an HTML TD element. the newly-created element



createTFoot
public static Element createTFoot()(Code)
Creates an HTML TFOOT element. the newly-created element



createTH
public static Element createTH()(Code)
Creates an HTML TH element. the newly-created element



createTHead
public static Element createTHead()(Code)
Creates an HTML THEAD element. the newly-created element



createTR
public static Element createTR()(Code)
Creates an HTML TR element. the newly-created element



createTable
public static Element createTable()(Code)
Creates an HTML TABLE element. the newly-created element



createTextArea
public static Element createTextArea()(Code)
Creates an HTML TEXTAREA element. the newly-created element



dispatchEvent
static void dispatchEvent(Event evt, Element elem, EventListener listener)(Code)
This method is called directly by native code when any event is fired.
Parameters:
  evt - the handle to the event being fired.
Parameters:
  elem - the handle to the element that received the event.
Parameters:
  listener - the listener associated with the element that received theevent.



eventCancelBubble
public static void eventCancelBubble(Event evt, boolean cancel)(Code)
Cancels bubbling for the given event. This will stop the event from being propagated to parent elements.
Parameters:
  evt - the event on which to cancel bubbling
Parameters:
  cancel - true to cancel bubbling



eventGetAltKey
public static boolean eventGetAltKey(Event evt)(Code)
Gets whether the ALT key was depressed when the given event occurred.
Parameters:
  evt - the event to be tested true if ALT was depressed when the event occurred



eventGetButton
public static int eventGetButton(Event evt)(Code)
Gets the mouse buttons that were depressed when the given event occurred.
Parameters:
  evt - the event to be tested a bit-field, defined by Event.BUTTON_LEFT,Event.BUTTON_MIDDLE, and Event.BUTTON_RIGHT



eventGetClientX
public static int eventGetClientX(Event evt)(Code)
Gets the mouse x-position within the browser window's client area.
Parameters:
  evt - the event to be tested the mouse x-position



eventGetClientY
public static int eventGetClientY(Event evt)(Code)
Gets the mouse y-position within the browser window's client area.
Parameters:
  evt - the event to be tested the mouse y-position



eventGetCtrlKey
public static boolean eventGetCtrlKey(Event evt)(Code)
Gets whether the CTRL key was depressed when the given event occurred.
Parameters:
  evt - the event to be tested true if CTRL was depressed when the event occurred



eventGetCurrentEvent
public static Event eventGetCurrentEvent()(Code)
Gets the current event that is being fired. The current event is only available within the lifetime of the onBrowserEvent function. Once the onBrowserEvent method returns, the current event is reset to null. the current event



eventGetCurrentTarget
public static Element eventGetCurrentTarget(Event evt)(Code)
Gets the current target element of the given event. This is the element whose listener fired last, not the element which fired the event initially.
Parameters:
  evt - the event the event's current target element
See Also:   DOM.eventGetTarget(Event)



eventGetFromElement
public static Element eventGetFromElement(Event evt)(Code)
Gets the element from which the mouse pointer was moved (only valid for Event.ONMOUSEOVER ).
Parameters:
  evt - the event to be tested the element from which the mouse pointer was moved



eventGetKeyCode
public static int eventGetKeyCode(Event evt)(Code)
Gets the key code associated with this event.

For Event.ONKEYPRESS , this method returns the Unicode value of the character generated. For Event.ONKEYDOWN and Event.ONKEYUP , it returns the code associated with the physical key.


Parameters:
  evt - the event to be tested the Unicode character or key code.
See Also:   com.google.gwt.user.client.ui.KeyboardListener



eventGetMetaKey
public static boolean eventGetMetaKey(Event evt)(Code)
Gets whether the META key was depressed when the given event occurred.
Parameters:
  evt - the event to be tested true if META was depressed when the event occurred



eventGetMouseWheelVelocityY
public static int eventGetMouseWheelVelocityY(Event evt)(Code)
Gets the velocity of the mouse wheel associated with the event along the Y axis.

The velocity of the event is an artifical measurement for relative comparisons of wheel activity. It is affected by some non-browser factors, including choice of input hardware and mouse acceleration settings. The sign of the velocity measurement agrees with the screen coordinate system; negative values are towards the origin and positive values are away from the origin. Standard scrolling speed is approximately ten units per event.


Parameters:
  evt - the event to be examined. The velocity of the mouse wheel.



eventGetRepeat
public static boolean eventGetRepeat(Event evt)(Code)
Gets the key-repeat state of this event.
Parameters:
  evt - the event to be tested true if this key event was an auto-repeat



eventGetScreenX
public static int eventGetScreenX(Event evt)(Code)
Gets the mouse x-position on the user's display.
Parameters:
  evt - the event to be tested the mouse x-position



eventGetScreenY
public static int eventGetScreenY(Event evt)(Code)
Gets the mouse y-position on the user's display.
Parameters:
  evt - the event to be tested the mouse y-position



eventGetShiftKey
public static boolean eventGetShiftKey(Event evt)(Code)
Gets whether the shift key was depressed when the given event occurred.
Parameters:
  evt - the event to be tested true if shift was depressed when the event occurred



eventGetTarget
public static Element eventGetTarget(Event evt)(Code)
Returns the element that was the actual target of the given event.
Parameters:
  evt - the event to be tested the target element



eventGetToElement
public static Element eventGetToElement(Event evt)(Code)
Gets the element to which the mouse pointer was moved (only valid for Event.ONMOUSEOUT ).
Parameters:
  evt - the event to be tested the element to which the mouse pointer was moved



eventGetType
public static int eventGetType(Event evt)(Code)
Gets the enumerated type of this event (as defined in Event ).
Parameters:
  evt - the event to be tested the event's enumerated type



eventGetTypeString
public static String eventGetTypeString(Event evt)(Code)
Gets the type of the given event as a string.
Parameters:
  evt - the event to be tested the event's type name



eventPreventDefault
public static void eventPreventDefault(Event evt)(Code)
Prevents the browser from taking its default action for the given event.
Parameters:
  evt - the event whose default action is to be prevented



eventSetKeyCode
public static void eventSetKeyCode(Event evt, char key)(Code)
Sets the key code associated with the given keyboard event.
Parameters:
  evt - the event whose key code is to be set
Parameters:
  key - the new key code



eventToString
public static String eventToString(Event evt)(Code)
Returns a stringized version of the event. This string is for debugging purposes and will NOT be consistent on different browsers.
Parameters:
  evt - the event to stringize a string form of the event



getAbsoluteLeft
public static int getAbsoluteLeft(Element elem)(Code)
Gets an element's absolute left coordinate in the document's coordinate system.
Parameters:
  elem - the element to be measured the element's absolute left coordinate



getAbsoluteTop
public static int getAbsoluteTop(Element elem)(Code)
Gets an element's absolute top coordinate in the document's coordinate system.
Parameters:
  elem - the element to be measured the element's absolute top coordinate



getAttribute
public static String getAttribute(Element elem, String attr)(Code)
Gets any named attribute from an element, as a string.
Parameters:
  elem - the element whose attribute is to be retrieved
Parameters:
  attr - the name of the attribute the attribute's valueDOM.getElementProperty(Element,String)



getBooleanAttribute
public static boolean getBooleanAttribute(Element elem, String attr)(Code)
Gets a boolean attribute on the given element.
Parameters:
  elem - the element whose attribute is to be set
Parameters:
  attr - the name of the attribute to be set the attribute's value as a booleanDOM.getElementPropertyBoolean(Element,String)



getCaptureElement
public static Element getCaptureElement()(Code)
Gets the element that currently has mouse capture. a handle to the capture element, or null if noneexists



getChild
public static Element getChild(Element parent, int index)(Code)
Gets an element's n-th child element.
Parameters:
  parent - the element whose child is to be retrieved
Parameters:
  index - the index of the child element the n-th child element



getChildCount
public static int getChildCount(Element parent)(Code)
Gets the number of child elements present in a given parent element.
Parameters:
  parent - the element whose children are to be counted the number of children



getChildIndex
public static int getChildIndex(Element parent, Element child)(Code)
Gets the index of a given child element within its parent.
Parameters:
  parent - the parent element
Parameters:
  child - the child element the child's index within its parent, or -1 if it isnot a child of the given parent



getElementAttribute
public static String getElementAttribute(Element elem, String attr)(Code)
Gets the named attribute from the element.
Parameters:
  elem - the element whose property is to be retrieved
Parameters:
  attr - the name of the attribute the value of the attribute



getElementById
public static Element getElementById(String id)(Code)
Gets the element associated with the given unique id within the entire document.
Parameters:
  id - the id whose associated element is to be retrieved the associated element, or null if none is found



getElementProperty
public static String getElementProperty(Element elem, String prop)(Code)
Gets any named property from an element, as a string.
Parameters:
  elem - the element whose property is to be retrieved
Parameters:
  prop - the name of the property the property's value



getElementPropertyBoolean
public static boolean getElementPropertyBoolean(Element elem, String prop)(Code)
Gets any named property from an element, as a boolean.
Parameters:
  elem - the element whose property is to be retrieved
Parameters:
  prop - the name of the property the property's value as a boolean



getElementPropertyInt
public static int getElementPropertyInt(Element elem, String prop)(Code)
Gets any named property from an element, as an int.
Parameters:
  elem - the element whose property is to be retrieved
Parameters:
  prop - the name of the property the property's value as an int



getEventsSunk
public static int getEventsSunk(Element elem)(Code)
Gets the current set of events sunk by a given element.
Parameters:
  elem - the element whose events are to be retrieved a bitfield describing the events sunk on this element (its possiblevalues are described in Event)



getFirstChild
public static Element getFirstChild(Element elem)(Code)
Gets the first child element of the given element.
Parameters:
  elem - the element whose child is to be retrieved the child element



getImgSrc
public static String getImgSrc(Element img)(Code)
Gets the src attribute of an img element. This method is paired with DOM.setImgSrc(Element,String) so that it always returns the correct url.
Parameters:
  img - a non-null img whose src attribute is to be read. the src url of the img



getInnerHTML
public static String getInnerHTML(Element elem)(Code)
Gets an HTML representation of an element's children.
Parameters:
  elem - the element whose HTML is to be retrieved the HTML representation of the element's children



getInnerText
public static String getInnerText(Element elem)(Code)
Gets the text contained within an element. If the element has child elements, only the text between them will be retrieved.
Parameters:
  elem - the element whose inner text is to be retrieved the text inside this element



getIntAttribute
public static int getIntAttribute(Element elem, String attr)(Code)
Gets an integer attribute on a given element.
Parameters:
  elem - the element whose attribute is to be retrieved
Parameters:
  attr - the name of the attribute to be retrieved the attribute's value as an integerDOM.getElementPropertyInt(Element,String)



getIntStyleAttribute
public static int getIntStyleAttribute(Element elem, String attr)(Code)
Gets an integer attribute on a given element's style.
Parameters:
  elem - the element whose style attribute is to be retrieved
Parameters:
  attr - the name of the attribute to be retrieved the style attribute's value as an integer



getNextSibling
public static Element getNextSibling(Element elem)(Code)
Gets an element's next sibling element.
Parameters:
  elem - the element whose sibling is to be retrieved the sibling element



getParent
public static Element getParent(Element elem)(Code)
Gets an element's parent element.
Parameters:
  elem - the element whose parent is to be retrieved the parent element



getStyleAttribute
public static String getStyleAttribute(Element elem, String attr)(Code)
Gets an attribute of the given element's style.
Parameters:
  elem - the element whose style attribute is to be retrieved
Parameters:
  attr - the name of the style attribute to be retrieved the style attribute's value



insertBefore
public static void insertBefore(Element parent, Element child, Element before)(Code)
Inserts an element as a child of the given parent element, before another child of that parent.
Parameters:
  parent - the parent element
Parameters:
  child - the child element to add to parent
Parameters:
  before - an existing child element of parent beforewhich child will be inserted



insertChild
public static void insertChild(Element parent, Element child, int index)(Code)
Inserts an element as a child of the given parent element.
Parameters:
  parent - the parent element
Parameters:
  child - the child element to add to parent
Parameters:
  index - the index before which the child will be inserted (any valuegreater than the number of existing children will cause the childto be appended)



insertListItem
public static void insertListItem(Element select, String item, String value, int index)(Code)
Creates an <option> element and inserts it as a child of the specified <select> element. If the index is less than zero, or greater than or equal to the length of the list, then the option element will be appended to the end of the list.
Parameters:
  select - the <select> element
Parameters:
  item - the text of the new item; cannot be null
Parameters:
  value - the value attribute for the new<option>; cannot be null
Parameters:
  index - the index at which to insert the child



isOrHasChild
public static boolean isOrHasChild(Element parent, Element child)(Code)
Determine whether one element is equal to, or the child of, another.
Parameters:
  parent - the potential parent element
Parameters:
  child - the potential child element true if the relationship holds
See Also:   DOM.compare(Element,Element)



previewEvent
static boolean previewEvent(Event evt)(Code)
This method is called directly by native code when event preview is being used.
Parameters:
  evt - a handle to the event being previewed false to cancel the event



releaseCapture
public static void releaseCapture(Element elem)(Code)
Releases mouse capture on the given element. Calling this method has no effect if the element does not currently have mouse capture.
Parameters:
  elem - the element to release capture
See Also:   DOM.setCapture(Element)



removeChild
public static void removeChild(Element parent, Element child)(Code)
Removes a child element from the given parent element.
Parameters:
  parent - the parent element
Parameters:
  child - the child element to be removed



removeElementAttribute
public static void removeElementAttribute(Element elem, String attr)(Code)
Removes the named attribute from the given element.
Parameters:
  elem - the element whose attribute is to be removed
Parameters:
  attr - the name of the element to remove



removeEventPreview
public static void removeEventPreview(EventPreview preview)(Code)
Removes an element from the preview stack. This element will no longer capture events, though any preview underneath it will begin to do so.
Parameters:
  preview - the event preview to be removed from the stack



scrollIntoView
public static void scrollIntoView(Element elem)(Code)
Scrolls the given element into view.

This method crawls up the DOM hierarchy, adjusting the scrollLeft and scrollTop properties of each scrollable element to ensure that the specified element is completely in view. It adjusts each scroll position by the minimum amount necessary.


Parameters:
  elem - the element to be made visible



setAttribute
public static void setAttribute(Element elem, String attr, String value)(Code)
Sets an attribute on the given element.
Parameters:
  elem - the element whose attribute is to be set
Parameters:
  attr - the name of the attribute to be set
Parameters:
  value - the new attribute valueDOM.setElementProperty(Element,String,String)



setBooleanAttribute
public static void setBooleanAttribute(Element elem, String attr, boolean value)(Code)
Sets a boolean attribute on the given element.
Parameters:
  elem - the element whose attribute is to be set
Parameters:
  attr - the name of the attribute to be set
Parameters:
  value - the attribute's new boolean valueDOM.setElementPropertyBoolean(Element,String,boolean)



setCapture
public static void setCapture(Element elem)(Code)
Sets mouse-capture on the given element. This element will directly receive all mouse events until DOM.releaseCapture(Element) is called on it.
Parameters:
  elem - the element on which to set mouse capture



setElementAttribute
public static void setElementAttribute(Element elem, String attr, String value)(Code)
Sets an attribute on a given element.
Parameters:
  elem - element whose attribute is to be set
Parameters:
  attr - the name of the attribute
Parameters:
  value - the value to which the attribute should be set



setElementProperty
public static void setElementProperty(Element elem, String prop, String value)(Code)
Sets a property on the given element.
Parameters:
  elem - the element whose property is to be set
Parameters:
  prop - the name of the property to be set
Parameters:
  value - the new property value



setElementPropertyBoolean
public static void setElementPropertyBoolean(Element elem, String prop, boolean value)(Code)
Sets a boolean property on the given element.
Parameters:
  elem - the element whose property is to be set
Parameters:
  prop - the name of the property to be set
Parameters:
  value - the new property value as a boolean



setElementPropertyInt
public static void setElementPropertyInt(Element elem, String prop, int value)(Code)
Sets an int property on the given element.
Parameters:
  elem - the element whose property is to be set
Parameters:
  prop - the name of the property to be set
Parameters:
  value - the new property value as an int



setEventListener
public static void setEventListener(Element elem, EventListener listener)(Code)
Sets the EventListener to receive events for the given element. Only one such listener may exist for a single element.
Parameters:
  elem - the element whose listener is to be set
Parameters:
  listener - the listener to receive Event events



setImgSrc
public static void setImgSrc(Element img, String src)(Code)
Sets the src attribute of an img element. This method ensures that imgs only ever have their contents requested one single time from the server.
Parameters:
  img - a non-null img whose src attribute will be set.
Parameters:
  src - a non-null url for the img



setInnerHTML
public static void setInnerHTML(Element elem, String html)(Code)
Sets the HTML contained within an element.
Parameters:
  elem - the element whose inner HTML is to be set
Parameters:
  html - the new html



setInnerText
public static void setInnerText(Element elem, String text)(Code)
Sets the text contained within an element. If the element already has children, they will be destroyed.
Parameters:
  elem - the element whose inner text is to be set
Parameters:
  text - the new text



setIntAttribute
public static void setIntAttribute(Element elem, String attr, int value)(Code)
Sets an integer attribute on the given element.
Parameters:
  elem - the element whose attribute is to be set
Parameters:
  attr - the name of the attribute to be set
Parameters:
  value - the attribute's new integer valueDOM.setElementPropertyInt(Element,String,int)



setIntStyleAttribute
public static void setIntStyleAttribute(Element elem, String attr, int value)(Code)
Sets an integer attribute on the given element's style.
Parameters:
  elem - the element whose style attribute is to be set
Parameters:
  attr - the name of the style attribute to be set
Parameters:
  value - the style attribute's new integer value



setOptionText
public static void setOptionText(Element select, String text, int index)(Code)
Sets the option text of the given select object.
Parameters:
  select - the select object whose option text is being set
Parameters:
  text - the text to set
Parameters:
  index - the index of the option whose text should be set



setStyleAttribute
public static void setStyleAttribute(Element elem, String attr, String value)(Code)
Sets an attribute on the given element's style.
Parameters:
  elem - the element whose style attribute is to be set
Parameters:
  attr - the name of the style attribute to be set
Parameters:
  value - the style attribute's new value



sinkEvents
public static void sinkEvents(Element elem, int eventBits)(Code)
Sets the current set of events sunk by a given element. These events will be fired to the nearest EventListener specified on any of the element's parents.
Parameters:
  elem - the element whose events are to be retrieved
Parameters:
  eventBits - a bitfield describing the events sunk on this element (itspossible values are described in Event)



toString
public static String toString(Element elem)(Code)
Returns a stringized version of the element. This string is for debugging purposes and will NOT be consistent on different browsers.
Parameters:
  elem - the element to stringize a string form of the element



windowGetClientHeight
public static int windowGetClientHeight()(Code)
Gets the height of the browser window's client area excluding the scroll bar. the window's client height



windowGetClientWidth
public static int windowGetClientWidth()(Code)
Gets the width of the browser window's client area excluding the vertical scroll bar. the window's client width



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.