comparison dwt/custom/MovementEvent.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, 2007 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.MovementEvent;
12 14
13 import dwt.events.*; 15 import dwt.dwthelper.utils;
16
17 import dwt.events.TypedEvent;
18 import dwt.custom.StyledTextEvent;
14 19
15 /** 20 /**
16 * This event is sent when a new offset is required based on the current 21 * This event is sent when a new offset is required based on the current
17 * offset and a movement type. 22 * offset and a movement type.
18 * 23 *
24 * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
25 *
19 * @since 3.3 26 * @since 3.3
20 */ 27 */
21 public class MovementEvent : TypedEvent { 28 public class MovementEvent : TypedEvent {
22 29
23 /** 30 /**
24 * line start offset (input) 31 * line start offset (input)
25 */ 32 */
26 public int lineOffset; 33 public int lineOffset;
27 34
28 /** 35 /**
29 * line text (input) 36 * line text (input)
30 */ 37 */
31 public String lineText; 38 public String lineText;
32 39
33 /** 40 /**
34 * the current offset (input) 41 * the current offset (input)
35 */ 42 */
36 public int offset; 43 public int offset;
37 44
38 /** 45 /**
39 * the new offset (input, output) 46 * the new offset (input, output)
40 */ 47 */
41 public int newOffset; 48 public int newOffset;
42 49
43 /** 50 /**
44 * the movement type (input) 51 * the movement type (input)
45 * 52 *
46 * @see dwt.DWT#MOVEMENT_WORD 53 * @see dwt.DWT#MOVEMENT_WORD
47 * @see dwt.DWT#MOVEMENT_WORD_END 54 * @see dwt.DWT#MOVEMENT_WORD_END
48 * @see dwt.DWT#MOVEMENT_WORD_START 55 * @see dwt.DWT#MOVEMENT_WORD_START
49 * @see dwt.DWT#MOVEMENT_CHAR 56 * @see dwt.DWT#MOVEMENT_CHAR
50 * @see dwt.DWT#MOVEMENT_CLUSTER 57 * @see dwt.DWT#MOVEMENT_CLUSTER
51 */ 58 */
52 public int movement; 59 public int movement;
53 60
54 static final long serialVersionUID = 3978765487853324342L; 61 static final long serialVersionUID = 3978765487853324342L;
55 62
63 /**
64 * Constructs a new instance of this class based on the
65 * information in the given event.
66 *
67 * @param e the event containing the information
68 */
56 public this(StyledTextEvent e) { 69 public this(StyledTextEvent e) {
57 super(e); 70 super(cast(Object)e);
58 lineOffset = e.detail; 71 lineOffset = e.detail;
59 lineText = e.text; 72 lineText = e.text;
60 movement = e.count; 73 movement = e.count;
61 offset = e.start; 74 offset = e.start;
62 newOffset = e.end; 75 newOffset = e.end;