KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > swt > events > ShellEvent


1 /*******************************************************************************
2  * Copyright (c) 2000, 2004 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.swt.events;
12
13
14 import org.eclipse.swt.widgets.Event;
15
16 /**
17  * Instances of this class are sent as a result of
18  * operations being performed on shells.
19  *
20  * @see ShellListener
21  */

22
23 public final class ShellEvent extends TypedEvent {
24
25     /**
26      * A flag indicating whether the operation should be allowed.
27      * Setting this field to <code>false</code> will cancel the operation.
28      */

29     public boolean doit;
30     
31     static final long serialVersionUID = 3257569490479888441L;
32     
33 /**
34  * Constructs a new instance of this class based on the
35  * information in the given untyped event.
36  *
37  * @param e the untyped event containing the information
38  */

39 public ShellEvent(Event e) {
40     super(e);
41     this.doit = e.doit;
42 }
43
44 /**
45  * Returns a string containing a concise, human-readable
46  * description of the receiver.
47  *
48  * @return a string representation of the event
49  */

50 public String JavaDoc toString() {
51     String JavaDoc string = super.toString ();
52     return string.substring (0, string.length() - 1) // remove trailing '}'
53
+ " doit=" + doit
54         + "}";
55 }
56 }
57
58
Popular Tags