LinkedEnvironment environment= LinkedEnvironment.createLinkedEnvironment(document);
LinkedEnvironment environment= new LinkedEnvironment();
	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) {				LinkedEnvironment environment= LinkedEnvironment.createLinkedEnvironment(document);				for (int i= 0; i != parameterCount; i++) {					LinkedPositionGroup group= new LinkedPositionGroup();					int positionOffset= baseOffset + positionOffsets[i];					if (fChoices[i].length < 2) {						group.createPosition(document, positionOffset, positionLengths[i]);					} else {						group.createPosition(document, positionOffset, positionLengths[i], fChoices[i]);					}					environment.addGroup(group);				}								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();				} else {				fSelectedRegion= new Region(baseOffset + replacementString.length(), 0);			}		} catch (BadLocationException e) {			JavaPlugin.log(e);				openErrorDialog(e);		} catch (JavaModelException e) {			JavaPlugin.log(e);				openErrorDialog(e);					}	}