01: /*******************************************************************************
02: * Copyright (c) 2000, 2004 IBM Corporation and others.
03: * All rights reserved. This program and the accompanying materials
04: * are made available under the terms of the Eclipse Public License v1.0
05: * which accompanies this distribution, and is available at
06: * http://www.eclipse.org/legal/epl-v10.html
07: *
08: * Contributors:
09: * IBM Corporation - initial API and implementation
10: *******************************************************************************/package org.eclipse.swt.events;
11:
12: import org.eclipse.swt.widgets.Event;
13:
14: /**
15: * Instances of this class are sent as a result of
16: * operations being performed on shells.
17: *
18: * @see ShellListener
19: */
20:
21: public final class ShellEvent extends TypedEvent {
22:
23: /**
24: * A flag indicating whether the operation should be allowed.
25: * Setting this field to <code>false</code> will cancel the operation.
26: */
27: public boolean doit;
28:
29: static final long serialVersionUID = 3257569490479888441L;
30:
31: /**
32: * Constructs a new instance of this class based on the
33: * information in the given untyped event.
34: *
35: * @param e the untyped event containing the information
36: */
37: public ShellEvent(Event e) {
38: super (e);
39: this .doit = e.doit;
40: }
41:
42: /**
43: * Returns a string containing a concise, human-readable
44: * description of the receiver.
45: *
46: * @return a string representation of the event
47: */
48: public String toString() {
49: String string = super .toString();
50: return string.substring(0, string.length() - 1) // remove trailing '}'
51: + " doit=" + doit + "}";
52: }
53: }
|