Copied from editor/codetemplates and adjusted for the needs of the instant rename.
Maintain the same text in the selected regions of the text document.
author: Miloslav Metelka
Constructor Summary
public
SyncDocumentRegion(Document doc, List<? extends MutablePositionRegion> regions) Construct synchronized document regions.
Parameters: doc - document on which to operate. Parameters: regions - regions that should be kept synchronized.The first region is the master.
getSortedRegion(int regionIndex) Get region in a sorted list of the regions.
Parameters: regionIndex - of the region.
public void
sync(int moveStartDownLength) Propagate text of the first region into all other regions.
Parameters: moveStartDownLength - how much to move starting positiondown.
Constructor Detail
SyncDocumentRegion
public SyncDocumentRegion(Document doc, List<? extends MutablePositionRegion> regions)(Code)
Construct synchronized document regions.
Parameters: doc - document on which to operate. Parameters: regions - regions that should be kept synchronized.The first region is the master. All the regions need to havethe initial position to have the backward bias.
Propagate text of the first region into all other regions.
Parameters: moveStartDownLength - how much to move starting positiondown. It may be 0 to signal that the startng position shouldstay as is.