LinkedPositionManager manager= new LinkedPositionManager(viewer.getDocument()); LinkedPositionUI editor= new LinkedPositionUI(viewer, manager);
IDocument document= viewer.getDocument();  HashMap map= new HashMap();
	private void enterLinkedMode(CompilationUnitChange change, ITextViewer viewer, GroupDescription[] linked, GroupDescription selection) throws BadLocationException {		LinkedPositionManager manager= new LinkedPositionManager(viewer.getDocument());		LinkedPositionUI editor= new LinkedPositionUI(viewer, manager);				for (int i= 0; i < linked.length; i++) {			GroupDescription curr= linked[i];			String name= curr.getName(); // name used as key for link mode proposals & as kind for linked mode			TextEdit[] textEdits= curr.getTextEdits();			if (name != null && textEdits.length > 0) {				IRegion range= change.getNewTextRange(textEdits);				if (range != null) {	// all edits could be deleted					ICompletionProposal[] linkedModeProposals= getLinkedModeProposals(name);					if (linkedModeProposals != null && linkedModeProposals.length > 1) {						manager.addPosition(range.getOffset(), range.getLength(), name, linkedModeProposals);					} else {						manager.addPosition(range.getOffset(), range.getLength(), name);					}					if (i == 0) {						editor.setInitialOffset(range.getOffset());					}				}			}		}					if (selection != null) {			TextEdit[] textEdits= selection.getTextEdits();			if (textEdits.length > 0) {				IRegion range= change.getNewTextRange(textEdits);				if (range != null)					editor.setFinalCaretOffset(range.getOffset() + range.getLength());			}							} else {			int cursorPosition= viewer.getSelectedRange().x;			if (cursorPosition != 0) {				editor.setFinalCaretOffset(cursorPosition);			}		}			editor.enter();				IRegion region= editor.getSelectedRegion();		viewer.setSelectedRange(region.getOffset(), region.getLength());			viewer.revealRange(region.getOffset(), region.getLength());	}