KickJava   Java API By Example, From Geeks To Geeks.

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


1 /*******************************************************************************
2  * Copyright (c) 2000, 2006 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  * widgets handling keyboard events
19  *
20  * @see VerifyListener
21  */

22
23 public final class VerifyEvent extends KeyEvent {
24     
25     /**
26      * the range of text being modified.
27      * Setting these fields has no effect.
28      */

29     public int start, end;
30     
31     /**
32      * the new text that will be inserted.
33      * Setting this field will change the text that is about to
34      * be inserted or deleted.
35      */

36     public String JavaDoc text;
37
38     static final long serialVersionUID = 3257003246269577014L;
39     
40 /**
41  * Constructs a new instance of this class based on the
42  * information in the given untyped event.
43  *
44  * @param e the untyped event containing the information
45  */

46 public VerifyEvent(Event e) {
47     super(e);
48     this.start = e.start;
49     this.end = e.end;
50     this.text = e.text;
51 }
52
53 /**
54  * Returns a string containing a concise, human-readable
55  * description of the receiver.
56  *
57  * @return a string representation of the event
58  */

59 public String JavaDoc toString() {
60     String JavaDoc string = super.toString ();
61     return string.substring (0, string.length() - 1) // remove trailing '}'
62
+ " start=" + start
63         + " end=" + end
64         + " text=" + text
65         + "}";
66 }
67 }
68
Popular Tags