KickJava   Java API By Example, From Geeks To Geeks.

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


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 package org.eclipse.jface.text;
12
13 /**
14  * Extension to {@link org.eclipse.jface.text.IDocumentInformationMapping}.
15  * <p>
16  * Extends the information available in the mapping by providing explicit access
17  * to the isomorphic portion of the basically homomorphic information mapping.
18  *
19  * @see org.eclipse.jface.text.IDocumentInformationMapping
20  * @since 3.0
21  */

22 public interface IDocumentInformationMappingExtension {
23
24     /**
25      * Adheres to
26      * <code>originRegion=toOriginRegion(toExactImageRegion(originRegion))</code>,
27      * if <code>toExactImageRegion(originRegion) != null</code>. Returns
28      * <code>null</code> if there is no image for the given origin region.
29      *
30      * @param originRegion the origin region
31      * @return the exact image region or <code>null</code>
32      * @throws BadLocationException if origin region is not a valid region in
33      * the origin document
34      */

35     IRegion toExactImageRegion(IRegion originRegion) throws BadLocationException;
36
37     /**
38      * Returns the segments of the image document that exactly correspond to the
39      * given region of the original document. Returns <code>null</code> if
40      * there are no such image regions.
41      *
42      * @param originRegion the region in the origin document
43      * @return the segments in the image document or <code>null</code>
44      * @throws BadLocationException in case the given origin region is not valid
45      * in the original document
46      */

47     IRegion[] toExactImageRegions(IRegion originRegion) throws BadLocationException;
48
49     /**
50      * Returns the fragments of the original document that exactly correspond to
51      * the given region of the image document.
52      *
53      * @param imageRegion the region in the image document
54      * @return the fragments in the origin document
55      * @throws BadLocationException in case the given image region is not valid
56      * in the image document
57      */

58     IRegion[] toExactOriginRegions(IRegion imageRegion) throws BadLocationException;
59
60     /**
61      * Returns the length of the image document.
62      *
63      * @return the length of the image document
64      */

65     int getImageLength();
66
67     /**
68      * Returns the maximal sub-regions of the given origin region which are
69      * completely covered. I.e. each offset in a sub-region has a corresponding
70      * image offset. Returns <code>null</code> if there are no such
71      * sub-regions.
72      *
73      * @param originRegion the region in the origin document
74      * @return the sub-regions with complete coverage or <code>null</code>
75      * @throws BadLocationException in case the given origin region is not valid
76      * in the original document
77      */

78     IRegion[] getExactCoverage(IRegion originRegion) throws BadLocationException;
79 }
80
Popular Tags