Eclipse Platform
2.1

org.eclipse.jface.text
Class ProjectionPositionUpdater

java.lang.Object
  |
  +--org.eclipse.jface.text.DefaultPositionUpdater
        |
        +--org.eclipse.jface.text.ProjectionPositionUpdater
All Implemented Interfaces:
IPositionUpdater

public class ProjectionPositionUpdater
extends DefaultPositionUpdater

The position updater used to adapt the positions corresponding to the fragments of projection documents. The startegy of this updater differs from the DefaultPositionUpdater. If an insertion happens at a start offset of a range corresponding to a fragment, the range is extended rather than shifted. Also, if text is added right behind the end of such a range, the range is extended rather than kept stable.

This class is for internal use only.

Since:
2.1

Fields inherited from class org.eclipse.jface.text.DefaultPositionUpdater
fDocument, fLength, fOffset, fOriginalPosition, fPosition, fReplaceLength
 
Constructor Summary
protected ProjectionPositionUpdater(String category)
          Creates the position updater for the given category.
 
Method Summary
protected  void adaptToInsert()
          If an insertion happens at a start offset of a range corresponding to a fragment, the range is extended rather than shifted.
protected  boolean notDeleted()
          Projection document ranges cannot be deleted other then by calling ProjectionDocumentManager#removeFragment.
 
Methods inherited from class org.eclipse.jface.text.DefaultPositionUpdater
adaptToRemove, adaptToReplace, getCategory, update
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProjectionPositionUpdater

protected ProjectionPositionUpdater(String category)
Creates the position updater for the given category.
Parameters:
category - the category used to manage the positions representing the ranges corresponding to fragments
Method Detail

notDeleted

protected boolean notDeleted()
Projection document ranges cannot be deleted other then by calling ProjectionDocumentManager#removeFragment.
Overrides:
notDeleted in class DefaultPositionUpdater
Returns:
true

adaptToInsert

protected void adaptToInsert()
If an insertion happens at a start offset of a range corresponding to a fragment, the range is extended rather than shifted. Also, if text is added right behind the end of such a range, the range is extended rather than kept stable.
Overrides:
adaptToInsert in class DefaultPositionUpdater

Eclipse Platform
2.1

Copyright (c) IBM Corp. and others 2000, 2003. All Rights Reserved.