KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > compare > contentmergeviewer > IDocumentRange


1 /*******************************************************************************
2  * Copyright (c) 2000, 2006 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 package org.eclipse.compare.contentmergeviewer;
12
13 import org.eclipse.jface.text.Position;
14 import org.eclipse.jface.text.IDocument;
15
16
17 /**
18  * Defines a subrange in a document.
19  * <p>
20  * It is used by text viewers that can work on a subrange of a document. For example,
21  * a text viewer for Java compilation units might use this to restrict the view
22  * to a single method.
23  * </p>
24  * <p>
25  * Clients may implement this interface.
26  * </p>
27  *
28  * @see TextMergeViewer
29  * @see org.eclipse.compare.structuremergeviewer.DocumentRangeNode
30  */

31 public interface IDocumentRange {
32     
33     /**
34      * The position category typically used for an <code>IDocumentRange</code> position
35      * (value <code>"DocumentRangeCategory"</code>).
36      * @since 2.0
37      */

38     public static final String JavaDoc RANGE_CATEGORY= "DocumentRangeCategory"; //$NON-NLS-1$
39

40     /**
41      * Returns the underlying document.
42      *
43      * @return the underlying document
44      */

45     IDocument getDocument();
46     
47     /**
48      * Returns a position that specifies a subrange in the underlying document,
49      * or <code>null</code> if this document range spans the whole underlying document.
50      *
51      * @return a position that specifies a subrange in the underlying document, or <code>null</code>
52      */

53     Position getRange();
54 }
55
Popular Tags