KickJava   Java API By Example, From Geeks To Geeks.

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


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 access
17  * to the closest image region of an origin region.
18  * </p>
19  *
20  * @see org.eclipse.jface.text.IDocumentInformationMapping
21  * @since 3.1
22  */

23 public interface IDocumentInformationMappingExtension2 {
24
25     /**
26      * Returns the minimal region of the image document that completely
27      * comprises the given region of the original document. The difference to
28      * {@link IDocumentInformationMapping#toImageRegion(IRegion)} is that this
29      * method will always return an image region for a valid origin region. If
30      * <code>originRegion</code> has no corresponding image region, the
31      * zero-length region at the offset between its surrounding fragments is
32      * returned.
33      *
34      * @param originRegion the region of the original document
35      * @return the minimal region of the image document comprising the given
36      * region of the original document
37      * @throws BadLocationException if <code>originRegion</code> is not a
38      * valid region of the original document
39      */

40     IRegion toClosestImageRegion(IRegion originRegion) throws BadLocationException;
41 }
42
Popular Tags