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
*/
		public int postReplace(IDocument document) {
			try {
				document.removePosition(CATEGORY, fPosition);
				document.removePositionUpdater(fPositionUpdater);
				document.removePositionCategory(CATEGORY);
				 
			} catch (BadPositionCategoryException e) {
				
				JavaPlugin.log(e);
			}
			return fPosition.getOffset();
		}
	}	
	
	protected static class ExitPolicy implements IExitPolicy {
		
		final char fExitCharacter;
		
		public ExitPolicy(char exitCharacter) {
			fExitCharacter= exitCharacter;
		}
		/*
		 * @see org.eclipse.jdt.internal.ui.text.link.LinkedPositionUI.ExitPolicy#doExit(org.eclipse.jdt.internal.ui.text.link.LinkedPositionManager, org.eclipse.swt.events.VerifyEvent, int, int)
		 */
		public ExitFlags doExit(LinkedEnvironment environment, VerifyEvent event, int offset, int length) {
			
			if (event.character == fExitCharacter) {
				if (environment.anyPositionContains(offset))
					return new ExitFlags(ILinkedListener.UPDATE_CARET, false);