public interface IDocumentInformationMapping
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:
IDocumentInformationMappingExtension
since version 3.0 extending the
degree of detail of the mapping information.IDocumentInformationMappingExtension2
since version 3.1, adding lenient
image region computation.Modifier and Type | Method and Description |
---|---|
IRegion |
getCoverage()
Returns the minimal region of the original document that completely comprises all of the image document
or
null if there is no such region. |
int |
toClosestImageLine(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.
|
int |
toImageLine(int originLine)
Returns the line of the image document that corresponds to the given line of the original document or
-1 if there is no such line. |
int |
toImageOffset(int originOffset)
Returns the offset in the image document that corresponds to the given offset in the original document
or
-1 if there is no such offset |
IRegion |
toImageRegion(IRegion originRegion)
Returns the minimal region of the image document that completely comprises the given region of the
original document or
null if there is no such region. |
int |
toOriginLine(int imageLine)
Returns the line of the original document that corresponds to the given line of the image document or
-1 if there is no such line. |
IRegion |
toOriginLines(int imageLine)
Returns the range of lines of the original document that corresponds to the given line of the image document or
null if there are no such lines. |
int |
toOriginOffset(int imageOffset)
Returns the offset in the original document that corresponds to the given offset in the image document
or
-1 if there is no such offset |
IRegion |
toOriginRegion(IRegion imageRegion)
Returns the minimal region of the original document that completely comprises the given region of the
image document or
null if there is no such region. |
IRegion getCoverage()
null
if there is no such region.null
int toOriginOffset(int imageOffset) throws BadLocationException
-1
if there is no such offsetimageOffset
- the offset in the image document-1
BadLocationException
- if imageOffset
is not a valid offset in the image documentIRegion toOriginRegion(IRegion imageRegion) throws BadLocationException
null
if there is no such region.imageRegion
- the region of the image documentnull
BadLocationException
- if imageRegion
is not a valid region of the image documentIRegion toOriginLines(int imageLine) throws BadLocationException
null
if there are no such lines.imageLine
- the line of the image documentnull
BadLocationException
- if imageLine
is not a valid line number in the image documentint toOriginLine(int imageLine) throws BadLocationException
-1
if there is no such line.imageLine
- the line of the image document-1
BadLocationException
- if imageLine
is not a valid line number in the image documentint toImageOffset(int originOffset) throws BadLocationException
-1
if there is no such offsetoriginOffset
- the offset in the original document-1
BadLocationException
- if originOffset
is not a valid offset in the original documentIRegion toImageRegion(IRegion originRegion) throws BadLocationException
null
if there is no such region.originRegion
- the region of the original documentnull
BadLocationException
- if originRegion
is not a valid region of the original documentint toImageLine(int originLine) throws BadLocationException
-1
if there is no such line.originLine
- the line of the original document-1
BadLocationException
- if originLine
is not a valid line number in the original documentint toClosestImageLine(int originLine) throws BadLocationException
originLine
- the line in the original documentBadLocationException
- if originLine
is not a valid line in the original document
Copyright (c) 2000, 2015 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.