Reformatting using eclipse gwt plugin. git-svn-id: https://google-web-toolkit.googlecode.com/svn/trunk@1668 8db76d5a-ed1c-0410-87a9-c151d255dfc7
diff --git a/user/src/com/google/gwt/user/client/DOM.java b/user/src/com/google/gwt/user/client/DOM.java index db1e115..d8509d3 100644 --- a/user/src/com/google/gwt/user/client/DOM.java +++ b/user/src/com/google/gwt/user/client/DOM.java
@@ -1,12 +1,12 @@ /* * Copyright 2007 Google Inc. - * + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the @@ -43,7 +43,7 @@ * to their listeners. Note that the event preview will receive <u>all </u> * events, including those received due to bubbling, whereas normal event * handlers only receive explicitly sunk events. - * + * * @param preview the event preview to be added to the stack. */ public static void addEventPreview(EventPreview preview) { @@ -57,7 +57,7 @@ /** * Appends one element to another's list of children. - * + * * @param parent the parent element * @param child its new child */ @@ -68,7 +68,7 @@ /** * Compares two elements for equality (note that reference equality is not * sufficient to determine equality among elements on most browsers). - * + * * @param elem1 the first element to be compared * @param elem2 the second element to be compared * @return <code>true</code> if they are in fact the same element @@ -80,7 +80,7 @@ /** * Creates an HTML A element. - * + * * @return the newly-created element */ public static Element createAnchor() { @@ -89,7 +89,7 @@ /** * Creates an HTML BUTTON element. - * + * * @return the newly-created element */ public static Element createButton() { @@ -98,7 +98,7 @@ /** * Creates an HTML CAPTION element. - * + * * @return the newly-created element */ public static Element createCaption() { @@ -107,7 +107,7 @@ /** * Creates an HTML COL element. - * + * * @return the newly-created element */ public static Element createCol() { @@ -116,7 +116,7 @@ /** * Creates an HTML COLGROUP element. - * + * * @return the newly-created element */ public static Element createColGroup() { @@ -125,7 +125,7 @@ /** * Creates an HTML DIV element. - * + * * @return the newly-created element */ public static Element createDiv() { @@ -134,7 +134,7 @@ /** * Creates an HTML element. - * + * * @param tagName the HTML tag of the element to be created * @return the newly-created element */ @@ -144,7 +144,7 @@ /** * Creates an HTML FIELDSET element. - * + * * @return the newly-created element */ public static Element createFieldSet() { @@ -153,7 +153,7 @@ /** * Creates an HTML FORM element. - * + * * @return the newly-created element */ public static Element createForm() { @@ -162,7 +162,7 @@ /** * Creates an HTML IFRAME element. - * + * * @return the newly-created element */ public static Element createIFrame() { @@ -171,7 +171,7 @@ /** * Creates an HTML IMG element. - * + * * @return the newly-created element */ public static Element createImg() { @@ -180,7 +180,7 @@ /** * Creates an HTML INPUT type='CHECK' element. - * + * * @return the newly-created element */ public static Element createInputCheck() { @@ -189,7 +189,7 @@ /** * Creates an HTML INPUT type='PASSWORD' element. - * + * * @return the newly-created element */ public static Element createInputPassword() { @@ -198,7 +198,7 @@ /** * Creates an HTML INPUT type='RADIO' element. - * + * * @param name the name of the group with which this radio button will be * associated * @return the newly-created element @@ -209,7 +209,7 @@ /** * Creates an HTML INPUT type='TEXT' element. - * + * * @return the newly-created element */ public static Element createInputText() { @@ -218,7 +218,7 @@ /** * Creates an HTML LABEL element. - * + * * @return the newly-created element */ public static Element createLabel() { @@ -227,7 +227,7 @@ /** * Creates an HTML LEGEND element. - * + * * @return the newly-created element */ public static Element createLegend() { @@ -236,7 +236,7 @@ /** * Creates an HTML OPTIONS element. - * + * * @return the newly-created element */ public static Element createOptions() { @@ -244,11 +244,12 @@ } /** - * Creates a single-selection HTML SELECT element. Equivalent to + * Creates a single-selection HTML SELECT element. Equivalent to + * * <pre> * createSelect(false) * </pre> - * + * * @return the newly-created element */ public static Element createSelect() { @@ -257,7 +258,7 @@ /** * Creates an HTML SELECT element. - * + * * @param multiple true if multiple selection of options is allowed * @return the newly-created element */ @@ -267,7 +268,7 @@ /** * Creates an HTML SPAN element. - * + * * @return the newly-created element */ public static Element createSpan() { @@ -276,7 +277,7 @@ /** * Creates an HTML TABLE element. - * + * * @return the newly-created element */ public static Element createTable() { @@ -285,7 +286,7 @@ /** * Creates an HTML TBODY element. - * + * * @return the newly-created element */ public static Element createTBody() { @@ -294,7 +295,7 @@ /** * Creates an HTML TD element. - * + * * @return the newly-created element */ public static Element createTD() { @@ -303,7 +304,7 @@ /** * Creates an HTML TEXTAREA element. - * + * * @return the newly-created element */ public static Element createTextArea() { @@ -312,7 +313,7 @@ /** * Creates an HTML TFOOT element. - * + * * @return the newly-created element */ public static Element createTFoot() { @@ -321,7 +322,7 @@ /** * Creates an HTML TH element. - * + * * @return the newly-created element */ public static Element createTH() { @@ -330,7 +331,7 @@ /** * Creates an HTML THEAD element. - * + * * @return the newly-created element */ public static Element createTHead() { @@ -339,7 +340,7 @@ /** * Creates an HTML TR element. - * + * * @return the newly-created element */ public static Element createTR() { @@ -349,7 +350,7 @@ /** * Cancels bubbling for the given event. This will stop the event from being * propagated to parent elements. - * + * * @param evt the event on which to cancel bubbling * @param cancel <code>true</code> to cancel bubbling */ @@ -359,7 +360,7 @@ /** * Gets whether the ALT key was depressed when the given event occurred. - * + * * @param evt the event to be tested * @return <code>true</code> if ALT was depressed when the event occurred */ @@ -369,7 +370,7 @@ /** * Gets the mouse buttons that were depressed when the given event occurred. - * + * * @param evt the event to be tested * @return a bit-field, defined by {@link Event#BUTTON_LEFT}, * {@link Event#BUTTON_MIDDLE}, and {@link Event#BUTTON_RIGHT} @@ -380,7 +381,7 @@ /** * Gets the mouse x-position within the browser window's client area. - * + * * @param evt the event to be tested * @return the mouse x-position */ @@ -390,7 +391,7 @@ /** * Gets the mouse y-position within the browser window's client area. - * + * * @param evt the event to be tested * @return the mouse y-position */ @@ -400,19 +401,18 @@ /** * Gets whether the CTRL key was depressed when the given event occurred. - * + * * @param evt the event to be tested * @return <code>true</code> if CTRL was depressed when the event occurred */ public static boolean eventGetCtrlKey(Event evt) { return impl.eventGetCtrlKey(evt); } - + /** - * 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. + * 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. * * @return the current event */ @@ -422,9 +422,8 @@ /** * 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. - * + * whose listener fired last, not the element which fired the event initially. + * * @param evt the event * @return the event's current target element * @see DOM#eventGetTarget(Event) @@ -436,7 +435,7 @@ /** * Gets the element from which the mouse pointer was moved (only valid for * {@link Event#ONMOUSEOVER}). - * + * * @param evt the event to be tested * @return the element from which the mouse pointer was moved */ @@ -446,13 +445,13 @@ /** * Gets the key code associated with this event. - * + * * <p> * For {@link Event#ONKEYPRESS}, this method returns the Unicode value of the * character generated. For {@link Event#ONKEYDOWN} and {@link Event#ONKEYUP}, * it returns the code associated with the physical key. * </p> - * + * * @param evt the event to be tested * @return the Unicode character or key code. * @see com.google.gwt.user.client.ui.KeyboardListener @@ -463,7 +462,7 @@ /** * Gets whether the META key was depressed when the given event occurred. - * + * * @param evt the event to be tested * @return <code>true</code> if META was depressed when the event occurred */ @@ -472,18 +471,17 @@ } /** - * Gets the velocity of the mouse wheel associated with the event along the - * Y axis. + * Gets the velocity of the mouse wheel associated with the event along the Y + * axis. * <p> * 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. + * 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. * </p> - * + * * @param evt the event to be examined. * @return The velocity of the mouse wheel. */ @@ -493,7 +491,7 @@ /** * Gets the key-repeat state of this event. - * + * * @param evt the event to be tested * @return <code>true</code> if this key event was an auto-repeat */ @@ -503,7 +501,7 @@ /** * Gets the mouse x-position on the user's display. - * + * * @param evt the event to be tested * @return the mouse x-position */ @@ -513,7 +511,7 @@ /** * Gets the mouse y-position on the user's display. - * + * * @param evt the event to be tested * @return the mouse y-position */ @@ -523,7 +521,7 @@ /** * Gets whether the shift key was depressed when the given event occurred. - * + * * @param evt the event to be tested * @return <code>true</code> if shift was depressed when the event occurred */ @@ -533,7 +531,7 @@ /** * Returns the element that was the actual target of the given event. - * + * * @param evt the event to be tested * @return the target element */ @@ -544,7 +542,7 @@ /** * Gets the element to which the mouse pointer was moved (only valid for * {@link Event#ONMOUSEOUT}). - * + * * @param evt the event to be tested * @return the element to which the mouse pointer was moved */ @@ -554,7 +552,7 @@ /** * Gets the enumerated type of this event (as defined in {@link Event}). - * + * * @param evt the event to be tested * @return the event's enumerated type */ @@ -564,7 +562,7 @@ /** * Gets the type of the given event as a string. - * + * * @param evt the event to be tested * @return the event's type name */ @@ -574,7 +572,7 @@ /** * Prevents the browser from taking its default action for the given event. - * + * * @param evt the event whose default action is to be prevented */ public static void eventPreventDefault(Event evt) { @@ -583,7 +581,7 @@ /** * Sets the key code associated with the given keyboard event. - * + * * @param evt the event whose key code is to be set * @param key the new key code */ @@ -594,7 +592,7 @@ /** * Returns a stringized version of the event. This string is for debugging * purposes and will NOT be consistent on different browsers. - * + * * @param evt the event to stringize * @return a string form of the event */ @@ -605,7 +603,7 @@ /** * Gets an element's absolute left coordinate in the document's coordinate * system. - * + * * @param elem the element to be measured * @return the element's absolute left coordinate */ @@ -616,7 +614,7 @@ /** * Gets an element's absolute top coordinate in the document's coordinate * system. - * + * * @param elem the element to be measured * @return the element's absolute top coordinate */ @@ -626,12 +624,12 @@ /** * Gets any named attribute from an element, as a string. - * + * * @param elem the element whose attribute is to be retrieved * @param attr the name of the attribute * @return the attribute's value * @deprecated Use the more appropriately named - * {@link #getElementProperty(Element, String)} instead. + * {@link #getElementProperty(Element, String)} instead. */ @Deprecated public static String getAttribute(Element elem, String attr) { @@ -640,12 +638,12 @@ /** * Gets a boolean attribute on the given element. - * + * * @param elem the element whose attribute is to be set * @param attr the name of the attribute to be set * @return the attribute's value as a boolean * @deprecated Use the more appropriately named - * {@link #getElementPropertyBoolean(Element, String)} instead. + * {@link #getElementPropertyBoolean(Element, String)} instead. */ @Deprecated public static boolean getBooleanAttribute(Element elem, String attr) { @@ -654,7 +652,7 @@ /** * Gets the element that currently has mouse capture. - * + * * @return a handle to the capture element, or <code>null</code> if none * exists */ @@ -664,7 +662,7 @@ /** * Gets an element's n-th child element. - * + * * @param parent the element whose child is to be retrieved * @param index the index of the child element * @return the n-th child element @@ -675,7 +673,7 @@ /** * Gets the number of child elements present in a given parent element. - * + * * @param parent the element whose children are to be counted * @return the number of children */ @@ -685,7 +683,7 @@ /** * Gets the index of a given child element within its parent. - * + * * @param parent the parent element * @param child the child element * @return the child's index within its parent, or <code>-1</code> if it is @@ -697,61 +695,62 @@ /** * Gets the named attribute from the element. - * + * * @param elem the element whose property is to be retrieved * @param attr the name of the attribute * @return the value of the attribute */ public static String getElementAttribute(Element elem, String attr) { - return impl.getElementAttribute(elem, attr); + return impl.getElementAttribute(elem, attr); } /** * Gets the element associated with the given unique id within the entire * document. - * + * * @param id the id whose associated element is to be retrieved * @return the associated element, or <code>null</code> if none is found */ public static Element getElementById(String id) { return impl.getElementById(id); } + /** * Gets any named property from an element, as a string. - * + * * @param elem the element whose property is to be retrieved * @param prop the name of the property * @return the property's value */ public static String getElementProperty(Element elem, String prop) { - return impl.getElementProperty(elem, prop); + return impl.getElementProperty(elem, prop); } /** * Gets any named property from an element, as a boolean. - * + * * @param elem the element whose property is to be retrieved * @param prop the name of the property * @return the property's value as a boolean */ public static boolean getElementPropertyBoolean(Element elem, String prop) { - return impl.getElementPropertyBoolean(elem, prop); + return impl.getElementPropertyBoolean(elem, prop); } /** * Gets any named property from an element, as an int. - * + * * @param elem the element whose property is to be retrieved * @param prop the name of the property * @return the property's value as an int */ public static int getElementPropertyInt(Element elem, String prop) { - return impl.getElementPropertyInt(elem, prop); + return impl.getElementPropertyInt(elem, prop); } /** * Gets the current set of events sunk by a given element. - * + * * @param elem the element whose events are to be retrieved * @return a bitfield describing the events sunk on this element (its possible * values are described in {@link Event}) @@ -762,7 +761,7 @@ /** * Gets the first child element of the given element. - * + * * @param elem the element whose child is to be retrieved * @return the child element */ @@ -774,7 +773,7 @@ * Gets the src attribute of an img element. This method is paired with * {@link #setImgSrc(Element, String)} so that it always returns the correct * url. - * + * * @param img a non-null img whose src attribute is to be read. * @return the src url of the img */ @@ -784,7 +783,7 @@ /** * Gets an HTML representation of an element's children. - * + * * @param elem the element whose HTML is to be retrieved * @return the HTML representation of the element's children */ @@ -795,7 +794,7 @@ /** * Gets the text contained within an element. If the element has child * elements, only the text between them will be retrieved. - * + * * @param elem the element whose inner text is to be retrieved * @return the text inside this element */ @@ -805,12 +804,12 @@ /** * Gets an integer attribute on a given element. - * + * * @param elem the element whose attribute is to be retrieved * @param attr the name of the attribute to be retrieved * @return the attribute's value as an integer * @deprecated Use the more appropriately named - * {@link #getElementPropertyInt(Element, String)} instead. + * {@link #getElementPropertyInt(Element, String)} instead. */ @Deprecated public static int getIntAttribute(Element elem, String attr) { @@ -819,7 +818,7 @@ /** * Gets an integer attribute on a given element's style. - * + * * @param elem the element whose style attribute is to be retrieved * @param attr the name of the attribute to be retrieved * @return the style attribute's value as an integer @@ -830,7 +829,7 @@ /** * Gets an element's next sibling element. - * + * * @param elem the element whose sibling is to be retrieved * @return the sibling element */ @@ -840,7 +839,7 @@ /** * Gets an element's parent element. - * + * * @param elem the element whose parent is to be retrieved * @return the parent element */ @@ -850,7 +849,7 @@ /** * Gets an attribute of the given element's style. - * + * * @param elem the element whose style attribute is to be retrieved * @param attr the name of the style attribute to be retrieved * @return the style attribute's value @@ -874,7 +873,7 @@ /** * Inserts an element as a child of the given parent element. - * + * * @param parent the parent element * @param child the child element to add to <code>parent</code> * @param index the index before which the child will be inserted (any value @@ -904,7 +903,7 @@ /** * Determine whether one element is equal to, or the child of, another. - * + * * @param parent the potential parent element * @param child the potential child element * @return <code>true</code> if the relationship holds @@ -917,7 +916,7 @@ /** * Releases mouse capture on the given element. Calling this method has no * effect if the element does not currently have mouse capture. - * + * * @param elem the element to release capture * @see #setCapture(Element) */ @@ -930,7 +929,7 @@ /** * Removes a child element from the given parent element. - * + * * @param parent the parent element * @param child the child element to be removed */ @@ -940,7 +939,7 @@ /** * Removes the named attribute from the given element. - * + * * @param elem the element whose attribute is to be removed * @param attr the name of the element to remove */ @@ -951,7 +950,7 @@ /** * Removes an element from the preview stack. This element will no longer * capture events, though any preview underneath it will begin to do so. - * + * * @param preview the event preview to be removed from the stack */ public static void removeEventPreview(EventPreview preview) { @@ -965,14 +964,14 @@ /** * Scrolls the given element into view. - * + * * <p> * 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. * </p> - * + * * @param elem the element to be made visible */ public static void scrollIntoView(Element elem) { @@ -981,12 +980,12 @@ /** * Sets an attribute on the given element. - * + * * @param elem the element whose attribute is to be set * @param attr the name of the attribute to be set * @param value the new attribute value * @deprecated Use the more appropriately named - * {@link #setElementProperty(Element, String, String)} instead. + * {@link #setElementProperty(Element, String, String)} instead. */ @Deprecated public static void setAttribute(Element elem, String attr, String value) { @@ -995,12 +994,13 @@ /** * Sets a boolean attribute on the given element. - * + * * @param elem the element whose attribute is to be set * @param attr the name of the attribute to be set * @param value the attribute's new boolean value * @deprecated Use the more appropriately named - * {@link #setElementPropertyBoolean(Element, String, boolean)} instead. + * {@link #setElementPropertyBoolean(Element, String, boolean)} + * instead. */ @Deprecated public static void setBooleanAttribute(Element elem, String attr, @@ -1011,7 +1011,7 @@ /** * Sets mouse-capture on the given element. This element will directly receive * all mouse events until {@link #releaseCapture(Element)} is called on it. - * + * * @param elem the element on which to set mouse capture */ public static void setCapture(Element elem) { @@ -1021,31 +1021,29 @@ /** * Sets an attribute on a given element. - * + * * @param elem element whose attribute is to be set * @param attr the name of the attribute * @param value the value to which the attribute should be set */ - public static void setElementAttribute(Element elem, String attr, - String value) { + public static void setElementAttribute(Element elem, String attr, String value) { impl.setElementAttribute(elem, attr, value); } /** * Sets a property on the given element. - * + * * @param elem the element whose property is to be set * @param prop the name of the property to be set * @param value the new property value */ - public static void setElementProperty(Element elem, String prop, - String value) { + public static void setElementProperty(Element elem, String prop, String value) { impl.setElementProperty(elem, prop, value); } /** * Sets a boolean property on the given element. - * + * * @param elem the element whose property is to be set * @param prop the name of the property to be set * @param value the new property value as a boolean @@ -1057,20 +1055,19 @@ /** * Sets an int property on the given element. - * + * * @param elem the element whose property is to be set * @param prop the name of the property to be set * @param value the new property value as an int */ - public static void setElementPropertyInt(Element elem, String prop, - int value) { + public static void setElementPropertyInt(Element elem, String prop, int value) { impl.setElementPropertyInt(elem, prop, value); } /** * Sets the {@link EventListener} to receive events for the given element. * Only one such listener may exist for a single element. - * + * * @param elem the element whose listener is to be set * @param listener the listener to receive {@link Event events} */ @@ -1081,7 +1078,7 @@ /** * 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. - * + * * @param img a non-null img whose src attribute will be set. * @param src a non-null url for the img */ @@ -1091,7 +1088,7 @@ /** * Sets the HTML contained within an element. - * + * * @param elem the element whose inner HTML is to be set * @param html the new html */ @@ -1102,7 +1099,7 @@ /** * Sets the text contained within an element. If the element already has * children, they will be destroyed. - * + * * @param elem the element whose inner text is to be set * @param text the new text */ @@ -1112,12 +1109,12 @@ /** * Sets an integer attribute on the given element. - * + * * @param elem the element whose attribute is to be set * @param attr the name of the attribute to be set * @param value the attribute's new integer value * @deprecated Use the more appropriately named - * {@link #setElementPropertyInt(Element, String, int)} instead. + * {@link #setElementPropertyInt(Element, String, int)} instead. */ @Deprecated public static void setIntAttribute(Element elem, String attr, int value) { @@ -1126,19 +1123,18 @@ /** * Sets an integer attribute on the given element's style. - * + * * @param elem the element whose style attribute is to be set * @param attr the name of the style attribute to be set * @param value the style attribute's new integer value */ - public static void setIntStyleAttribute(Element elem, String attr, - int value) { + public static void setIntStyleAttribute(Element elem, String attr, int value) { impl.setIntStyleAttribute(elem, attr, value); } /** * Sets the option text of the given select object. - * + * * @param select the select object whose option text is being set * @param text the text to set * @param index the index of the option whose text should be set @@ -1149,13 +1145,12 @@ /** * Sets an attribute on the given element's style. - * + * * @param elem the element whose style attribute is to be set * @param attr the name of the style attribute to be set * @param value the style attribute's new value */ - public static void setStyleAttribute(Element elem, String attr, - String value) { + public static void setStyleAttribute(Element elem, String attr, String value) { impl.setStyleAttribute(elem, attr, value); } @@ -1163,7 +1158,7 @@ * Sets the current set of events sunk by a given element. These events will * be fired to the nearest {@link EventListener} specified on any of the * element's parents. - * + * * @param elem the element whose events are to be retrieved * @param eventBits a bitfield describing the events sunk on this element (its * possible values are described in {@link Event}) @@ -1175,17 +1170,17 @@ /** * Returns a stringized version of the element. This string is for debugging * purposes and will NOT be consistent on different browsers. - * + * * @param elem the element to stringize * @return a string form of the element */ public static String toString(Element elem) { return impl.toString(elem); } - + /** - * Gets the height of the browser window's client area excluding the - * scroll bar. + * Gets the height of the browser window's client area excluding the scroll + * bar. * * @return the window's client height */ @@ -1194,18 +1189,18 @@ } /** - * Gets the width of the browser window's client area excluding the - * vertical scroll bar. + * Gets the width of the browser window's client area excluding the vertical + * scroll bar. * * @return the window's client width */ public static int windowGetClientWidth() { return impl.windowGetClientWidth(); } - + /** * This method is called directly by native code when any event is fired. - * + * * @param evt the handle to the event being fired. * @param elem the handle to the element that received the event. * @param listener the listener associated with the element that received the @@ -1223,7 +1218,7 @@ /** * This method is called directly by native code when event preview is being * used. - * + * * @param evt a handle to the event being previewed * @return <code>false</code> to cancel the event */ @@ -1231,8 +1226,7 @@ // If event previews are present, redirect events to the topmost of them. boolean ret = true; if (sEventPreviewStack != null && sEventPreviewStack.size() > 0) { - EventPreview preview = - sEventPreviewStack.get(sEventPreviewStack.size() - 1); + EventPreview preview = sEventPreviewStack.get(sEventPreviewStack.size() - 1); if (!(ret = preview.onEventPreview(evt))) { // If the preview cancels the event, stop it from bubbling and // performing its default action.