LinkedModeUI ui= new EditorLinkedModeUI(model, fTextViewer); ui.setExitPosition(fTextViewer, baseOffset + replacementString.length(), 0, Integer.MAX_VALUE);
LinkedModeUI ui= new EditorLinkedModeUI(model, getTextViewer()); ui.setExitPosition(getTextViewer(), baseOffset + replacementString.length(), 0, Integer.MAX_VALUE);
	public void apply(IDocument document, char trigger, int offset) {		int baseOffset= getReplacementOffset();		String replacementString;		int parameterCount;		int[] positionOffsets, positionLengths;		if (appendArguments(document, offset)) {			fParameterNames= fProposal.findParameterNames(null);			fName= String.valueOf(fProposal.getName());			parameterCount= fParameterNames.length;			positionOffsets= new int[parameterCount];			positionLengths= new int[parameterCount];			replacementString= computeReplacementString(baseOffset, positionOffsets, positionLengths, document);		} else {			parameterCount= 0;			positionOffsets= new int[0];			positionLengths= new int[0];			replacementString= getReplacementString();		}		setReplacementString(replacementString);		super.apply(document, trigger, offset);		if (positionOffsets.length > 0 && fTextViewer != null) {			try {				LinkedModeModel model= new LinkedModeModel();				for (int i= 0; i != positionOffsets.length; i++) {					LinkedPositionGroup group= new LinkedPositionGroup();					group.addPosition(new LinkedPosition(document, baseOffset + positionOffsets[i], positionLengths[i], LinkedPositionGroup.NO_STOP));					model.addGroup(group);				}				model.forceInstall();				JavaEditor editor= getJavaEditor();				if (editor != null) {					model.addLinkingListener(new EditorHighlightingSynchronizer(editor));				}				LinkedModeUI ui= new EditorLinkedModeUI(model, fTextViewer);				ui.setExitPosition(fTextViewer, baseOffset + replacementString.length(), 0, Integer.MAX_VALUE);				ui.setDoContextInfo(true);				ui.enter();				fSelectedRegion= ui.getSelectedRegion();			} catch (BadLocationException e) {				JavaPlugin.log(e);				openErrorDialog(e);			}		} else			fSelectedRegion= new Region(baseOffset + replacementString.length(), 0);	}