01: /*******************************************************************************
02: * Copyright (c) 2000, 2006 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: * widgets handling keyboard events
17: *
18: * @see VerifyListener
19: */
20:
21: public final class VerifyEvent extends KeyEvent {
22:
23: /**
24: * the range of text being modified.
25: * Setting these fields has no effect.
26: */
27: public int start, end;
28:
29: /**
30: * the new text that will be inserted.
31: * Setting this field will change the text that is about to
32: * be inserted or deleted.
33: */
34: public String text;
35:
36: static final long serialVersionUID = 3257003246269577014L;
37:
38: /**
39: * Constructs a new instance of this class based on the
40: * information in the given untyped event.
41: *
42: * @param e the untyped event containing the information
43: */
44: public VerifyEvent(Event e) {
45: super (e);
46: this .start = e.start;
47: this .end = e.end;
48: this .text = e.text;
49: }
50:
51: /**
52: * Returns a string containing a concise, human-readable
53: * description of the receiver.
54: *
55: * @return a string representation of the event
56: */
57: public String toString() {
58: String string = super .toString();
59: return string.substring(0, string.length() - 1) // remove trailing '}'
60: + " start=" + start + " end=" + end + " text="
61: + text
62: + "}";
63: }
64: }
|