Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 94912 - [templates] cannot override default new java file code template
Summary: [templates] cannot override default new java file code template
Status: RESOLVED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Text (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.2 M5   Edit
Assignee: Tom Hofmann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-05-12 05:18 EDT by Nikolay Metchev CLA
Modified: 2006-01-26 09:54 EST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nikolay Metchev CLA 2005-05-12 05:18:04 EDT
Elicpse M6
JDK 1.5 update 3

I am using the -pluginCustomization command line paramater and my
plugin_customization.ini file I have the following line

org.eclipse.jdt.ui/org.eclipse.jdt.ui.text.custom_code_templates= ..
which define the 
org.eclipse.jdt.ui.text.codetemplates.newtype property.

however when I run eclipse and I select Window->preferences->Java->Code
Style->Code Templates->Code->New Java Files
click edit and change it the updated version is not used when creating files.

This worked in eclipse M5 and has regressed in eclipse M6
Comment 1 Dani Megert CLA 2005-05-12 10:29:42 EDT
anything in .log?
Tom, please investigate (not an M7 candidate)
Comment 2 Nikolay Metchev CLA 2005-05-12 12:42:20 EDT
nothing shows up in the .log
Comment 3 Nikolay Metchev CLA 2006-01-24 05:13:48 EST
Any chance this could get addressed for 3.0.2?
Comment 4 Tom Hofmann CLA 2006-01-26 08:58:43 EST
Works partially for me with I20060124: in a fresh workspace, the default file template is replaced with the one specified in the plugin_customization.ini.

Also, if there already are customized templates, the default value overridden in the plugin_customization.ini is of course not taken into account. Note that you can only override the default values via the -plugincustomization command line option.

Currently, pressing "Restore Defaults" will not restore the templates correctly, but rather delete any templates from the preferences and reload the contributed ones. This does not consider that the default may be non-empty when set via -plugincustomization.

Fixed this behavior by re-loading the contributed templates *and* resetting the preference in TemplateStore::restoreDefaults. 

available > 20060126, no action for the maintenance builds (Dani?)
Comment 5 Nikolay Metchev CLA 2006-01-26 09:22:45 EST
I take it there is no chance of this going into 3.0.2?
Comment 6 Tom Hofmann CLA 2006-01-26 09:30:10 EST
I don't think that there are even going to be more 3.0.X builds, as we are currently developping 3.2 and there is a 3.1.X maintenance stream...
Comment 7 Dani Megert CLA 2006-01-26 09:33:50 EST
>I take it there is no chance of this going into 3.0.2?
3.0.2 is a release. How should we add it there? There are also no further maintenance builds scheduled for 3.0.x.

Regarding 3.1 maintenance releases: 3.1.2. is about to be declared and hence it is too late for it and this bug is by far not critical enough. Should there be another maintenance build we could consider it, but so far no further 3.1 maintenance release is scheduled and I'd have to look at the fix first.
Comment 8 Nikolay Metchev CLA 2006-01-26 09:54:54 EST
Oops, I am so sorry. I was thinking of 3.1.2. You have answered my question.