1
|
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 org.eclipse.swt.events.VerifyEvent;
|
|
12
|
|
13
|
|
14 import org.eclipse.swt.widgets.Event;
|
|
15 import org.eclipse.swt.events.KeyEvent;
|
|
16
|
|
17 import tango.text.convert.Format;
|
|
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 : 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 char[] 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 this(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 char[] toString() {
|
|
62 return Format( "{} start={} end={} text={}}", super.toString[ 0 .. $-2 ], start, end, text );
|
|
63 }
|
|
64 }
|