01: /*******************************************************************************
02: * Copyright (c) 2000, 2005 IBM Corporation and others.
03: * All rights reserved. This program and the accompanying materials
04: * are made available under the terms of the Eclipse Public License v1.0
05: * which accompanies this distribution, and is available at
06: * http://www.eclipse.org/legal/epl-v10.html
07: *
08: * Contributors:
09: * IBM Corporation - initial API and implementation
10: *******************************************************************************/package org.eclipse.jface.text;
11:
12: /**
13: * Extension to {@link org.eclipse.jface.text.IDocumentInformationMapping}.
14: * <p>
15: * Extends the information available in the mapping by providing access
16: * to the closest image region of an origin region.
17: * </p>
18: *
19: * @see org.eclipse.jface.text.IDocumentInformationMapping
20: * @since 3.1
21: */
22: public interface IDocumentInformationMappingExtension2 {
23:
24: /**
25: * Returns the minimal region of the image document that completely
26: * comprises the given region of the original document. The difference to
27: * {@link IDocumentInformationMapping#toImageRegion(IRegion)} is that this
28: * method will always return an image region for a valid origin region. If
29: * <code>originRegion</code> has no corresponding image region, the
30: * zero-length region at the offset between its surrounding fragments is
31: * returned.
32: *
33: * @param originRegion the region of the original document
34: * @return the minimal region of the image document comprising the given
35: * region of the original document
36: * @throws BadLocationException if <code>originRegion</code> is not a
37: * valid region of the original document
38: */
39: IRegion toClosestImageRegion(IRegion originRegion)
40: throws BadLocationException;
41: }
|