Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 132847

Summary: ${filecomment} and ${typecomment} cannot be replaced in ${New Java files}
Product: [Eclipse Project] JDT Reporter: David Li <lihaizhou>
Component: UIAssignee: JDT-UI-Inbox <jdt-ui-inbox>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: daniel_megert
Version: 3.1.1   
Target Milestone: ---   
Hardware: PC   
OS: Windows 2000   
Whiteboard:

Description David Li CLA 2006-03-22 10:36:17 EST
For Eclipse3.1.1, go to:
Window -> Preferences -> Java -> Code Style -> Code Templates -> Code -> New Java files

The default content is:
${filecomment}
${package_declaration}

${typecomment}
${type_declaration}

But ${filecomment} and ${typecomment} are always empty even if I modify them through Comments -> Files/Types.


I have used "Export All..." to make sure I'm modifying the correct entries for ${filecomment} and ${typecomment}:

<template autoinsert="true" context="filecomment_context" deleted="false" description="Comment for created Java files" enabled="true" id="org.eclipse.jdt.ui.text.codetemplates.filecomment" name="filecomment">/**
 * David
 */</template><template autoinsert="true" context="typecomment_context" deleted="false" description="Comment for created types" enabled="true" id="org.eclipse.jdt.ui.text.codetemplates.typecomment" name="typecomment">/**
 * @author ${user}
 *
 * ${tags}
 */</template>

I have also verified that the same function works in Eclipse3.0.1.
Comment 1 Martin Aeschlimann CLA 2006-03-28 05:40:29 EST
File and type comments are only added if the checkbox 'Add comments' is checked on the new class/interface... wizards. Is that the case?
Comment 2 David Li CLA 2006-04-01 05:10:41 EST
(In reply to comment #1)
> File and type comments are only added if the checkbox 'Add comments' is checked
> on the new class/interface... wizards. Is that the case?

Thanks a lot.
That's the case.
I did not notice that checkbox.
Comment 3 David Li CLA 2006-04-01 05:13:40 EST
It's a little confusion that Eclipse3.1.1 changes the default behavior from Eclipse3.0.1.

But anyway this is not a bug so I close it.
Thanks for your great support!