Eclipse 3.x compatible;
[phpeclipse.git] / net.sourceforge.phpeclipse / src / net / sourceforge / phpdt / internal / ui / text / link / ILinkedPositionListener.java
1 /*******************************************************************************
2  * Copyright (c) 2000, 2003 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials 
4  * are made available under the terms of the Common Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/cpl-v10.html
7  * 
8  * Contributors:
9  *     IBM Corporation - initial API and implementation
10  *******************************************************************************/
11
12 package net.sourceforge.phpdt.internal.ui.text.link;
13
14 import org.eclipse.jface.text.Position;
15
16 /**
17  * A listener for highlight change notification and exititing linked mode.
18  */
19 public interface ILinkedPositionListener {
20
21   /**
22    * Notifies that the linked mode has been left. On success, all changes are kept, otherwise all changes made to the linked
23    * positions are restored to the state before entering linked mode.
24    */
25   void exit(int flags);
26
27   /**
28    * Notifies the changed linked position. The listener is asked to reposition the caret at the given offset.
29    * 
30    * @param position
31    *            the linked position which initiated the change.
32    * @param caretOffset
33    *            the caret offset relative to the position.
34    */
35   void setCurrentPosition(Position position, int caretOffset);
36
37 }