jaxp/src/share/classes/org/w3c/dom/events/EventTarget.java
author tonyp
Wed, 19 Aug 2009 12:53:25 -0400
changeset 3691 c84b8483cd2c
parent 6 7f561c08de6b
permissions -rw-r--r--
6871111: G1: remove the concurrent overhead tracker Summary: Removing the concurrent overhead tracker from G1, along with the GC overhead reporter and the G1AccountConcurrentOverhead (both of which rely on the the concurrent overhead tracker). Reviewed-by: iveresov, johnc
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
6
7f561c08de6b Initial load
duke
parents:
diff changeset
     1
/*
7f561c08de6b Initial load
duke
parents:
diff changeset
     2
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
7f561c08de6b Initial load
duke
parents:
diff changeset
     3
 *
7f561c08de6b Initial load
duke
parents:
diff changeset
     4
 * This code is free software; you can redistribute it and/or modify it
7f561c08de6b Initial load
duke
parents:
diff changeset
     5
 * under the terms of the GNU General Public License version 2 only, as
7f561c08de6b Initial load
duke
parents:
diff changeset
     6
 * published by the Free Software Foundation.  Sun designates this
7f561c08de6b Initial load
duke
parents:
diff changeset
     7
 * particular file as subject to the "Classpath" exception as provided
7f561c08de6b Initial load
duke
parents:
diff changeset
     8
 * by Sun in the LICENSE file that accompanied this code.
7f561c08de6b Initial load
duke
parents:
diff changeset
     9
 *
7f561c08de6b Initial load
duke
parents:
diff changeset
    10
 * This code is distributed in the hope that it will be useful, but WITHOUT
7f561c08de6b Initial load
duke
parents:
diff changeset
    11
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
7f561c08de6b Initial load
duke
parents:
diff changeset
    12
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
7f561c08de6b Initial load
duke
parents:
diff changeset
    13
 * version 2 for more details (a copy is included in the LICENSE file that
7f561c08de6b Initial load
duke
parents:
diff changeset
    14
 * accompanied this code).
7f561c08de6b Initial load
duke
parents:
diff changeset
    15
 *
7f561c08de6b Initial load
duke
parents:
diff changeset
    16
 * You should have received a copy of the GNU General Public License version
7f561c08de6b Initial load
duke
parents:
diff changeset
    17
 * 2 along with this work; if not, write to the Free Software Foundation,
7f561c08de6b Initial load
duke
parents:
diff changeset
    18
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
7f561c08de6b Initial load
duke
parents:
diff changeset
    19
 *
7f561c08de6b Initial load
duke
parents:
diff changeset
    20
 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
7f561c08de6b Initial load
duke
parents:
diff changeset
    21
 * CA 95054 USA or visit www.sun.com if you need additional information or
7f561c08de6b Initial load
duke
parents:
diff changeset
    22
 * have any questions.
7f561c08de6b Initial load
duke
parents:
diff changeset
    23
 */
7f561c08de6b Initial load
duke
parents:
diff changeset
    24
7f561c08de6b Initial load
duke
parents:
diff changeset
    25
/*
7f561c08de6b Initial load
duke
parents:
diff changeset
    26
 * This file is available under and governed by the GNU General Public
7f561c08de6b Initial load
duke
parents:
diff changeset
    27
 * License version 2 only, as published by the Free Software Foundation.
7f561c08de6b Initial load
duke
parents:
diff changeset
    28
 * However, the following notice accompanied the original version of this
7f561c08de6b Initial load
duke
parents:
diff changeset
    29
 * file and, per its terms, should not be removed:
7f561c08de6b Initial load
duke
parents:
diff changeset
    30
 *
7f561c08de6b Initial load
duke
parents:
diff changeset
    31
 * Copyright (c) 2000 World Wide Web Consortium,
7f561c08de6b Initial load
duke
parents:
diff changeset
    32
 * (Massachusetts Institute of Technology, Institut National de
7f561c08de6b Initial load
duke
parents:
diff changeset
    33
 * Recherche en Informatique et en Automatique, Keio University). All
7f561c08de6b Initial load
duke
parents:
diff changeset
    34
 * Rights Reserved. This program is distributed under the W3C's Software
7f561c08de6b Initial load
duke
parents:
diff changeset
    35
 * Intellectual Property License. This program is distributed in the
7f561c08de6b Initial load
duke
parents:
diff changeset
    36
 * hope that it will be useful, but WITHOUT ANY WARRANTY; without even
7f561c08de6b Initial load
duke
parents:
diff changeset
    37
 * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
7f561c08de6b Initial load
duke
parents:
diff changeset
    38
 * PURPOSE.
7f561c08de6b Initial load
duke
parents:
diff changeset
    39
 * See W3C License http://www.w3.org/Consortium/Legal/ for more details.
7f561c08de6b Initial load
duke
parents:
diff changeset
    40
 */
7f561c08de6b Initial load
duke
parents:
diff changeset
    41
7f561c08de6b Initial load
duke
parents:
diff changeset
    42
