Bug 102894 - [templates][preferences] Automatically update non-modified default templates
Summary: [templates][preferences] Automatically update non-modified default templates
Status: ASSIGNED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Text (show other bugs)
Version: 3.1   Edit
Hardware: All All
: P5 enhancement (vote)
Target Milestone: ---   Edit
Assignee: JDT-Text-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-07-06 13:23 EDT by Elliotte Rusty Harold CLA
Modified: 2007-06-22 10:02 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Elliotte Rusty Harold CLA 2005-07-06 13:23:32 EDT
When I create a new Java class the following comment is inserted at teh top:

/*
 * Created on ${date}
 *
 * To change the template for this generated file go to
 * Window>Preferences>Java>Code Generation>Code and Comments
 */

However those instructions are out of date. I'm not sure when the details
changed but they should be 

Window>Preferences>Java>Code Style>Code Text
Comment 1 Dani Megert CLA 2005-07-07 03:29:58 EDT
Note: 'Code Text' preference node does not exist in Eclipse SDK so I guess this
is just a typo (you meant 'Code Templates', right?).

We do not force new templates into existing workspaces. If you did not modify
the templates you can just go to the 'Code Templates' preference page and click
'Restore Defaults'. If you modified some templates you can first export those
you changed and re-import them again. Alternatively you can export all and edit
the .xml file (remove those you did not change).
Comment 2 Elliotte Rusty Harold CLA 2005-07-07 06:27:16 EDT
I understand and agree that Eclipse should not replace a template that the user
modified. However this does not seem to be the case here. When the original
default template becomes invalid due to a change in Eclipse, then an upgrade
should replace the old, now incorrect default template.  
Comment 3 Dani Megert CLA 2005-07-07 06:34:42 EDT
This would mean to migrate the templates either the first time you use it or on
startup.

There are currently no plans for this.
Comment 4 Elliotte Rusty Harold CLA 2005-07-07 06:48:45 EDT
There's an alternate approach. The default templates could be stored separately
from the user-defined templates. A default template would only be used if the
user's preferences did not contain a value (including possibly an empty value)
for a given template. 
Comment 5 Dani Megert CLA 2007-06-22 09:59:25 EDT
Get rid of deprecated state.