129
|
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 * Port to the D programming language:
|
|
11 * Frank Benoit <benoit@tionex.de>
|
|
12 *******************************************************************************/
|
|
13
|
|
14 module dwtx.jface.text.IDocumentPartitionerExtension3;
|
|
15
|
|
16 import dwt.dwthelper.utils;
|
|
17
|
|
18
|
|
19 /**
|
|
20 * Extension interface for {@link dwtx.jface.text.IDocumentPartitioner}. Adds the
|
|
21 * concept of rewrite sessions. A rewrite session is a sequence of replace
|
|
22 * operations that form a semantic unit.
|
|
23 *
|
|
24 * @since 3.1
|
|
25 */
|
|
26 public interface IDocumentPartitionerExtension3 {
|
|
27
|
|
28 /**
|
|
29 * Tells the document partitioner that a rewrite session started. A rewrite
|
|
30 * session is a sequence of replace operations that form a semantic unit.
|
|
31 * The document partitioner is allowed to use that information for internal
|
|
32 * optimization.
|
|
33 *
|
|
34 * @param session the rewrite session
|
|
35 * @throws IllegalStateException in case there is already an active rewrite session
|
|
36 */
|
|
37 void startRewriteSession(DocumentRewriteSession session) throws IllegalStateException;
|
|
38
|
|
39 /**
|
|
40 * Tells the document partitioner that the rewrite session has finished.
|
|
41 * This method is only called when <code>startRewriteSession</code> has
|
|
42 * been called before.
|
|
43 *
|
|
44 * @param session the rewrite session
|
|
45 */
|
|
46 void stopRewriteSession(DocumentRewriteSession session);
|
|
47
|
|
48 /**
|
|
49 * Returns the active rewrite session of this document or <code>null</code>.
|
|
50 *
|
|
51 * @return the active rewrite session or <code>null</code>
|
|
52 */
|
|
53 DocumentRewriteSession getActiveRewriteSession();
|
|
54
|
|
55 /**
|
|
56 * Connects this partitioner to a document. Connect indicates the begin of
|
|
57 * the usage of the receiver as partitioner of the given document. Thus,
|
|
58 * resources the partitioner needs to be operational for this document
|
|
59 * should be allocated.
|
|
60 * <p>
|
|
61 * The caller of this method must ensure that this partitioner is also set
|
|
62 * as the document's document partitioner.
|
|
63 * <p>
|
|
64 * <code>delayInitialization</code> indicates whether the partitioner is
|
|
65 * allowed to delay it initial computation of the document's partitioning
|
|
66 * until it has to answer the first query.
|
|
67 *
|
|
68 * Replaces {@link IDocumentPartitioner#connect(IDocument)}.
|
|
69 *
|
|
70 * @param document the document to be connected to
|
|
71 * @param delayInitialization <code>true</code> if initialization can be delayed, <code>false</code> otherwise
|
|
72 */
|
|
73 void connect(IDocument document, bool delayInitialization);
|
|
74 }
|