1 /*******************************************************************************
2 * Copyright (c) 2000, 2017 IBM Corporation and others.
4 * This program and the accompanying materials
5 * are made available under the terms of the Eclipse Public License 2.0
6 * which accompanies this distribution, and is available at
7 * https://www.eclipse.org/legal/epl-2.0/
9 * SPDX-License-Identifier: EPL-2.0
12 * IBM Corporation - initial API and implementation
13 *******************************************************************************/
14 package org.eclipse.swt.events;
19 import org.eclipse.swt.widgets.*;
22 * This is the super class for all typed event classes provided
23 * by SWT. Typed events contain particular information which is
24 * applicable to the event occurrence.
26 * @see org.eclipse.swt.widgets.Event
27 * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
29 public class TypedEvent extends EventObject {
32 * the display where the event occurred
36 public Display display;
39 * the widget that issued the event
44 * the time that the event occurred.
46 * NOTE: This field is an unsigned integer and should
47 * be AND'ed with 0xFFFFFFFFL so that it can be treated
53 * a field for application use
57 static final long serialVersionUID = 3257285846578377524L;
60 * Constructs a new instance of this class.
62 * @param object the object that fired the event
64 public TypedEvent(Object object) {
69 * Constructs a new instance of this class based on the
70 * information in the argument.
72 * @param e the low level event to initialize the receiver with
74 public TypedEvent(Event e) {
76 this.display = e.display;
77 this.widget = e.widget;
83 * Returns the name of the event. This is the name of
84 * the class without the package name.
86 * @return the name of the event
89 String string = getClass ().getName ();
90 int index = string.lastIndexOf ('.');
91 if (index == -1) return string;
92 return string.substring (index + 1, string.length ());
96 * Returns a string containing a concise, human-readable
97 * description of the receiver.
99 * @return a string representation of the event
102 public String toString() {