LinkedPositionUI editor= new LinkedPositionUI(fViewer, manager); editor.setFinalCaretOffset(replacementOffset + replacementString.length()); editor.enter();
LinkedEnvironment env= LinkedEnvironment.createLinkedEnvironment(document); env.addGroup(group); LinkedUIControl ui= new LinkedUIControl(env, fViewer); ui.setExitPosition(fViewer, replacementOffset + replacementString.length(), 0, true); ui.enter();
	public void apply(IDocument document, char trigger, int offset) {		super.apply(document, trigger, offset);		int replacementOffset= getReplacementOffset();		String replacementString= getReplacementString();		if (LinkedPositionManager.hasActiveManager(document)) {			fSelectedRegion= (fPositionOffsets.length == 0)				? new Region(replacementOffset + replacementString.length(), 0)				: new Region(replacementOffset + fPositionOffsets[0], fPositionLengths[0]);					} else {			try {				LinkedPositionManager manager= new LinkedPositionManager(document);				for (int i= 0; i != fPositionOffsets.length; i++)					manager.addPosition(replacementOffset + fPositionOffsets[i], fPositionLengths[i]);								LinkedPositionUI editor= new LinkedPositionUI(fViewer, manager);				editor.setFinalCaretOffset(replacementOffset + replacementString.length());				editor.enter();					fSelectedRegion= editor.getSelectedRegion();				} catch (BadLocationException e) {				JavaPlugin.log(e);					openErrorDialog(e);			}				}	}