KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jface > text > IDocumentPartitionerExtension3


1 /*******************************************************************************
2  * Copyright (c) 2000, 2005 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
12 package org.eclipse.jface.text;
13
14
15 /**
16  * Extension interface for {@link org.eclipse.jface.text.IDocumentPartitioner}. Adds the
17  * concept of rewrite sessions. A rewrite session is a sequence of replace
18  * operations that form a semantic unit.
19  *
20  * @since 3.1
21  */

22 public interface IDocumentPartitionerExtension3 {
23
24     /**
25      * Tells the document partitioner that a rewrite session started. A rewrite
26      * session is a sequence of replace operations that form a semantic unit.
27      * The document partitioner is allowed to use that information for internal
28      * optimization.
29      *
30      * @param session the rewrite session
31      * @throws IllegalStateException in case there is already an active rewrite session
32      */

33     void startRewriteSession(DocumentRewriteSession session) throws IllegalStateException JavaDoc;
34
35     /**
36      * Tells the document partitioner that the rewrite session has finished.
37      * This method is only called when <code>startRewriteSession</code> has
38      * been called before.
39      *
40      * @param session the rewrite session
41      */

42     void stopRewriteSession(DocumentRewriteSession session);
43
44     /**
45      * Returns the active rewrite session of this document or <code>null</code>.
46      *
47      * @return the active rewrite session or <code>null</code>
48      */

49     DocumentRewriteSession getActiveRewriteSession();
50
51     /**
52      * Connects this partitioner to a document. Connect indicates the begin of
53      * the usage of the receiver as partitioner of the given document. Thus,
54      * resources the partitioner needs to be operational for this document
55      * should be allocated.
56      * <p>
57      * The caller of this method must ensure that this partitioner is also set
58      * as the document's document partitioner.
59      * <p>
60      * <code>delayInitialization</code> indicates whether the partitioner is
61      * allowed to delay it initial computation of the document's partitioning
62      * until it has to answer the first query.
63      *
64      * Replaces {@link IDocumentPartitioner#connect(IDocument)}.
65      *
66      * @param document the document to be connected to
67      * @param delayInitialization <code>true</code> if initialization can be delayed, <code>false</code> otherwise
68      */

69     void connect(IDocument document, boolean delayInitialization);
70 }
71
Popular Tags