]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.eclipse.swt.win32.win32.x86_64/src/org/eclipse/swt/custom/TextChangingEvent.java
Work around SWT 4.13 - 4.18 Win32 DnD bug 567422
[simantics/platform.git] / bundles / org.eclipse.swt.win32.win32.x86_64 / src / org / eclipse / swt / custom / TextChangingEvent.java
1 /*******************************************************************************
2  * Copyright (c) 2000, 2011 IBM Corporation and others.
3  *
4  * This program and the accompanying materials
5  * are made available under the terms of the Eclipse Public License 2.0
6  * which accompanies this distribution, and is available at
7  * https://www.eclipse.org/legal/epl-2.0/
8  *
9  * SPDX-License-Identifier: EPL-2.0
10  *
11  * Contributors:
12  *     IBM Corporation - initial API and implementation
13  *******************************************************************************/
14 package org.eclipse.swt.custom;
15
16
17 import org.eclipse.swt.events.*;
18
19 /**
20  * This event is sent by the StyledTextContent implementor when a change
21  * to the text is about to occur.
22  *
23  * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
24  */
25 public class TextChangingEvent extends TypedEvent {
26         /**
27          * Start offset of the text that is going to be replaced
28          */
29         public int start;
30         /**
31          * Text that is going to be inserted or empty string
32          * if no text will be inserted
33          */
34         public String newText;
35         /**
36          * Length of text that is going to be replaced
37          */
38         public int replaceCharCount;
39         /**
40          * Length of text that is going to be inserted
41          */
42         public int newCharCount;
43         /**
44          * Number of lines that are going to be replaced
45          */
46         public int replaceLineCount;
47         /**
48          * Number of new lines that are going to be inserted
49          */
50         public int newLineCount;
51
52         static final long serialVersionUID = 3257290210114352439L;
53
54 /**
55  * Create the TextChangedEvent to be used by the StyledTextContent implementor.
56  * <p>
57  *
58  * @param source the object that will be sending the new TextChangingEvent,
59  *      cannot be null
60  */
61 public TextChangingEvent(StyledTextContent source) {
62         super(source);
63 }
64 TextChangingEvent(StyledTextContent source, StyledTextEvent e) {
65         super(source);
66         start = e.start;
67         replaceCharCount = e.replaceCharCount;
68         newCharCount = e.newCharCount;
69         replaceLineCount = e.replaceLineCount;
70         newLineCount = e.newLineCount;
71         newText = e.text;
72 }
73
74 }