david_williams | cfdb2cd | 2004-11-11 08:37:49 +0000 | [diff] [blame] | 1 | /******************************************************************************* |
amywu | ecebb04 | 2007-04-10 20:07:35 +0000 | [diff] [blame] | 2 | * Copyright (c) 2001, 2005 IBM Corporation and others. |
david_williams | cfdb2cd | 2004-11-11 08:37:49 +0000 | [diff] [blame] | 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 |
amywu | ecebb04 | 2007-04-10 20:07:35 +0000 | [diff] [blame] | 7 | * |
david_williams | cfdb2cd | 2004-11-11 08:37:49 +0000 | [diff] [blame] | 8 | * Contributors: |
| 9 | * IBM Corporation - initial API and implementation |
| 10 | * Jens Lukowski/Innoopract - initial renaming/restructuring |
| 11 | * |
| 12 | *******************************************************************************/ |
david_williams | f3680f0 | 2005-04-13 22:43:54 +0000 | [diff] [blame] | 13 | package org.eclipse.wst.sse.ui.internal.view.events; |
david_williams | cfdb2cd | 2004-11-11 08:37:49 +0000 | [diff] [blame] | 14 | |
david_williams | cfdb2cd | 2004-11-11 08:37:49 +0000 | [diff] [blame] | 15 | /** |
nitind | 0d5b341 | 2005-09-27 21:36:16 +0000 | [diff] [blame] | 16 | * @deprecated - use base selection notification |
| 17 | * |
david_williams | cfdb2cd | 2004-11-11 08:37:49 +0000 | [diff] [blame] | 18 | * Simply holds data to be passed to CaretEventListeners |
| 19 | */ |
| 20 | public class CaretEvent extends java.util.EventObject { |
| 21 | |
david_williams | 16f26a8 | 2004-11-12 07:30:49 +0000 | [diff] [blame] | 22 | /** |
| 23 | * Comment for <code>serialVersionUID</code> |
| 24 | */ |
| 25 | private static final long serialVersionUID = 1L; |
david_williams | cfdb2cd | 2004-11-11 08:37:49 +0000 | [diff] [blame] | 26 | // initialize to impossible location |
| 27 | int fPosition = -1; |
| 28 | |
| 29 | /** |
| 30 | * doesnt't make sense to have a CaretEvent without the Caret postion, so |
| 31 | * use other constructor |
| 32 | */ |
| 33 | protected CaretEvent(Object source) { |
| 34 | super(source); |
| 35 | } |
| 36 | |
| 37 | /** |
| 38 | * This is the preferred constructor. |
| 39 | */ |
| 40 | public CaretEvent(Object source, int position) { |
| 41 | super(source); |
| 42 | setPosition(position); |
| 43 | } |
| 44 | |
| 45 | public int getPosition() { |
| 46 | return fPosition; |
| 47 | } |
| 48 | |
| 49 | void setPosition(int newPosition) { |
| 50 | fPosition = newPosition; |
| 51 | } |
| 52 | } |