Bug 25370 Linked Mode: Want to define where to focus
20021022 I added a new feature that starts the linked mode on all usages of a variable. e.g. int i; i= 1; i++; would link all 3 occurrences of i, so when edited, all 3 references are changed simultanously. Problem is that the liked mode does not allow me to set the focus (where to edit) to e.g. the 'i' in 'i++'. The linked mode only allows to edit the top most linked position ('int i'). The feature can be invoked on any reference. Jumping to the top not so ideal.
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/JavaCompletionProposal.java
RGB rgb= PreferenceConverter.getColor(preference, PreferenceConstants.CODEASSIST_REPLACEMENT_FOREGROUND);
		JavaTextTools textTools= JavaPlugin.getDefault().getJavaTextTools();
		return textTools.getColorManager().getColor(rgb);
	}
	private static Color getBackgroundColor(StyledText text) {
		IPreferenceStore preference= JavaPlugin.getDefault().getPreferenceStore();
		RGB rgb= PreferenceConverter.getColor(preference, PreferenceConstants.CODEASSIST_REPLACEMENT_BACKGROUND);
		JavaTextTools textTools= JavaPlugin.getDefault().getJavaTextTools();
		return textTools.getColorManager().getColor(rgb);
	}
	
	private void repairPresentation(ITextViewer viewer) {
		if (fRememberedStyleRange != null) {
			if (viewer instanceof ITextViewerExtension2) {
				
				ITextViewerExtension2 viewer2= (ITextViewerExtension2) viewer;
				viewer2.invalidateTextPresentation(fRememberedStyleRange.start + viewer.getVisibleRegion().getOffset(), fRememberedStyleRange.length);
			} else
				viewer.invalidateTextPresentation();
		}
	}
	private void updateStyle(ITextViewer viewer) {
		StyledText text= viewer.getTextWidget();
		if (text == null || text.isDisposed())
			return;
		IRegion visibleRegion= viewer.getVisibleRegion();			
		int caretOffset= text.getCaretOffset() + visibleRegion.getOffset();
		if (caretOffset >= fReplacementOffset + fReplacementLength) {
			repairPresentation(viewer); 
			return;