Package org.eclipse.jface.text

# Interface IDocumentInformationMappingExtension2

All Known Implementing Classes:
  `ProjectionMapping`

public interface IDocumentInformationMappingExtension2
Extension to `IDocumentInformationMapping`.

Extends the information available in the mapping by providing access to the closest image region of an origin region.

Since:
  3.1
See Also:
  - `IDocumentInformationMapping`

## Method Summary

Modifier and Type
Method
Description
`IRegion`
`toClosestImageRegion(IRegion originRegion)`
Returns the minimal region of the image document that completely comprises the given region of the original document.

## Method Details

### toClosestImageRegion

IRegion toClosestImageRegion(IRegion originRegion) throws BadLocationException
Returns the minimal region of the image document that completely comprises the given region of the original document. The difference to `IDocumentInformationMapping.toImageRegion(IRegion)` is that this method will always return an image region for a valid origin region. If `originRegion` has no corresponding image region, the zero-length region at the offset between its surrounding fragments is returned.

Parameters:
  `originRegion` - the region of the original document
Returns:
  the minimal region of the image document comprising the given region of the original document
Throws:
  `BadLocationException` - if `originRegion` is not a valid region of the original document