01: /*******************************************************************************
02: * Copyright (c) 2000, 2005 IBM Corporation and others.
03: * All rights reserved. This program and the accompanying materials
04: * are made available under the terms of the Eclipse Public License v1.0
05: * which accompanies this distribution, and is available at
06: * http://www.eclipse.org/legal/epl-v10.html
07: *
08: * Contributors:
09: * IBM Corporation - initial API and implementation
10: *******************************************************************************/package org.eclipse.jface.text;
11:
12: /**
13: * Extension interface for {@link org.eclipse.jface.text.ILineTracker}. Adds the
14: * concept of rewrite sessions. A rewrite session is a sequence of replace
15: * operations that form a semantic unit.
16: *
17: * @since 3.1
18: */
19: public interface ILineTrackerExtension {
20:
21: /**
22: * Tells the line tracker that a rewrite session started. A rewrite session
23: * is a sequence of replace operations that form a semantic unit. The line
24: * tracker is allowed to use that information for internal optimization.
25: *
26: * @param session the rewrite session
27: * @throws IllegalStateException in case there is already an active rewrite
28: * session
29: */
30: void startRewriteSession(DocumentRewriteSession session)
31: throws IllegalStateException;
32:
33: /**
34: * Tells the line tracker that the rewrite session has finished. This method
35: * is only called when <code>startRewriteSession</code> has been called
36: * before. The text resulting from the rewrite session is passed to the line
37: * tracker.
38: *
39: * @param session the rewrite session
40: * @param text the text with which to re-initialize the line tracker
41: */
42: void stopRewriteSession(DocumentRewriteSession session, String text);
43: }
|