Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Tapestry Wiki" for 
change notification.

The following page has been changed by DavorHrg:
http://wiki.apache.org/tapestry/Tapestry5HowToEclipseCodeTemplates

------------------------------------------------------------------------------
  To help in everyday writing of code I've made more than few code templates.
  You can import them all by going to 
Window->Preferences->Java->Editor->Templates
- and import this xml file: ----xml----
+ and import this xml file: attachment:t5_eclipse_code_templates.xml
  
- to see it in action here are screenshot when you write:
-  * t5 - all tempaltes
-  * t5i - inject templates
-  * t5p - page lifecycle templates
-  * tpr - render phase method templates
- 
- I took some time to make them usable (they add imports automaticaly)
+ I took some time to make them usable (they add imports automatically).
- they are named by numbers so it is easier to acces a groop of tempaltes
+ They are named by numbers so it is easier to access a group of templates,
  and then by reading description selecting desired one.
  
+ Page lifecycle methods and render phase methods are both named by convention
+ and marked with the according annotation. So for example if you choose 
t5page1 (PageLoaded)
+ you'll get:
+ {{{#!java
+     /**Tapestry page lifecycle method. Called when the page is instantiated 
and added to the page pool.
+      * Initialize components, and resources that are not request specific.*/
+     @PageLoaded
+     public void pageLoaded() {
+         
+     }
+ }}}
+ you can either remove the annotation or rename method to something 
meaningfull.
+ !Notice: org.apache.tapestry.annotations.PageLoaded will be added to imports 
automaticaly.
+ 
+ The mentioned template looks like this:
+ {{{#!java
+ /**Tapestry page lifecycle method. Called when the page is instantiated and 
added to the page pool.
+  * Initialize components, and resources that are not request specific.*/
+ @PageLoaded public void pageLoaded(){
+       ${cursor}
+ }
+ ${:import(org.apache.tapestry.annotations.PageLoaded)}
+ }}}
+ 
+ After you import the templates, you can modify them to suit your needs.
+ 
+ 
+ == here are screenshots to see it in action ==
+ '''t5''' - all templates
+ inline:t5_code_tpl_screen_all.jpg
+ 
+ '''t5i''' - inject templates
+ inline:t5_code_tpl_screen_inject.jpg
+ '''t5p''' - page lifecycle templates
+ inline:t5_code_tpl_screen_page.jpg
+ 
+ '''tpr''' - render phase method templates
+ inline:t5_code_tpl_screen_render.jpg
+ 

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to