[forge-users] addon creation

forge-users at lists.jboss.org forge-users at lists.jboss.org
Tue Dec 23 09:03:56 EST 2014


I'm trying to create an addon. (Fazerty/jbfex-addon · GitHub (https://github.com/Fazerty/jbfex-addon/))
There are 2 commands:
 - one to create a project and write in this project a fiel readme.txt from a template
 - one to create a java file from a template and add dependency. This command is only available to projects created with the first command.

I've several problems:
 - in the method initializeUI(UIBuilder builder) of the class JbfexMailCommand
        this  doesn't work :
*+project = getSelectedProject(builder.getUIContext());+*
 - the methods to create files from template works when the forge cli is used, but not when the forge UI in eclipse is used
     here is the code used:
 +*URL resourceURL = getClass().getResource("mailservice.fmt");*+
*+        Resource<URL> templateResource = resourceFactory.create(resourceURL);+*
+*        Template template = templateFactory.create(templateResource, FreemarkerTemplate.class);  *+  

Maybe I did something wrong, but I can't find what.
Is somebody able to help me and give me some advice to improve this addon.

Many Thanks


Posted by forums
Original post: https://developer.jboss.org/message/914438#914438

More information about the forge-users mailing list