1 /*******************************************************************************
2 * Copyright (c) 2000, 2011 IBM Corporation and others.
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/
9 * SPDX-License-Identifier: EPL-2.0
12 * IBM Corporation - initial API and implementation
13 *******************************************************************************/
14 package org.eclipse.swt.custom;
17 import org.eclipse.swt.events.*;
20 * This event is sent by the StyledTextContent implementor when a change
21 * to the text is about to occur.
23 * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
25 public class TextChangingEvent extends TypedEvent {
27 * Start offset of the text that is going to be replaced
31 * Text that is going to be inserted or empty string
32 * if no text will be inserted
34 public String newText;
36 * Length of text that is going to be replaced
38 public int replaceCharCount;
40 * Length of text that is going to be inserted
42 public int newCharCount;
44 * Number of lines that are going to be replaced
46 public int replaceLineCount;
48 * Number of new lines that are going to be inserted
50 public int newLineCount;
52 static final long serialVersionUID = 3257290210114352439L;
55 * Create the TextChangedEvent to be used by the StyledTextContent implementor.
58 * @param source the object that will be sending the new TextChangingEvent,
61 public TextChangingEvent(StyledTextContent source) {
64 TextChangingEvent(StyledTextContent source, StyledTextEvent e) {
67 replaceCharCount = e.replaceCharCount;
68 newCharCount = e.newCharCount;
69 replaceLineCount = e.replaceLineCount;
70 newLineCount = e.newLineCount;