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.rules.IPartitionTokenScanner;
|
|
15
|
|
16 import dwt.dwthelper.utils;
|
|
17
|
|
18
|
|
19 import dwtx.jface.text.IDocument;
|
|
20
|
|
21
|
|
22 /**
|
|
23 * A partition token scanner returns tokens that represent partitions. For that reason,
|
|
24 * a partition token scanner is vulnerable in respect to the document offset it starts
|
|
25 * scanning. In a simple case, a partition token scanner must always start at a partition
|
|
26 * boundary. A partition token scanner can also start in the middle of a partition,
|
|
27 * if it knows the type of the partition.
|
|
28 *
|
|
29 * @since 2.0
|
|
30 */
|
|
31 public interface IPartitionTokenScanner : ITokenScanner {
|
|
32
|
|
33 /**
|
|
34 * Configures the scanner by providing access to the document range that should be scanned.
|
|
35 * The range may no only contain complete partitions but starts at the beginning of a line in the
|
|
36 * middle of a partition of the given content type. This requires that a partition delimiter can not
|
|
37 * contain a line delimiter.
|
|
38 *
|
|
39 * @param document the document to scan
|
|
40 * @param offset the offset of the document range to scan
|
|
41 * @param length the length of the document range to scan
|
|
42 * @param contentType the content type at the given offset
|
|
43 * @param partitionOffset the offset at which the partition of the given offset starts
|
|
44 */
|
|
45 void setPartialRange(IDocument document, int offset, int length, String contentType, int partitionOffset);
|
|
46 }
|