Package org.eclipse.jface.text
Interface IDocumentInformationMapping
- All Known Implementing Classes:
ProjectionMapping
public interface IDocumentInformationMapping
A
IDocumentInformationMapping represents a mapping between the coordinates of two
IDocument objects: the original and the image. The document information mapping
can translate document information such as line numbers or character ranges given for the original into
the corresponding information of the image and vice versa.
In order to provided backward compatibility for clients of IDocumentInformationMapping, extension
interfaces are used to provide a means of evolution. The following extension interfaces
exist:
-
IDocumentInformationMappingExtensionsince version 3.0 extending the degree of detail of the mapping information. -
IDocumentInformationMappingExtension2since version 3.1, adding lenient image region computation.
- Since:
- 2.1
-
Method Summary
Modifier and TypeMethodDescriptionReturns the minimal region of the original document that completely comprises all of the image document ornullif there is no such region.inttoClosestImageLine(int originLine) Returns the line of the image document whose corresponding line in the original document is closest to the given line in the original document.inttoImageLine(int originLine) Returns the line of the image document that corresponds to the given line of the original document or-1if there is no such line.inttoImageOffset(int originOffset) Returns the offset in the image document that corresponds to the given offset in the original document or-1if there is no such offsettoImageRegion(IRegion originRegion) Returns the minimal region of the image document that completely comprises the given region of the original document ornullif there is no such region.inttoOriginLine(int imageLine) Returns the line of the original document that corresponds to the given line of the image document or-1if there is no such line.toOriginLines(int imageLine) Returns the range of lines of the original document that corresponds to the given line of the image document ornullif there are no such lines.inttoOriginOffset(int imageOffset) Returns the offset in the original document that corresponds to the given offset in the image document or-1if there is no such offsettoOriginRegion(IRegion imageRegion) Returns the minimal region of the original document that completely comprises the given region of the image document ornullif there is no such region.
-
Method Details
-
getCoverage
IRegion getCoverage()Returns the minimal region of the original document that completely comprises all of the image document ornullif there is no such region.- Returns:
- the minimal region of the original document comprising the image document or
null
-
toOriginOffset
Returns the offset in the original document that corresponds to the given offset in the image document or-1if there is no such offset- Parameters:
imageOffset- the offset in the image document- Returns:
- the corresponding offset in the original document or
-1 - Throws:
BadLocationException- ifimageOffsetis not a valid offset in the image document
-
toOriginRegion
Returns the minimal region of the original document that completely comprises the given region of the image document ornullif there is no such region.- Parameters:
imageRegion- the region of the image document- Returns:
- the minimal region of the original document comprising the given region of the image document or
null - Throws:
BadLocationException- ifimageRegionis not a valid region of the image document
-
toOriginLines
Returns the range of lines of the original document that corresponds to the given line of the image document ornullif there are no such lines.- Parameters:
imageLine- the line of the image document- Returns:
- the corresponding lines of the original document or
null - Throws:
BadLocationException- ifimageLineis not a valid line number in the image document
-
toOriginLine
Returns the line of the original document that corresponds to the given line of the image document or-1if there is no such line.- Parameters:
imageLine- the line of the image document- Returns:
- the corresponding line of the original document or
-1 - Throws:
BadLocationException- ifimageLineis not a valid line number in the image document
-
toImageOffset
Returns the offset in the image document that corresponds to the given offset in the original document or-1if there is no such offset- Parameters:
originOffset- the offset in the original document- Returns:
- the corresponding offset in the image document or
-1 - Throws:
BadLocationException- iforiginOffsetis not a valid offset in the original document
-
toImageRegion
Returns the minimal region of the image document that completely comprises the given region of the original document ornullif there is no such region.- Parameters:
originRegion- the region of the original document- Returns:
- the minimal region of the image document comprising the given region of the original document or
null - Throws:
BadLocationException- iforiginRegionis not a valid region of the original document
-
toImageLine
Returns the line of the image document that corresponds to the given line of the original document or-1if there is no such line.- Parameters:
originLine- the line of the original document- Returns:
- the corresponding line of the image document or
-1 - Throws:
BadLocationException- iforiginLineis not a valid line number in the original document
-
toClosestImageLine
Returns the line of the image document whose corresponding line in the original document is closest to the given line in the original document.- Parameters:
originLine- the line in the original document- Returns:
- the line in the image document that corresponds best to the given line in the original document
- Throws:
BadLocationException- iforiginLineis not a valid line in the original document
-