} else { LinkedPositionManager manager= new LinkedPositionManager(document); for (int i= 0; i != parameterCount; i++) { int positionOffset= baseOffset + positionOffsets[i]; String type= TYPE + i; if (fChoices[i].length < 2) { manager.addPosition(positionOffset, positionLengths[i], type); } else { manager.addPosition(positionOffset, positionLengths[i], type, fChoices[i]); } }  LinkedPositionUI editor= new LinkedPositionUI(fViewer, manager); editor.setFinalCaretOffset(baseOffset + replacementString.length()); editor.enter();  fSelectedRegion= editor.getSelectedRegion(); }
LinkedUIControl editor= new LinkedUIControl(environment, fViewer); editor.setExitPosition(fViewer, baseOffset + replacementString.length(), 0, true); editor.setCyclingMode(LinkedUIControl.CYCLE_WHEN_NO_PARENT); editor.enter();  fSelectedRegion= editor.getSelectedRegion();
	public void apply(IDocument document, char trigger, int offset) {		try {			int parameterCount= fParameterNames.length;			int[] positionOffsets;			int[] positionLengths;			String replacementString;			int baseOffset= getReplacementOffset();						if (appendArguments(document, offset)) {				parameterCount= fParameterNames.length;				positionOffsets= new int[parameterCount];				positionLengths= new int[parameterCount];				replacementString= computeGuessingCompletion(baseOffset, positionOffsets, positionLengths);							} else {				parameterCount= 0;				positionOffsets= new int[0];				positionLengths= new int[0];								replacementString= new String(fName);			}			setReplacementString(replacementString);					super.apply(document, trigger, offset);			if (parameterCount > 0) {				if (LinkedPositionManager.hasActiveManager(document)) {					fSelectedRegion= (positionOffsets.length == 0)						? new Region(baseOffset + replacementString.length(), 0)						: new Region(baseOffset + positionOffsets[0], positionLengths[0]);								} else {					LinkedPositionManager manager= new LinkedPositionManager(document);					for (int i= 0; i != parameterCount; i++) {						int positionOffset= baseOffset + positionOffsets[i];						String type= TYPE + i;						if (fChoices[i].length < 2) {							manager.addPosition(positionOffset, positionLengths[i], type);						} else {							manager.addPosition(positionOffset, positionLengths[i], type, fChoices[i]);						}					}										LinkedPositionUI editor= new LinkedPositionUI(fViewer, manager);					editor.setFinalCaretOffset(baseOffset + replacementString.length());					editor.enter();							fSelectedRegion= editor.getSelectedRegion();					}			} else {				fSelectedRegion= new Region(baseOffset + replacementString.length(), 0);			}		} catch (BadLocationException e) {			JavaPlugin.log(e);				openErrorDialog(e);		} catch (JavaModelException e) {			JavaPlugin.log(e);				openErrorDialog(e);					}	}