|
Eclipse Platform Release 3.1 |
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.jface.text.projection.ProjectionMapping
Internal class. Do not use. Only public for testing purposes.
Implementation of IDocumentInformationMapping
for the projection mapping between a master and a slave document.
Constructor Summary | |
---|---|
ProjectionMapping(IDocument masterDocument,
String fragmentsCategory,
IDocument slaveDocument,
String segmentsCategory)
Creates a new mapping between the given parent document and the given projection document. |
Method Summary | |
---|---|
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. |
IRegion[] |
getExactCoverage(IRegion originRegion)
Returns the maximal sub-regions of the given origin region which are completely covered. |
int |
getImageLength()
Returns the length of the image document. |
void |
projectionChanged()
Notifies this projection mapping that there was a projection change. |
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. |
IRegion |
toClosestImageRegion(IRegion originRegion)
Returns the minimal region of the image document that completely comprises the given region of the original document. |
IRegion |
toExactImageRegion(IRegion originRegion)
Adheres to originRegion=toOriginRegion(toExactImageRegion(originRegion)) ,
if toExactImageRegion(originRegion) ! |
IRegion[] |
toExactImageRegions(IRegion originRegion)
Returns the segments of the image document that exactly correspond to the given region of the original document. |
IRegion[] |
toExactOriginRegions(IRegion imageRegion)
Returns the fragments of the original document that exactly correspond to the given region of the image 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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public ProjectionMapping(IDocument masterDocument, String fragmentsCategory, IDocument slaveDocument, String segmentsCategory)
masterDocument
- the master documentfragmentsCategory
- the position category of the parent document used to manage the projected regionsslaveDocument
- the slave documentsegmentsCategory
- the position category of the projection document used to manage the fragmentsMethod Detail |
public void projectionChanged()
public IRegion getCoverage()
IDocumentInformationMapping
null
if there is no such region.
getCoverage
in interface IDocumentInformationMapping
null
public int toOriginOffset(int imageOffset) throws BadLocationException
IDocumentInformationMapping
-1
if there is no such offset
toOriginOffset
in interface IDocumentInformationMapping
imageOffset
- the offset in the image document
-1
BadLocationException
- if imageOffset
is not a valid offset in the image documentpublic IRegion toOriginRegion(IRegion imageRegion) throws BadLocationException
IDocumentInformationMapping
null
if there is no such region.
toOriginRegion
in interface IDocumentInformationMapping
imageRegion
- the region of the image document
null
BadLocationException
- if imageRegion
is not a valid region of the image documentpublic IRegion toOriginLines(int imageLine) throws BadLocationException
IDocumentInformationMapping
null
if there are no such lines.
toOriginLines
in interface IDocumentInformationMapping
imageLine
- the line of the image document
null
BadLocationException
- if imageLine
is not a valid line number in the image documentpublic int toOriginLine(int imageLine) throws BadLocationException
IDocumentInformationMapping
-1
if there is no such line.
toOriginLine
in interface IDocumentInformationMapping
imageLine
- the line of the image document
-1
BadLocationException
- if imageLine
is not a valid line number in the image documentpublic int toImageOffset(int originOffset) throws BadLocationException
IDocumentInformationMapping
-1
if there is no such offset
toImageOffset
in interface IDocumentInformationMapping
originOffset
- the offset in the original document
-1
BadLocationException
- if originOffset
is not a valid offset in the original documentpublic IRegion toExactImageRegion(IRegion originRegion) throws BadLocationException
IDocumentInformationMappingExtension
originRegion=toOriginRegion(toExactImageRegion(originRegion))
,
if toExactImageRegion(originRegion) != null
. Returns
null
if there is no image for the given origin region.
toExactImageRegion
in interface IDocumentInformationMappingExtension
originRegion
- the origin region
null
BadLocationException
- if origin region is not a valid region in
the origin documentpublic IRegion toImageRegion(IRegion originRegion) throws BadLocationException
IDocumentInformationMapping
null
if there is no such region.
toImageRegion
in interface IDocumentInformationMapping
originRegion
- the region of the original document
null
BadLocationException
- if originRegion
is not a valid region of the original documentpublic IRegion toClosestImageRegion(IRegion originRegion) throws BadLocationException
IDocumentInformationMappingExtension2
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.
toClosestImageRegion
in interface IDocumentInformationMappingExtension2
originRegion
- the region of the original document
BadLocationException
- if originRegion
is not a
valid region of the original documentpublic int toImageLine(int originLine) throws BadLocationException
IDocumentInformationMapping
-1
if there is no such line.
toImageLine
in interface IDocumentInformationMapping
originLine
- the line of the original document
-1
BadLocationException
- if originLine
is not a valid line number in the original documentpublic int toClosestImageLine(int originLine) throws BadLocationException
IDocumentInformationMapping
toClosestImageLine
in interface IDocumentInformationMapping
originLine
- the line in the original document
BadLocationException
- if originLine
is not a valid line in the original documentpublic IRegion[] toExactOriginRegions(IRegion imageRegion) throws BadLocationException
IDocumentInformationMappingExtension
toExactOriginRegions
in interface IDocumentInformationMappingExtension
imageRegion
- the region in the image document
BadLocationException
- in case the given image region is not valid
in the image documentpublic int getImageLength()
IDocumentInformationMappingExtension
getImageLength
in interface IDocumentInformationMappingExtension
public IRegion[] toExactImageRegions(IRegion originRegion) throws BadLocationException
IDocumentInformationMappingExtension
null
if
there are no such image regions.
toExactImageRegions
in interface IDocumentInformationMappingExtension
originRegion
- the region in the origin document
null
BadLocationException
- in case the given origin region is not valid
in the original documentpublic IRegion[] getExactCoverage(IRegion originRegion) throws BadLocationException
IDocumentInformationMappingExtension
null
if there are no such
sub-regions.
getExactCoverage
in interface IDocumentInformationMappingExtension
originRegion
- the region in the origin document
null
BadLocationException
- in case the given origin region is not valid
in the original document
|
Eclipse Platform Release 3.1 |
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Guidelines for using Eclipse APIs.
Copyright (c) IBM Corp. and others 2000, 2005. All rights reserved.