Bug 6147 Templates don't work in "Show source of selected element only" mode
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/link/LinkedPositionUI.java
} catch (BadLocationException e) {
			openErrorDialog(fViewer.getTextWidget().getShell(), e);
		} catch (BadPositionCategoryException e) {
			JavaPlugin.log(e);
			Assert.isTrue(false);
		}
		fViewer.addTextInputListener(this);
				
		StyledText text= fViewer.getTextWidget();			
		text.addVerifyListener(this);
		text.addVerifyKeyListener(this);
		text.addModifyListener(this);
		text.addPaintListener(this);
		text.showSelection();
		fFramePosition= fManager.getFirstPosition();
		if (fFramePosition == null)
			leave(UNINSTALL | COMMIT | UPDATE_CARET);
	}
	/**
	 * @see LinkedPositionManager.LinkedPositionListener#exit(boolean)
	 */
	public void exit(boolean success) {
		
		leave((success ? COMMIT : 0) | UPDATE_CARET);	
	}
	/**
	 * Returns the cursor selection, after having entered the linked mode.
	 * <code>enter()</code> must be called prior to a call to this method.
	 */
	public IRegion getSelectedRegion() {