jaxp/src/share/classes/org/w3c/dom/events/Event.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>Event</code> interface is used to provide contextual information
7f561c08de6b Initial load
duke
parents:
diff changeset
    46
 * about an event to the handler processing the event. An object which
7f561c08de6b Initial load
duke
parents:
diff changeset
    47
 * implements the <code>Event</code> interface is generally passed as the
7f561c08de6b Initial load
duke
parents:
diff changeset
    48
 * first parameter to an event handler. More specific context information is
7f561c08de6b Initial load
duke
parents:
diff changeset
    49
 * passed to event handlers by deriving additional interfaces from
7f561c08de6b Initial load
duke
parents:
diff changeset
    50
 * <code>Event</code> which contain information directly relating to the
7f561c08de6b Initial load
duke
parents:
diff changeset
    51
 * type of event they accompany. These derived interfaces are also
7f561c08de6b Initial load
duke
parents:
diff changeset
    52
 * implemented by the object passed to the event listener.
7f561c08de6b Initial load
duke
parents:
diff changeset
    53
 * <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
    54
 * @since DOM Level 2
7f561c08de6b Initial load
duke
parents:
diff changeset
    55
 */
7f561c08de6b Initial load
duke
parents:
diff changeset
    56
public interface Event {
7f561c08de6b Initial load
duke
parents:
diff changeset
    57
    // PhaseType
7f561c08de6b Initial load
duke
parents:
diff changeset
    58
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
    59
     * The current event phase is the capturing phase.
7f561c08de6b Initial load
duke
parents:
diff changeset
    60
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
    61
    public static final short CAPTURING_PHASE           = 1;
7f561c08de6b Initial load
duke
parents:
diff changeset
    62
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
    63
     * The event is currently being evaluated at the target
7f561c08de6b Initial load
duke
parents:
diff changeset
    64
     * <code>EventTarget</code>.
7f561c08de6b Initial load
duke
parents:
diff changeset
    65
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
    66
    public static final short AT_TARGET                 = 2;
7f561c08de6b Initial load
duke
parents:
diff changeset
    67
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
    68
     * The current event phase is the bubbling phase.
7f561c08de6b Initial load
duke
parents:
diff changeset
    69
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
    70
    public static final short BUBBLING_PHASE            = 3;
7f561c08de6b Initial load
duke
parents:
diff changeset
    71
7f561c08de6b Initial load
duke
parents:
diff changeset
    72
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
    73
     * The name of the event (case-insensitive). The name must be an XML name.
7f561c08de6b Initial load
duke
parents:
diff changeset
    74
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
    75
    public String getType();
7f561c08de6b Initial load
duke
parents:
diff changeset
    76
7f561c08de6b Initial load
duke
parents:
diff changeset
    77
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
    78
     * Used to indicate the <code>EventTarget</code> to which the event was
7f561c08de6b Initial load
duke
parents:
diff changeset
    79
     * originally dispatched.
7f561c08de6b Initial load
duke
parents:
diff changeset
    80
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
    81
    public EventTarget getTarget();
7f561c08de6b Initial load
duke
parents:
diff changeset
    82
7f561c08de6b Initial load
duke
parents:
diff changeset
    83
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
    84
     * Used to indicate the <code>EventTarget</code> whose
7f561c08de6b Initial load
duke
parents:
diff changeset
    85
     * <code>EventListeners</code> are currently being processed. This is
7f561c08de6b Initial load
duke
parents:
diff changeset
    86
     * particularly useful during capturing and bubbling.
7f561c08de6b Initial load
duke
parents:
diff changeset
    87
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
    88
    public EventTarget getCurrentTarget();
7f561c08de6b Initial load
duke
parents:
diff changeset
    89
7f561c08de6b Initial load
duke
parents:
diff changeset
    90
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
    91
     * Used to indicate which phase of event flow is currently being
7f561c08de6b Initial load
duke
parents:
diff changeset
    92
     * evaluated.
7f561c08de6b Initial load
duke
parents:
diff changeset
    93
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
    94
    public short getEventPhase();
7f561c08de6b Initial load
duke
parents:
diff changeset
    95
7f561c08de6b Initial load
duke
parents:
diff changeset
    96
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
    97
     * Used to indicate whether or not an event is a bubbling event. If the
7f561c08de6b Initial load
duke
parents:
diff changeset
    98
     * event can bubble the value is true, else the value is false.
7f561c08de6b Initial load
duke
parents:
diff changeset
    99
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
   100
    public boolean getBubbles();
7f561c08de6b Initial load
duke
parents:
diff changeset
   101
7f561c08de6b Initial load
duke
parents:
diff changeset
   102
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   103
     * Used to indicate whether or not an event can have its default action
7f561c08de6b Initial load
duke
parents:
diff changeset
   104
     * prevented. If the default action can be prevented the value is true,
7f561c08de6b Initial load
duke
parents:
diff changeset
   105
     * else the value is false.
7f561c08de6b Initial load
duke
parents:
diff changeset
   106
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
   107
    public boolean getCancelable();
7f561c08de6b Initial load
duke
parents:
diff changeset
   108
7f561c08de6b Initial load
duke
parents:
diff changeset
   109
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   110
     *  Used to specify the time (in milliseconds relative to the epoch) at
7f561c08de6b Initial load
duke
parents:
diff changeset
   111
     * which the event was created. Due to the fact that some systems may
7f561c08de6b Initial load
duke
parents:
diff changeset
   112
     * not provide this information the value of <code>timeStamp</code> may
7f561c08de6b Initial load
duke
parents:
diff changeset
   113
     * be not available for all events. When not available, a value of 0
7f561c08de6b Initial load
duke
parents:
diff changeset
   114
     * will be returned. Examples of epoch time are the time of the system
7f561c08de6b Initial load
duke
parents:
diff changeset
   115
     * start or 0:0:0 UTC 1st January 1970.
7f561c08de6b Initial load
duke
parents:
diff changeset
   116
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
   117
    public long getTimeStamp();
7f561c08de6b Initial load
duke
parents:
diff changeset
   118
7f561c08de6b Initial load
duke
parents:
diff changeset
   119
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   120
     * The <code>stopPropagation</code> method is used prevent further
7f561c08de6b Initial load
duke
parents:
diff changeset
   121
     * propagation of an event during event flow. If this method is called
7f561c08de6b Initial load
duke
parents:
diff changeset
   122
     * by any <code>EventListener</code> the event will cease propagating
7f561c08de6b Initial load
duke
parents:
diff changeset
   123
     * through the tree. The event will complete dispatch to all listeners
7f561c08de6b Initial load
duke
parents:
diff changeset
   124
     * on the current <code>EventTarget</code> before event flow stops. This
7f561c08de6b Initial load
duke
parents:
diff changeset
   125
     * method may be used during any stage of event flow.
7f561c08de6b Initial load
duke
parents:
diff changeset
   126
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
   127
    public void stopPropagation();
7f561c08de6b Initial load
duke
parents:
diff changeset
   128
7f561c08de6b Initial load
duke
parents:
diff changeset
   129
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   130
     * If an event is cancelable, the <code>preventDefault</code> method is
7f561c08de6b Initial load
duke
parents:
diff changeset
   131
     * used to signify that the event is to be canceled, meaning any default
7f561c08de6b Initial load
duke
parents:
diff changeset
   132
     * action normally taken by the implementation as a result of the event
7f561c08de6b Initial load
duke
parents:
diff changeset
   133
     * will not occur. If, during any stage of event flow, the
7f561c08de6b Initial load
duke
parents:
diff changeset
   134
     * <code>preventDefault</code> method is called the event is canceled.
7f561c08de6b Initial load
duke
parents:
diff changeset
   135
     * Any default action associated with the event will not occur. Calling
7f561c08de6b Initial load
duke
parents:
diff changeset
   136
     * this method for a non-cancelable event has no effect. Once
7f561c08de6b Initial load
duke
parents:
diff changeset
   137
     * <code>preventDefault</code> has been called it will remain in effect
7f561c08de6b Initial load
duke
parents:
diff changeset
   138
     * throughout the remainder of the event's propagation. This method may
7f561c08de6b Initial load
duke
parents:
diff changeset
   139
     * be used during any stage of event flow.
7f561c08de6b Initial load
duke
parents:
diff changeset
   140
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
   141
    public void preventDefault();
7f561c08de6b Initial load
duke
parents:
diff changeset
   142
7f561c08de6b Initial load
duke
parents:
diff changeset
   143
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   144
     * The <code>initEvent</code> method is used to initialize the value of an
7f561c08de6b Initial load
duke
parents:
diff changeset
   145
     * <code>Event</code> created through the <code>DocumentEvent</code>
7f561c08de6b Initial load
duke
parents:
diff changeset
   146
     * interface. This method may only be called before the
7f561c08de6b Initial load
duke
parents:
diff changeset
   147
     * <code>Event</code> has been dispatched via the
7f561c08de6b Initial load
duke
parents:
diff changeset
   148
     * <code>dispatchEvent</code> method, though it may be called multiple
7f561c08de6b Initial load
duke
parents:
diff changeset
   149
     * times during that phase if necessary. If called multiple times the
7f561c08de6b Initial load
duke
parents:
diff changeset
   150
     * final invocation takes precedence. If called from a subclass of
7f561c08de6b Initial load
duke
parents:
diff changeset
   151
     * <code>Event</code> interface only the values specified in the
7f561c08de6b Initial load
duke
parents:
diff changeset
   152
     * <code>initEvent</code> method are modified, all other attributes are
7f561c08de6b Initial load
duke
parents:
diff changeset
   153
     * left unchanged.
7f561c08de6b Initial load
duke
parents:
diff changeset
   154
     * @param eventTypeArg Specifies the event type. This type may be any
7f561c08de6b Initial load
duke
parents:
diff changeset
   155
     *   event type currently defined in this specification or a new event
7f561c08de6b Initial load
duke
parents:
diff changeset
   156
     *   type.. The string must be an XML name. Any new event type must not
7f561c08de6b Initial load
duke
parents:
diff changeset
   157
     *   begin with any upper, lower, or mixed case version of the string
7f561c08de6b Initial load
duke
parents:
diff changeset
   158
     *   "DOM". This prefix is reserved for future DOM event sets. It is
7f561c08de6b Initial load
duke
parents:
diff changeset
   159
     *   also strongly recommended that third parties adding their own
7f561c08de6b Initial load
duke
parents:
diff changeset
   160
     *   events use their own prefix to avoid confusion and lessen the
7f561c08de6b Initial load
duke
parents:
diff changeset
   161
     *   probability of conflicts with other new events.
7f561c08de6b Initial load
duke
parents:
diff changeset
   162
     * @param canBubbleArg Specifies whether or not the event can bubble.
7f561c08de6b Initial load
duke
parents:
diff changeset
   163
     * @param cancelableArg Specifies whether or not the event's default
7f561c08de6b Initial load
duke
parents:
diff changeset
   164
     *   action can be prevented.
7f561c08de6b Initial load
duke
parents:
diff changeset
   165
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
   166
    public void initEvent(String eventTypeArg,
7f561c08de6b Initial load
duke
parents:
diff changeset
   167
                          boolean canBubbleArg,
7f561c08de6b Initial load
duke
parents:
diff changeset
   168
                          boolean cancelableArg);
7f561c08de6b Initial load
duke
parents:
diff changeset
   169
7f561c08de6b Initial load
duke
parents:
diff changeset
   170
}