| java.lang.Object org.eclipse.jface.text.AbstractDocument org.eclipse.jface.text.projection.ProjectionDocument
All known Subclasses: org.eclipse.jface.text.projection.ChildDocument,
ProjectionDocument | public class ProjectionDocument extends AbstractDocument (Code) | | A ProjectionDocument represents a projection of its master
document. The contents of a projection document is a sequence of fragments of
the master document, i.e. the projection document can be thought as being
constructed from the master document by not copying the whole master document
but omitting several ranges of the master document.
The projection document indirectly utilizes its master document as
ITextStore by means of a ProjectionTextStore .
The content of a projection document can be changed in two ways. Either by a
text replace applied to the master document or the projection document. Or by
changing the projection between the master document and the projection
document. For the latter the two methods addMasterDocumentRange
and removeMasterDocumentRange are provided. For any
manipulation, the projection document sends out a
org.eclipse.jface.text.projection.ProjectionDocumentEvent describing
the change.
Clients are not supposed to directly instantiate this class. In order to
obtain a projection document, a
org.eclipse.jface.text.projection.ProjectionDocumentManager should be
used. This class is not intended to be subclassed outside of its origin
package.
since: 3.0 |
Method Summary | |
final protected boolean | adaptProjectionToMasterChange(DocumentEvent masterEvent) Ensures that when the master event affects this projection document, that the whole region described by the
event is part of this projection document. | public void | addMasterDocumentRange(int offsetInMaster, int lengthInMaster) Ensures that the given range of the master document is part of this
projection document. | final public IRegion[] | computeProjectedMasterRegions(int offsetInMaster, int lengthInMaster) Returns the sequence of all master document regions with are contained in the given master document
range and which are part of this projection document. | final public IRegion[] | computeUnprojectedMasterRegions(int offsetInMaster, int lengthInMaster) Returns the sequence of all master document regions which are contained
in the given master document range and which are not yet part of this
projection document. | public void | dispose() Disposes this projection document. | protected void | fireDocumentAboutToBeChanged(DocumentEvent event) | protected void | fireDocumentChanged(DocumentEvent event) Ignores the given event and sends the semantically equal slave document event instead. | public String | getDefaultLineDelimiter() | final protected Position[] | getFragments() Returns the fragments of the master documents. | public IDocument | getMasterDocument() Returns the master document of this projection document. | public IDocumentInformationMapping | getProjectionMapping() Returns the projection mapping used by this document. | final protected Position[] | getSegments() Returns the segments of this projection document. | protected boolean | isUpdating() Returns whether this projection is being updated. | public void | masterDocumentAboutToBeChanged(DocumentEvent masterEvent) When called, this projection document is informed about a forthcoming
change of its master document. | public void | masterDocumentChanged(DocumentEvent masterEvent) When called, this projection document is informed about a change of its
master document. | public void | registerPostNotificationReplace(IDocumentListener owner, IDocumentExtension.IReplace replace) | public void | removeMasterDocumentRange(int offsetInMaster, int lengthInMaster) Ensures that the given range of the master document is not part of this
projection document. | public void | replace(int offset, int length, String text) | public void | replaceMasterDocumentRanges(int offsetInMaster, int lengthInMaster) Replaces all master document ranges with the given master document range. | public void | set(String text) | public void | setAutoExpandMode(boolean autoExpandMode) Sets the auto expand mode for this document. | protected void | updateDocumentStructures(DocumentEvent event) |
ProjectionDocument | public ProjectionDocument(IDocument masterDocument)(Code) | | Creates a projection document for the given master document.
Parameters: masterDocument - the master document |
adaptProjectionToMasterChange | final protected boolean adaptProjectionToMasterChange(DocumentEvent masterEvent) throws BadLocationException(Code) | | Ensures that when the master event affects this projection document, that the whole region described by the
event is part of this projection document.
Parameters: masterEvent - the master document event true if masterEvent affects this projection document throws: BadLocationException - in case the master event is not valid |
addMasterDocumentRange | public void addMasterDocumentRange(int offsetInMaster, int lengthInMaster) throws BadLocationException(Code) | | Ensures that the given range of the master document is part of this
projection document.
Parameters: offsetInMaster - the offset of the master document range Parameters: lengthInMaster - the length of the master document range throws: BadLocationException - in case the master event is not valid |
computeProjectedMasterRegions | final public IRegion[] computeProjectedMasterRegions(int offsetInMaster, int lengthInMaster) throws BadLocationException(Code) | | Returns the sequence of all master document regions with are contained in the given master document
range and which are part of this projection document. May return null if no such
regions exist.
Parameters: offsetInMaster - the range offset in the master document Parameters: lengthInMaster - the range length in the master document the sequence of regions which are part of the projection document or null throws: BadLocationException - in case the given range is invalid in the master document |
computeUnprojectedMasterRegions | final public IRegion[] computeUnprojectedMasterRegions(int offsetInMaster, int lengthInMaster) throws BadLocationException(Code) | | Returns the sequence of all master document regions which are contained
in the given master document range and which are not yet part of this
projection document.
Parameters: offsetInMaster - the range offset in the master document Parameters: lengthInMaster - the range length in the master document the sequence of regions which are not yet part of the projectiondocument throws: BadLocationException - in case the given range is invalid in themaster document |
dispose | public void dispose()(Code) | | Disposes this projection document.
|
fireDocumentAboutToBeChanged | protected void fireDocumentAboutToBeChanged(DocumentEvent event)(Code) | | |
fireDocumentChanged | protected void fireDocumentChanged(DocumentEvent event)(Code) | | Ignores the given event and sends the semantically equal slave document event instead.
Parameters: event - the event to be ignored |
getDefaultLineDelimiter | public String getDefaultLineDelimiter()(Code) | | |
getFragments | final protected Position[] getFragments()(Code) | | Returns the fragments of the master documents.
the fragment of the master document |
getMasterDocument | public IDocument getMasterDocument()(Code) | | Returns the master document of this projection document.
the master document of this projection document |
getProjectionMapping | public IDocumentInformationMapping getProjectionMapping()(Code) | | Returns the projection mapping used by this document.
the projection mapping used by this document |
getSegments | final protected Position[] getSegments()(Code) | | Returns the segments of this projection document.
the segments of this projection document |
isUpdating | protected boolean isUpdating()(Code) | | Returns whether this projection is being updated.
true if the document is updating |
masterDocumentAboutToBeChanged | public void masterDocumentAboutToBeChanged(DocumentEvent masterEvent)(Code) | | When called, this projection document is informed about a forthcoming
change of its master document. This projection document checks whether
the master document change affects it and if so informs all document
listeners.
Parameters: masterEvent - the master document event |
masterDocumentChanged | public void masterDocumentChanged(DocumentEvent masterEvent)(Code) | | When called, this projection document is informed about a change of its
master document. If this projection document is affected it informs all
of its document listeners.
Parameters: masterEvent - the master document event |
removeMasterDocumentRange | public void removeMasterDocumentRange(int offsetInMaster, int lengthInMaster) throws BadLocationException(Code) | | Ensures that the given range of the master document is not part of this
projection document.
Parameters: offsetInMaster - the offset of the master document range Parameters: lengthInMaster - the length of the master document range throws: BadLocationException - in case the master event is not valid |
replaceMasterDocumentRanges | public void replaceMasterDocumentRanges(int offsetInMaster, int lengthInMaster) throws BadLocationException(Code) | | Replaces all master document ranges with the given master document range.
Parameters: offsetInMaster - the offset in the master document Parameters: lengthInMaster - the length in the master document throws: BadLocationException - if the given range of the master document is not valid |
setAutoExpandMode | public void setAutoExpandMode(boolean autoExpandMode)(Code) | | Sets the auto expand mode for this document.
Parameters: autoExpandMode - true if auto-expanding |
Methods inherited from org.eclipse.jface.text.AbstractDocument | public void acceptPostNotificationReplaces()(Code)(Java Doc) public void addDocumentListener(IDocumentListener listener)(Code)(Java Doc) public void addDocumentPartitioningListener(IDocumentPartitioningListener listener)(Code)(Java Doc) public void addDocumentRewriteSessionListener(IDocumentRewriteSessionListener listener)(Code)(Java Doc) public void addPosition(String category, Position position) throws BadLocationException, BadPositionCategoryException(Code)(Java Doc) public void addPosition(Position position) throws BadLocationException(Code)(Java Doc) public void addPositionCategory(String category)(Code)(Java Doc) public void addPositionUpdater(IPositionUpdater updater)(Code)(Java Doc) public void addPrenotifiedDocumentListener(IDocumentListener listener)(Code)(Java Doc) final protected void checkStateOfPartitioner(IDocumentPartitioner partitioner, String partitioning)(Code)(Java Doc) protected void completeInitialization()(Code)(Java Doc) public int computeIndexInCategory(String category, int offset) throws BadLocationException, BadPositionCategoryException(Code)(Java Doc) protected int computeIndexInPositionList(List positions, int offset)(Code)(Java Doc) public int computeNumberOfLines(String text)(Code)(Java Doc) public ITypedRegion[] computePartitioning(int offset, int length) throws BadLocationException(Code)(Java Doc) public ITypedRegion[] computePartitioning(String partitioning, int offset, int length, boolean includeZeroLengthPartitions) throws BadLocationException, BadPartitioningException(Code)(Java Doc) public boolean containsPosition(String category, int offset, int length)(Code)(Java Doc) public boolean containsPositionCategory(String category)(Code)(Java Doc) protected void doFireDocumentChanged(DocumentEvent event)(Code)(Java Doc) protected void doFireDocumentChanged(DocumentEvent event, boolean firePartitionChange, IRegion partitionChange)(Code)(Java Doc) protected void doFireDocumentChanged2(DocumentEvent event)(Code)(Java Doc) protected void fireDocumentAboutToBeChanged(DocumentEvent event)(Code)(Java Doc) protected void fireDocumentChanged(DocumentEvent event)(Code)(Java Doc) protected void fireDocumentPartitioningChanged()(Code)(Java Doc) protected void fireDocumentPartitioningChanged(IRegion region)(Code)(Java Doc) protected void fireDocumentPartitioningChanged(DocumentPartitioningChangedEvent event)(Code)(Java Doc) protected void fireRewriteSessionChanged(DocumentRewriteSessionEvent event)(Code)(Java Doc) public String get()(Code)(Java Doc) public String get(int pos, int length) throws BadLocationException(Code)(Java Doc) final public DocumentRewriteSession getActiveRewriteSession()(Code)(Java Doc) public char getChar(int pos) throws BadLocationException(Code)(Java Doc) public String getContentType(int offset) throws BadLocationException(Code)(Java Doc) public String getContentType(String partitioning, int offset, boolean preferOpenPartitions) throws BadLocationException, BadPartitioningException(Code)(Java Doc) public String getDefaultLineDelimiter()(Code)(Java Doc) protected List getDocumentListeners()(Code)(Java Doc) protected Map getDocumentManagedPositions()(Code)(Java Doc) public IDocumentPartitioner getDocumentPartitioner()(Code)(Java Doc) public IDocumentPartitioner getDocumentPartitioner(String partitioning)(Code)(Java Doc) protected List getDocumentPartitioningListeners()(Code)(Java Doc) public String[] getLegalContentTypes()(Code)(Java Doc) public String[] getLegalContentTypes(String partitioning) throws BadPartitioningException(Code)(Java Doc) public String[] getLegalLineDelimiters()(Code)(Java Doc) public int getLength()(Code)(Java Doc) public String getLineDelimiter(int line) throws BadLocationException(Code)(Java Doc) public IRegion getLineInformation(int line) throws BadLocationException(Code)(Java Doc) public IRegion getLineInformationOfOffset(int offset) throws BadLocationException(Code)(Java Doc) public int getLineLength(int line) throws BadLocationException(Code)(Java Doc) public int getLineOfOffset(int pos) throws BadLocationException(Code)(Java Doc) public int getLineOffset(int line) throws BadLocationException(Code)(Java Doc) public long getModificationStamp()(Code)(Java Doc) public int getNumberOfLines()(Code)(Java Doc) public int getNumberOfLines(int offset, int length) throws BadLocationException(Code)(Java Doc) public ITypedRegion getPartition(int offset) throws BadLocationException(Code)(Java Doc) public ITypedRegion getPartition(String partitioning, int offset, boolean preferOpenPartitions) throws BadLocationException, BadPartitioningException(Code)(Java Doc) public String[] getPartitionings()(Code)(Java Doc) public String[] getPositionCategories()(Code)(Java Doc) public IPositionUpdater[] getPositionUpdaters()(Code)(Java Doc) public Position[] getPositions(String category) throws BadPositionCategoryException(Code)(Java Doc) protected ITextStore getStore()(Code)(Java Doc) protected ILineTracker getTracker()(Code)(Java Doc) public void ignorePostNotificationReplaces()(Code)(Java Doc) public void insertPositionUpdater(IPositionUpdater updater, int index)(Code)(Java Doc) protected boolean mustRepairLineInformation(int pos, int length, String text)(Code)(Java Doc) public void registerPostNotificationReplace(IDocumentListener owner, IDocumentExtension.IReplace replace)(Code)(Java Doc) public void removeDocumentListener(IDocumentListener listener)(Code)(Java Doc) public void removeDocumentPartitioningListener(IDocumentPartitioningListener listener)(Code)(Java Doc) public void removeDocumentRewriteSessionListener(IDocumentRewriteSessionListener listener)(Code)(Java Doc) public void removePosition(String category, Position position) throws BadPositionCategoryException(Code)(Java Doc) public void removePosition(Position position)(Code)(Java Doc) public void removePositionCategory(String category) throws BadPositionCategoryException(Code)(Java Doc) public void removePositionUpdater(IPositionUpdater updater)(Code)(Java Doc) public void removePrenotifiedDocumentListener(IDocumentListener listener)(Code)(Java Doc) public void repairLineInformation()(Code)(Java Doc) public void replace(int pos, int length, String text, long modificationStamp) throws BadLocationException(Code)(Java Doc) public void replace(int pos, int length, String text) throws BadLocationException(Code)(Java Doc) public void resumeListenerNotification()(Code)(Java Doc) public void resumePostNotificationProcessing()(Code)(Java Doc) public int search(int startPosition, String findString, boolean forwardSearch, boolean caseSensitive, boolean wholeWord) throws BadLocationException(Code)(Java Doc) public void set(String text)(Code)(Java Doc) public void set(String text, long modificationStamp)(Code)(Java Doc) public void setDocumentPartitioner(IDocumentPartitioner partitioner)(Code)(Java Doc) public void setDocumentPartitioner(String partitioning, IDocumentPartitioner partitioner)(Code)(Java Doc) public void setInitialLineDelimiter(String lineDelimiter)(Code)(Java Doc) protected void setLineTracker(ILineTracker tracker)(Code)(Java Doc) protected void setTextStore(ITextStore store)(Code)(Java Doc) public DocumentRewriteSession startRewriteSession(DocumentRewriteSessionType sessionType)(Code)(Java Doc) final protected void startRewriteSessionOnPartitioners(DocumentRewriteSession session)(Code)(Java Doc) public void startSequentialRewrite(boolean normalized)(Code)(Java Doc) public void stopListenerNotification()(Code)(Java Doc) public void stopPostNotificationProcessing()(Code)(Java Doc) public void stopRewriteSession(DocumentRewriteSession session)(Code)(Java Doc) final protected void stopRewriteSessionOnPartitioners(DocumentRewriteSession session)(Code)(Java Doc) public void stopSequentialRewrite()(Code)(Java Doc) protected void updateDocumentStructures(DocumentEvent event)(Code)(Java Doc) protected void updatePositions(DocumentEvent event)(Code)(Java Doc)
|
|
|