comparison dwt/events/VerifyEvent.d @ 0:380af2bdd8e5

Upload of whole dwt tree
author Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
date Sat, 09 Aug 2008 17:00:02 +0200
parents
children 649b8e223d5a
comparison
equal deleted inserted replaced
-1:000000000000 0:380af2bdd8e5
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 module dwt.events.VerifyEvent;
12
13 import dwt.dwthelper.utils;
14
15
16 import dwt.widgets.Event;
17
18 /**
19 * Instances of this class are sent as a result of
20 * widgets handling keyboard events
21 *
22 * @see VerifyListener
23 */
24
25 public final class VerifyEvent extends KeyEvent {
26
27 /**
28 * the range of text being modified.
29 * Setting these fields has no effect.
30 */
31 public int start, end;
32
33 /**
34 * the new text that will be inserted.
35 * Setting this field will change the text that is about to
36 * be inserted or deleted.
37 */
38 public String text;
39
40 static final long serialVersionUID = 3257003246269577014L;
41
42 /**
43 * Constructs a new instance of this class based on the
44 * information in the given untyped event.
45 *
46 * @param e the untyped event containing the information
47 */
48 public VerifyEvent(Event e) {
49 super(e);
50 this.start = e.start;
51 this.end = e.end;
52 this.text = e.text;
53 }
54
55 /**
56 * Returns a string containing a concise, human-readable
57 * description of the receiver.
58 *
59 * @return a string representation of the event
60 */
61 public String toString() {
62 String string = super.toString ();
63 return string.substring (0, string.length() - 1) // remove trailing '}'
64 + " start=" + start
65 + " end=" + end
66 + " text=" + text
67 + "}";
68 }
69 }