Default implementation of {@link org.eclipse.jface.text.IPositionUpdater}.
A default position updater must be configured with the position category whose positions it will update. Other position categories are not affected by this updater.
This implementation follows the specification below:
- Inserting or deleting text before the position shifts the position accordingly.
- Inserting text at the position offset shifts the position accordingly.
- Inserting or deleting text strictly contained by the position shrinks or stretches the position.
- Inserting or deleting text after a position does not affect the position.
- Deleting text which strictly contains the position deletes the position. Note that the position is not deleted if its only shrunken to length zero. To delete a position, the modification must delete from strictly before to strictly after the position.
- Replacing text contained by the position shrinks or expands the position (but does not shift it), such that the final position contains the original position and the replacing text.
- Replacing text overlapping the position in other ways is considered as a sequence of first deleting the replaced text and afterwards inserting the new text. Thus, a position is shrunken and can then be shifted (if the replaced text overlaps the offset of the position).
This class can be used as is or be adapted by subclasses. Fields are protected to allow subclasses direct access. Because of the frequency with which position updaters are used this is a performance decision.