Eclipse Platform
2.1

org.eclipse.jface.text
Class FragmentUpdater

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

public class FragmentUpdater
extends DefaultPositionUpdater

The position updater used to adapt the fragments of a projection document to changes of the master document. The updater supports two modes: a shifting mode and a non shifting mode. In the shifting mode the updater behaves identical to the DefaultPositionUpdater. In non shifting mode, if an insertion happens at a fragment's offset, the fragment is extended rather than shifted. Also, the last fragment is extended if an inserte operation happens at the end of the fragment.

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 FragmentUpdater(String fragmentCategory)
          Creates the fragment updater for the given category.
 
Method Summary
protected  void adaptToInsert()
          If an insertion happens at a fragment's offset, the fragment is extended rather than shifted.
 void enableShiftMode(boolean enable)
          Enables/disables the shift mode of this updater.
 void update(DocumentEvent event)
          Adapts positions to the change specified by the document event.
 
Methods inherited from class org.eclipse.jface.text.DefaultPositionUpdater
adaptToRemove, adaptToReplace, getCategory, notDeleted
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FragmentUpdater

protected FragmentUpdater(String fragmentCategory)
Creates the fragment updater for the given category.
Parameters:
fragmentCategory - the position category used for managing the fragments of a projection document
Method Detail

enableShiftMode

public void enableShiftMode(boolean enable)
Enables/disables the shift mode of this updater.
Parameters:
enable - true if shift mode should be enabled

adaptToInsert

protected void adaptToInsert()
If an insertion happens at a fragment's offset, the fragment is extended rather than shifted. Also, the last fragment is extended if an inserte operation happens at the end of the fragment.
Overrides:
adaptToInsert in class DefaultPositionUpdater

update

public void update(DocumentEvent event)
Description copied from interface: IPositionUpdater
Adapts positions to the change specified by the document event. It is ensured that the document's partitioning has been adapted to this document change and that all the position updaters which have a smaller index in the document's position updater list have been called.
Overrides:
update in class DefaultPositionUpdater
Following copied from interface: org.eclipse.jface.text.IPositionUpdater
Parameters:
event - the document event describing the document change

Eclipse Platform
2.1

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