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/EditTemplateDialog.java
import org.eclipse.jdt.internal.ui.util.SWTUtil;
/**
 * Dialog to edit a template.
 */
public class EditTemplateDialog extends StatusDialog {
	private static class SimpleJavaSourceViewerConfiguration extends JavaSourceViewerConfiguration {
		private final TemplateVariableProcessor fProcessor;
		SimpleJavaSourceViewerConfiguration(JavaTextTools tools, ITextEditor editor, TemplateVariableProcessor processor) {
			super(tools, editor, IJavaPartitions.JAVA_PARTITIONING);
			fProcessor= processor;
		}
		
		/*
		 * @see SourceViewerConfiguration#getContentAssistant(ISourceViewer)
		 */
		public IContentAssistant getContentAssistant(ISourceViewer sourceViewer) {
			IPreferenceStore store= JavaPlugin.getDefault().getPreferenceStore();
			JavaTextTools textTools= JavaPlugin.getDefault().getJavaTextTools();
			IColorManager manager= textTools.getColorManager();					
			
			ContentAssistant assistant= new ContentAssistant();
			assistant.setContentAssistProcessor(fProcessor, IDocument.DEFAULT_CONTENT_TYPE);
				
			assistant.setContentAssistProcessor(fProcessor, IJavaPartitions.JAVA_STRING);
			assistant.setContentAssistProcessor(fProcessor, IJavaPartitions.JAVA_CHARACTER);
			assistant.setContentAssistProcessor(fProcessor, IJavaPartitions.JAVA_SINGLE_LINE_COMMENT);
			assistant.setContentAssistProcessor(fProcessor, IJavaPartitions.JAVA_MULTI_LINE_COMMENT);
			assistant.setContentAssistProcessor(fProcessor, IJavaPartitions.JAVA_DOC);
			assistant.enableAutoInsert(store.getBoolean(PreferenceConstants.CODEASSIST_AUTOINSERT));
			assistant.enableAutoActivation(store.getBoolean(PreferenceConstants.CODEASSIST_AUTOACTIVATION));