KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jface > text > rules > IPartitionTokenScanner


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.rules;
13
14
15 import org.eclipse.jface.text.IDocument;
16
17
18 /**
19  * A partition token scanner returns tokens that represent partitions. For that reason,
20  * a partition token scanner is vulnerable in respect to the document offset it starts
21  * scanning. In a simple case, a partition token scanner must always start at a partition
22  * boundary. A partition token scanner can also start in the middle of a partition,
23  * if it knows the type of the partition.
24  *
25  * @since 2.0
26  */

27 public interface IPartitionTokenScanner extends ITokenScanner {
28
29     /**
30      * Configures the scanner by providing access to the document range that should be scanned.
31      * The range may no only contain complete partitions but starts at the beginning of a line in the
32      * middle of a partition of the given content type. This requires that a partition delimiter can not
33      * contain a line delimiter.
34      *
35      * @param document the document to scan
36      * @param offset the offset of the document range to scan
37      * @param length the length of the document range to scan
38      * @param contentType the content type at the given offset
39      * @param partitionOffset the offset at which the partition of the given offset starts
40      */

41     void setPartialRange(IDocument document, int offset, int length, String JavaDoc contentType, int partitionOffset);
42 }
43
Popular Tags