KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > swt > custom > MovementEvent


1 /*******************************************************************************
2  * Copyright (c) 2000, 2007 IBM Corporation and others.
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  *******************************************************************************/

11 package org.eclipse.swt.custom;
12
13 import org.eclipse.swt.events.*;
14
15 /**
16  * This event is sent when a new offset is required based on the current
17  * offset and a movement type.
18  *
19  * @since 3.3
20  */

21 public class MovementEvent extends TypedEvent {
22     
23     /**
24      * line start offset (input)
25      */

26     public int lineOffset;
27     
28     /**
29      * line text (input)
30      */

31     public String JavaDoc lineText;
32     
33     /**
34      * the current offset (input)
35      */

36     public int offset;
37     
38     /**
39      * the new offset (input, output)
40      */

41     public int newOffset;
42     
43     /**
44      * the movement type (input)
45      *
46      * @see org.eclipse.swt.SWT#MOVEMENT_WORD
47      * @see org.eclipse.swt.SWT#MOVEMENT_WORD_END
48      * @see org.eclipse.swt.SWT#MOVEMENT_WORD_START
49      * @see org.eclipse.swt.SWT#MOVEMENT_CHAR
50      * @see org.eclipse.swt.SWT#MOVEMENT_CLUSTER
51      */

52     public int movement;
53     
54     static final long serialVersionUID = 3978765487853324342L;
55     
56 public MovementEvent(StyledTextEvent e) {
57     super(e);
58     lineOffset = e.detail;
59     lineText = e.text;
60     movement = e.count;
61     offset = e.start;
62     newOffset = e.end;
63 }
64 }
65
66
67
Popular Tags