Mercurial > projects > dwt-win
annotate dwt/custom/TextChangingEvent.d @ 315:349b8c12e243
Sync dwt/custom with dwt-linux
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Tue, 07 Oct 2008 16:18:26 +0200 |
parents | fd9c62a2998e |
children |
rev | line source |
---|---|
212
ab60f3309436
reverted the char[] to String and use the an alias.
Frank Benoit <benoit@tionex.de>
parents:
155
diff
changeset
|
1 /******************************************************************************* |
246 | 2 * Copyright (c) 2000, 2008 IBM Corporation and others. |
155 | 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 * Port to the D programming language: | |
11 * Frank Benoit <benoit@tionex.de> | |
12 *******************************************************************************/ | |
13 module dwt.custom.TextChangingEvent; | |
14 | |
315
349b8c12e243
Sync dwt/custom with dwt-linux
Frank Benoit <benoit@tionex.de>
parents:
246
diff
changeset
|
15 import dwt.dwthelper.utils; |
349b8c12e243
Sync dwt/custom with dwt-linux
Frank Benoit <benoit@tionex.de>
parents:
246
diff
changeset
|
16 |
155 | 17 |
18 import dwt.events.TypedEvent; | |
19 import dwt.custom.StyledTextContent; | |
20 import dwt.custom.StyledTextEvent; | |
21 | |
22 /** | |
23 * This event is sent by the StyledTextContent implementor when a change | |
24 * to the text is about to occur. | |
246 | 25 * |
26 * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> | |
155 | 27 */ |
28 public class TextChangingEvent : TypedEvent { | |
29 /** | |
30 * Start offset of the text that is going to be replaced | |
31 */ | |
32 public int start; | |
33 /** | |
34 * Text that is going to be inserted or empty string | |
35 * if no text will be inserted | |
36 */ | |
212
ab60f3309436
reverted the char[] to String and use the an alias.
Frank Benoit <benoit@tionex.de>
parents:
155
diff
changeset
|
37 public String newText; |
155 | 38 /** |
39 * Length of text that is going to be replaced | |
40 */ | |
41 public int replaceCharCount; | |
42 /** | |
43 * Length of text that is going to be inserted | |
44 */ | |
45 public int newCharCount; | |
46 /** | |
47 * Number of lines that are going to be replaced | |
48 */ | |
49 public int replaceLineCount; | |
50 /** | |
51 * Number of new lines that are going to be inserted | |
52 */ | |
53 public int newLineCount; | |
54 | |
55 static final long serialVersionUID = 3257290210114352439L; | |
56 | |
57 /** | |
58 * Create the TextChangedEvent to be used by the StyledTextContent implementor. | |
59 * <p> | |
60 * | |
61 * @param source the object that will be sending the new TextChangingEvent, | |
62 * cannot be null | |
63 */ | |
64 public this(StyledTextContent source) { | |
65 super( cast(Object)source); | |
66 } | |
67 this(StyledTextContent source, StyledTextEvent e) { | |
68 super( cast(Object)source); | |
69 start = e.start; | |
70 replaceCharCount = e.replaceCharCount; | |
71 newCharCount = e.newCharCount; | |
72 replaceLineCount = e.replaceLineCount; | |
73 newLineCount = e.newLineCount; | |
74 newText = e.text; | |
75 } | |
76 | |
77 } |