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