comparison dwt/custom/TextChangingEvent.d @ 41:6337764516f1

Sync dwt/custom with dwt-linux (took copy of complete folder)
author Frank Benoit <benoit@tionex.de>
date Tue, 07 Oct 2008 16:29:55 +0200
parents 1a8b3cb347e0
children
comparison
equal deleted inserted replaced
40:fbe68c33eeee 41:6337764516f1
1 /******************************************************************************* 1 /*******************************************************************************
2 * Copyright (c) 2000, 2004 IBM Corporation and others. 2 * Copyright (c) 2000, 2008 IBM Corporation and others.
3 * All rights reserved. This program and the accompanying materials 3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Eclipse Public License v1.0 4 * are made available under the terms of the Eclipse Public License v1.0
5 * which accompanies this distribution, and is available at 5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/epl-v10.html 6 * http://www.eclipse.org/legal/epl-v10.html
7 * 7 *
8 * Contributors: 8 * Contributors:
9 * IBM Corporation - initial API and implementation 9 * IBM Corporation - initial API and implementation
10 * Port to the D programming language:
11 * Frank Benoit <benoit@tionex.de>
10 *******************************************************************************/ 12 *******************************************************************************/
11 module dwt.custom; 13 module dwt.custom.TextChangingEvent;
14
15 import dwt.dwthelper.utils;
12 16
13 17
14 import dwt.events.*; 18 import dwt.events.TypedEvent;
19 import dwt.custom.StyledTextContent;
20 import dwt.custom.StyledTextEvent;
15 21
16 /** 22 /**
17 * This event is sent by the StyledTextContent implementor when a change 23 * This event is sent by the StyledTextContent implementor when a change
18 * to the text is about to occur. 24 * to the text is about to occur.
25 *
26 * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
19 */ 27 */
20 public class TextChangingEvent : TypedEvent { 28 public class TextChangingEvent : TypedEvent {
21 /** 29 /**
22 * Start offset of the text that is going to be replaced 30 * Start offset of the text that is going to be replaced
23 */ 31 */
24 public int start; 32 public int start;
25 /** 33 /**
26 * Text that is going to be inserted or empty String 34 * Text that is going to be inserted or empty string
27 * if no text will be inserted 35 * if no text will be inserted
28 */ 36 */
29 public String newText; 37 public String newText;
30 /** 38 /**
31 * Length of text that is going to be replaced 39 * Length of text that is going to be replaced
43 * Number of new lines that are going to be inserted 51 * Number of new lines that are going to be inserted
44 */ 52 */
45 public int newLineCount; 53 public int newLineCount;
46 54
47 static final long serialVersionUID = 3257290210114352439L; 55 static final long serialVersionUID = 3257290210114352439L;
48 56
49 /** 57 /**
50 * Create the TextChangedEvent to be used by the StyledTextContent implementor. 58 * Create the TextChangedEvent to be used by the StyledTextContent implementor.
51 * <p> 59 * <p>
52 * 60 *
53 * @param source the object that will be sending the new TextChangingEvent, 61 * @param source the object that will be sending the new TextChangingEvent,
54 * cannot be null 62 * cannot be null
55 */ 63 */
56 public this(StyledTextContent source) { 64 public this(StyledTextContent source) {
57 super(source); 65 super( cast(Object)source);
58 } 66 }
59 this(StyledTextContent source, StyledTextEvent e) { 67 this(StyledTextContent source, StyledTextEvent e) {
60 super(source); 68 super( cast(Object)source);
61 start = e.start; 69 start = e.start;
62 replaceCharCount = e.replaceCharCount; 70 replaceCharCount = e.replaceCharCount;
63 newCharCount = e.newCharCount; 71 newCharCount = e.newCharCount;
64 replaceLineCount = e.replaceLineCount; 72 replaceLineCount = e.replaceLineCount;
65 newLineCount = e.newLineCount; 73 newLineCount = e.newLineCount;