package org.w3c.dom.events;
7f561c08de6b Initial load
duke
parents:
diff changeset
    43
7f561c08de6b Initial load
duke
parents:
diff changeset
    44
/**
7f561c08de6b Initial load
duke
parents:
diff changeset
    45
 *  The <code>EventTarget</code> interface is implemented by all
7f561c08de6b Initial load
duke
parents:
diff changeset
    46
 * <code>Nodes</code> in an implementation which supports the DOM Event
7f561c08de6b Initial load
duke
parents:
diff changeset
    47
 * Model. Therefore, this interface can be obtained by using
7f561c08de6b Initial load
duke
parents:
diff changeset
    48
 * binding-specific casting methods on an instance of the <code>Node</code>
7f561c08de6b Initial load
duke
parents:
diff changeset
    49
 * interface. The interface allows registration and removal of
7f561c08de6b Initial load
duke
parents:
diff changeset
    50
 * <code>EventListeners</code> on an <code>EventTarget</code> and dispatch
7f561c08de6b Initial load
duke
parents:
diff changeset
    51
 * of events to that <code>EventTarget</code>.
7f561c08de6b Initial load
duke
parents:
diff changeset
    52
 * <p>See also the <a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Events-20001113'>Document Object Model (DOM) Level 2 Events Specification</a>.
7f561c08de6b Initial load
duke
parents:
diff changeset
    53
 * @since DOM Level 2
7f561c08de6b Initial load
duke
parents:
diff changeset
    54
 */
7f561c08de6b Initial load
duke
parents:
diff changeset
    55
