Bug 45517 Add a 'Field comment' code template
20031024 The user should be able to specify a 'field comment' template. See 'CodeTemplateContextType.TYPE_COMMENT' as an example You have to - define a new variable type - specify the variables avaiable in this template - create an API in Codetemplates so it can be used Users are: - AddJavadocCommentAction - JavadocTagsSubProcessor.getMissingJavadocCommentProposals
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/CodeTemplateBlock.java
}
		
		if (file.exists() && !file.canWrite()) {
			String title= PreferencesMessages.getString("CodeTemplateBlock.export.error.title"); 
			String message= PreferencesMessages.getFormattedString("CodeTemplateBlock.export.error.canNotWrite", file.getAbsolutePath()); 
			MessageDialog.openError(getShell(), title, message);
			return;
		}
		if (!file.exists() || confirmOverwrite(file)) {
			try {
				templateSet.saveToFile(file);			
			} catch (CoreException e) {			
				if (e.getStatus().getException() instanceof FileNotFoundException) {
					String title= PreferencesMessages.getString("CodeTemplateBlock.export.error.title"); 
					String message= PreferencesMessages.getFormattedString("CodeTemplateBlock.export.error.fileNotFound", e.getStatus().getException().getLocalizedMessage()); 
					MessageDialog.openError(getShell(), title, message);
					return;
				}
				JavaPlugin.log(e);
				openWriteErrorDialog(e);
			}		
		}
	}
	private boolean confirmOverwrite(File file) {
		return MessageDialog.openQuestion(getShell(),
			PreferencesMessages.getString("CodeTemplateBlock.export.exists.title"), 
			PreferencesMessages.getFormattedString("CodeTemplateBlock.export.exists.message", file.getAbsolutePath())); 
	}