| Summary: | ${filecomment} and ${typecomment} cannot be replaced in ${New Java files} | ||
|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | David Li <lihaizhou> |
| Component: | UI | Assignee: | 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: | |||
File and type comments are only added if the checkbox 'Add comments' is checked on the new class/interface... wizards. Is that the case? (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. 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! |
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.