[jbosside-issues] [JBoss JIRA] Updated: (JBIDE-428) Add new features to Feemarker Plugin

ZERR Angelo (JIRA) jira-events at jboss.com
Fri Dec 22 13:28:39 EST 2006


     [ http://jira.jboss.com/jira/browse/JBIDE-428?page=all ]

ZERR Angelo updated JBIDE-428:
------------------------------

    Attachment: patch.txt

This patch update Freemarker Plugin to : 

- add Template for Completion. (ex : type list + CTRL+SPACE, it generate <#list sequence as item></#list>).
  Template can be customizable with ment Window/Preferences.../Freemarker Editor/Templates

By default, there is a template for $, list, assign, if and ifelse, but It will be getter to add another template in the distribution (I have not an expert with Freemarker).

- add XML context in order to manage XML file as context (today it exists ONLY Class context). To use XML context Open Context Dialog, select XML checkbox and search the XML file (ex : Hibernate Mapping). After you have Completion for this XML context. Ex : if you register your XML context with name=doc and if XML file is Hibernate mapping, after if  you type ${doc.
Completion will display hibernate-mapping

- Manage '-' character when your variable name has '-'.  For instance, if you have a ftl template like this

${doc.hibernate-mapping.package}, Freemarker will crash while merging model and context. So you must write
${doc["hibernate-mapping"].package}. So with my update, Plugin manage this case. So if you type ${doc. 
hibernate-mapping will be display, select it in the completion proposalsource editor will display

${doc["hibernate-mapping"]

- Preview tab : this feature works today ONLY with XML context and not with Class context. If you click into this tab (after the context tab), This tab will display the result of the merging with template and XML contextes.



> Add new features to Feemarker Plugin
> ------------------------------------
>
>                 Key: JBIDE-428
>                 URL: http://jira.jboss.com/jira/browse/JBIDE-428
>             Project: JBoss IDE
>          Issue Type: Patch
>          Components: FreeMarker plugin
>            Reporter: ZERR Angelo
>         Assigned To: Joe Hudson
>         Attachments: FreemarkerIDE.zip, patch.txt
>
>
> I have updated Freemarker Plugin to : 
> 1) have template completion capability : (ex : type list in your ftl template, and CRTL+SPACE => <#list ....><#list> will be generate.
>  You can customize your template with menu Window/Preferences/Freemarker Editor/Templates
> 2) add XML context capabilty. You can choose XML file and have completion with element and attribute of your XML.
> 3) add String context. I beleive it will be better to have Java Type context (Boolea, String,...)
> 3) add Preview Tab to see the result of the merge of your template and your model. It works ONLY with XML context. It's not available dor Class context.
>    To use Preview Tab with Class, I believe it will good to have a class wich return getter of your Class.
>    Ex : if you have class MyForm, user will have to add getMyForm in the context class for the preview.
>    MyForm getMyForm() {
>      MyForm form = new MyForm
>      form.setId("MyId")
>      return form;
>   }
>   If user have the ftl template ${myForm.id}, when you click to th epreview tab, you will have MyId displayed. 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the jbosstools-issues mailing list