public interface EventTarget {
7f561c08de6b Initial load
duke
parents:
diff changeset
    56
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
    57
     * This method allows the registration of event listeners on the event
7f561c08de6b Initial load
duke
parents:
diff changeset
    58
     * target. If an <code>EventListener</code> is added to an
7f561c08de6b Initial load
duke
parents:
diff changeset
    59
     * <code>EventTarget</code> while it is processing an event, it will not
7f561c08de6b Initial load
duke
parents:
diff changeset
    60
     * be triggered by the current actions but may be triggered during a
7f561c08de6b Initial load
duke
parents:
diff changeset
    61
     * later stage of event flow, such as the bubbling phase.
7f561c08de6b Initial load
duke
parents:
diff changeset
    62
     * <br> If multiple identical <code>EventListener</code>s are registered
7f561c08de6b Initial load
duke
parents:
diff changeset
    63
     * on the same <code>EventTarget</code> with the same parameters the
7f561c08de6b Initial load
duke
parents:
diff changeset
    64
     * duplicate instances are discarded. They do not cause the
7f561c08de6b Initial load
duke
parents:
diff changeset
    65
     * <code>EventListener</code> to be called twice and since they are
7f561c08de6b Initial load
duke
parents:
diff changeset
    66
     * discarded they do not need to be removed with the
7f561c08de6b Initial load
duke
parents:
diff changeset
    67
     * <code>removeEventListener</code> method.
7f561c08de6b Initial load
duke
parents:
diff changeset
    68
     * @param type The event type for which the user is registering
7f561c08de6b Initial load
duke
parents:
diff changeset
    69
     * @param listener The <code>listener</code> parameter takes an interface
7f561c08de6b Initial load
duke
parents:
diff changeset
    70
     *   implemented by the user which contains the methods to be called
7f561c08de6b Initial load
duke
parents:
diff changeset
    71
     *   when the event occurs.
7f561c08de6b Initial load
duke
parents:
diff changeset
    72
     * @param useCapture If true, <code>useCapture</code> indicates that the
7f561c08de6b Initial load
duke
parents:
diff changeset
    73
     *   user wishes to initiate capture. After initiating capture, all
7f561c08de6b Initial load
duke
parents:
diff changeset
    74
     *   events of the specified type will be dispatched to the registered
7f561c08de6b Initial load
duke
parents:
diff changeset
    75
     *   <code>EventListener</code> before being dispatched to any
7f561c08de6b Initial load
duke
parents:
diff changeset
    76
     *   <code>EventTargets</code> beneath them in the tree. Events which
7f561c08de6b Initial load
duke
parents:
diff changeset
    77
     *   are bubbling upward through the tree will not trigger an
7f561c08de6b Initial load
duke
parents:
diff changeset
    78
     *   <code>EventListener</code> designated to use capture.
7f561c08de6b Initial load
duke
parents:
diff changeset
    79
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
    80
    public void addEventListener(String type,
7f561c08de6b Initial load
duke
parents:
diff changeset
    81
                                 EventListener listener,
7f561c08de6b Initial load
duke
parents:
diff changeset
    82
                                 boolean useCapture);
7f561c08de6b Initial load
duke
parents:
diff changeset
    83
7f561c08de6b Initial load
duke
parents:
diff changeset
    84
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
    85
     * This method allows the removal of event listeners from the event
7f561c08de6b Initial load
duke
parents:
diff changeset
    86
     * target. If an <code>EventListener</code> is removed from an
7f561c08de6b Initial load
duke
parents:
diff changeset
    87
     * <code>EventTarget</code> while it is processing an event, it will not
7f561c08de6b Initial load
duke
parents:
diff changeset
    88
     * be triggered by the current actions. <code>EventListener</code>s can
7f561c08de6b Initial load
duke
parents:
diff changeset
    89
     * never be invoked after being removed.
7f561c08de6b Initial load
duke
parents:
diff changeset
    90
     * <br>Calling <code>removeEventListener</code> with arguments which do
7f561c08de6b Initial load
duke
parents:
diff changeset
    91
     * not identify any currently registered <code>EventListener</code> on
7f561c08de6b Initial load
duke
parents:
diff changeset
    92
     * the <code>EventTarget</code> has no effect.
7f561c08de6b Initial load
duke
parents:
diff changeset
    93
     * @param type Specifies the event type of the <code>EventListener</code>
7f561c08de6b Initial load
duke
parents:
diff changeset
    94
     *   being removed.
7f561c08de6b Initial load
duke
parents:
diff changeset
    95
     * @param listener The <code>EventListener</code> parameter indicates the
7f561c08de6b Initial load
duke
parents:
diff changeset
    96
     *   <code>EventListener </code> to be removed.
7f561c08de6b Initial load
duke
parents:
diff changeset
    97
     * @param useCapture Specifies whether the <code>EventListener</code>
7f561c08de6b Initial load
duke
parents:
diff changeset
    98
     *   being removed was registered as a capturing listener or not. If a
7f561c08de6b Initial load
duke
parents:
diff changeset
    99
     *   listener was registered twice, one with capture and one without,
7f561c08de6b Initial load
duke
parents:
diff changeset
   100
     *   each must be removed separately. Removal of a capturing listener
7f561c08de6b Initial load
duke
parents:
diff changeset
   101
     *   does not affect a non-capturing version of the same listener, and
7f561c08de6b Initial load
duke
parents:
diff changeset
   102
     *   vice versa.
7f561c08de6b Initial load
duke
parents:
diff changeset
   103
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
   104
    public void removeEventListener(String type,
7f561c08de6b Initial load
duke
parents:
diff changeset
   105
                                    EventListener listener,
7f561c08de6b Initial load
duke
parents:
diff changeset
   106
                                    boolean useCapture);
7f561c08de6b Initial load
duke
parents:
diff changeset
   107
7f561c08de6b Initial load
duke
parents:
diff changeset
   108
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   109
     * This method allows the dispatch of events into the implementations
7f561c08de6b Initial load
duke
parents:
diff changeset
   110
     * event model. Events dispatched in this manner will have the same
7f561c08de6b Initial load
duke
parents:
diff changeset
   111
     * capturing and bubbling behavior as events dispatched directly by the
7f561c08de6b Initial load
duke
parents:
diff changeset
   112
     * implementation. The target of the event is the
7f561c08de6b Initial load
duke
parents:
diff changeset
   113
     * <code> EventTarget</code> on which <code>dispatchEvent</code> is
7f561c08de6b Initial load
duke
parents:
diff changeset
   114
     * called.
7f561c08de6b Initial load
duke
parents:
diff changeset
   115
     * @param evt Specifies the event type, behavior, and contextual
7f561c08de6b Initial load
duke
parents:
diff changeset
   116
     *   information to be used in processing the event.
7f561c08de6b Initial load
duke
parents:
diff changeset
   117
     * @return The return value of <code>dispatchEvent</code> indicates
7f561c08de6b Initial load
duke
parents:
diff changeset
   118
     *   whether any of the listeners which handled the event called
7f561c08de6b Initial load
duke
parents:
diff changeset
   119
     *   <code>preventDefault</code>. If <code>preventDefault</code> was
7f561c08de6b Initial load
duke
parents:
diff changeset
   120
     *   called the value is false, else the value is true.
7f561c08de6b Initial load
duke
parents:
diff changeset
   121
     * @exception EventException
7f561c08de6b Initial load
duke
parents:
diff changeset
   122
     *   UNSPECIFIED_EVENT_TYPE_ERR: Raised if the <code>Event</code>'s type
7f561c08de6b Initial load
duke
parents:
diff changeset
   123
     *   was not specified by initializing the event before
7f561c08de6b Initial load
duke
parents:
diff changeset
   124
     *   <code>dispatchEvent</code> was called. Specification of the
7f561c08de6b Initial load
duke
parents:
diff changeset
   125
     *   <code>Event</code>'s type as <code>null</code> or an empty string
7f561c08de6b Initial load
duke
parents:
diff changeset
   126
     *   will also trigger this exception.
7f561c08de6b Initial load
duke
parents:
diff changeset
   127
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
   128
    public boolean dispatchEvent(Event evt)
7f561c08de6b Initial load
duke
parents:
diff changeset
   129
                                 throws EventException;
7f561c08de6b Initial load
duke
parents:
diff changeset
   130
7f561c08de6b Initial load
duke
parents:
diff changeset
   131
}