94028c997c0ff930d662a6ab20ab0d3fc4ee84e5
[phpeclipse.git] / net.sourceforge.phpeclipse / src / net / sourceforge / phpdt / internal / ui / text / link / LinkedPositionListener.java
1 /*
2  * (c) Copyright IBM Corp. 2000, 2001.
3  * All Rights Reserved.
4  */
5 package net.sourceforge.phpdt.internal.ui.text.link;
6
7 import org.eclipse.jface.text.IDocumentExtension;
8 import org.eclipse.jface.text.Position;
9
10 /**
11  * A listener for highlight change notification and exititing linked mode.
12  */
13 public interface LinkedPositionListener {
14         
15         /**
16          * Notifies that the linked mode has been left. On success, all changes
17          * are kept, otherwise all changes made to the linked positions are restored
18          * to the state before entering linked mode.
19          */
20         void exit(boolean success);
21         
22         /**
23          * Notifies the changed linked position. The listener is asked
24          * to reposition the caret at the given offset.
25          * 
26          * @param position    the linked position which initiated the change.
27          * @param caretOffset the caret offset relative to the position.
28          */
29         void setCurrentPosition(Position position, int caretOffset);
30
31 }