Bug 8082 template pref page: export overwrites without warning
export from template pref page overwrites files without warning this is never good - you can lose templates you have saved on your disk somewhere
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/ExperimentalProposal.java
String replacementString= getReplacementString();
		
		try {
			LinkedPositionManager manager= new LinkedPositionManager(document);
			for (int i= 0; i != fPositionOffsets.length; i++)
				manager.addPosition(replacementOffset + fPositionOffsets[i], fPositionLengths[i]);
			
			LinkedPositionUI editor= new LinkedPositionUI(fViewer, manager);
			editor.setFinalCaretOffset(replacementOffset + replacementString.length());
			editor.enter();
			fSelectedRegion= editor.getSelectedRegion();
		} catch (BadLocationException e) {
			JavaPlugin.log(e);	
			openErrorDialog(e);
		}		
	}
	
	/**
	 * @see ICompletionProposal#getSelection(IDocument)
	 */
	public Point getSelection(IDocument document) {
		if (fSelectedRegion == null)
			return new Point(getReplacementOffset(), 0);
		return new Point(fSelectedRegion.getOffset(), fSelectedRegion.getLength());
	}
	private void openErrorDialog(BadLocationException e) {
		Shell shell= fViewer.getTextWidget().getShell();
		MessageDialog.openError(shell, TemplateMessages.getString("TemplateEvaluator.error.title"), e.getMessage()); 
	}	
}