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

Bug 250128

Summary: Preference for statically compiled JET templates
Product: [WebTools] WTP Java EE Tools Reporter: Kaloyan Raev <kaloyan>
Component: jst.j2eeAssignee: Milen Manov <milen.manov>
Status: RESOLVED FIXED QA Contact: Chuck Bridgham <cbridgha>
Severity: enhancement    
Priority: P3 Keywords: noteworthy, plan
Version: unspecified   
Target Milestone: 3.1 M5   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Bug Depends on: 249347    
Bug Blocks: 261778    
Attachments:
Description Flags
patch
none
patch with corrected messages
none
patch with corrections
none
patch kaloyan: iplog+

Description Kaloyan Raev CLA 2008-10-08 13:05:43 EDT
The solution in bug 249347 must be exposed as a preference, so users can choose either statically, or dynamically compiled JET templates.
Comment 1 Kaloyan Raev CLA 2008-10-22 04:15:19 EDT
We should think about where to put this property in the UI.
One approach is to create a new top-level "Java EE" preference page. It can be used later for other Java EE related preferences. 

The XDoclet preferences page can be move as a child of this new Java EE preference page. Other candidate is JPA. Link can be created to Web/JSP files and Web/JavaServer Faces Tools. 
Comment 2 Milen Manov CLA 2008-12-17 03:53:07 EST
Created attachment 120668 [details]
patch

I propose the following patch
Comment 3 Kaloyan Raev CLA 2008-12-17 08:06:18 EST
Milen, the patch is good. 

Just some cosmetic changes are needed.
1. Replace all "JEE" strings with "Java EE". If "JEE" occurs in an identifier, then replace it with "JavaEE". 
2. Replace the "JEE preferences page" string with "General settings for Java EE development:". 
3. Replace "Jet templates preferences" with "JET templates". 
4. Give more meaningful names to the "JETTemplatesPreferencesPage_X" NL keys. 
Comment 4 Milen Manov CLA 2009-01-14 09:43:51 EST
Created attachment 122535 [details]
patch with corrected messages

This new patch is changed messages according to Kaloyan's comment.
Comment 5 Kaloyan Raev CLA 2009-01-16 05:33:38 EST
Thank you, Milen. The UI looks much better. 
I have a few more remarks on the code. 

* The "Restore Defaults" button does not work. I guess you should implement performDefaults() in the preference page class. 
* JETTemplatesReferencePage has a typo in the name. But it is event better to rename it to JavaEEPreferencePage. 
* The org.eclipse.jst.j2ee.internal.iu.preference java package should be called org.eclipse.jst.j2ee.internal.iu.preferences. 
* The id of the page in plugin.xml should be "org.eclipse.jst.j2ee.ui.preferencePages.JavaEE". Let's follow the pattern established by the Platform.
* define the NLS constants in j2ee_ui.properties and J2EEUIMessages in the style JAVA_EE_PREFERENCE_PAGE_DESCRIPTION. Avoid curtailments. Use this constants in the preference page class. 
* Avoid the usage of the deprecated Preferences. Replace it with IPreferenceStore or IPreferencesService. 
* Add a spacer between the page description and the JET templates group. Spacer == label with no text. 
Comment 6 Milen Manov CLA 2009-01-20 06:43:56 EST
Created attachment 123065 [details]
patch with corrections

Comment taken in consideration except about the deprecated class
Comment 7 Milen Manov CLA 2009-01-21 02:25:00 EST
Created attachment 123173 [details]
patch

Previous attachment was of a wrong file.
Comment 8 Kaloyan Raev CLA 2009-01-21 05:11:48 EST
Thanks, Milen. The latest patch is committed to HEAD and released to build.