Bug 53742 [templates] add different ui for linked mode depending on usage
Linked mode should allow to be configured programmatically to have a different ui. This would allow the instance that is setting up linked mode to determine how it will look like. Use case is auto-closing: the box is too disturbing there, while it may be good for more complex templates.
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/JavaCompletionProposal.java
int index= string.indexOf("()"); 
				if (index != -1 && index + 1 == fCursorPosition) {
					IPreferenceStore preferenceStore= JavaPlugin.getDefault().getPreferenceStore();
					if (preferenceStore.getBoolean(PreferenceConstants.EDITOR_CLOSE_BRACKETS)) {
						int newOffset= fReplacementOffset + fCursorPosition;
						
						LinkedPositionGroup group= new LinkedPositionGroup();
						group.createPosition(document, newOffset, 0);
						
						LinkedEnvironment env= new LinkedEnvironment();
						env.addGroup(group);
						env.forceInstall();
						
						LinkedUIControl ui= new LinkedUIControl(env, fTextViewer);
						ui.setPositionListener(new EditorHistoryUpdater());
						ui.setExitPolicy(new ExitPolicy(')'));
						ui.setExitPosition(fTextViewer, newOffset + 1, 0, Integer.MAX_VALUE);
						ui.setCyclingMode(LinkedUIControl.CYCLE_NEVER);
						ui.enter();
					}
				}
			}
		} catch (BadLocationException x) {
			
		}		
	}
	/**
	 * A class to simplify tracking a reference position in a document. 
	 */
	private static final class ReferenceTracker {