FileTemplate Creation

I'm at wits end here.


I have the following structure

/src/fileTemplates/j2ee/OCPForm.java.ft
/src/fileTemplates/j2ee/OCPForm.html.ft


I have a class that implements FileTemplateGroupDescriptorFactory and ApplicationComonent and registered in my plugin xmlwith the following code

    public FileTemplateGroupDescriptor getFileTemplatesDescriptor()
    {
        FileTemplateGroupDescriptor groupDescriptor = new FileTemplateGroupDescriptor("OCPHelper Descriptor", OCPHelperConstants.FRY_ICON);

        groupDescriptor.addTemplate(new FileTemplateDescriptor("OCPForm.java"));

        return groupDescriptor;
    }


I don't ever see this run though.  I'm also unable to createClass with this template.   What else am I missing here?  I've used most of the code from the DevKit.  Not sure what else i need.

4 comments
Comment actions Permalink

I ended up getting it working by clearing the plugin-sandbox cache.  I'll post more on this in the morning - time for sleep now.

0
Comment actions Permalink

Hello Shaun,

If you're targeting IDEA 8, you shouldn't implement ApplicationComponent
on this class. Instead, the recommended way is to register classes implementing
the FileTemplateGroupDescriptorFactory via the ]]> extension
in plugin.xml.

I'm at wits end here.

I have the following structure

/src/fileTemplates/j2ee/OCPForm.java.ft
/src/fileTemplates/j2ee/OCPForm.html.ft
I have a class that implements FileTemplateGroupDescriptorFactory and
ApplicationComonent and registered in my plugin xmlwith the following
code

public FileTemplateGroupDescriptor getFileTemplatesDescriptor()
{
FileTemplateGroupDescriptor groupDescriptor = new
FileTemplateGroupDescriptor("OCPHelper Descriptor",
OCPHelperConstants.FRY_ICON);
groupDescriptor.addTemplate(new
FileTemplateDescriptor("OCPForm.java"));

return groupDescriptor;
}
I don't ever see this run though. I'm also unable to createClass with
this template. What else am I missing here? I've used most of the
code from the DevKit. Not sure what else i need.

---
Original message URL:
http://www.jetbrains.net/devnet/message/5235409#5235409

--
Dmitry Jemerov
Development Lead
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"


0
Comment actions Permalink

I wl be targeting 7 at first with a few people on 8.  I have implemented it as an APplicationComonent so far.  Do I need to implement this as the extension for this to work in IntelliJ8 as well or can I leave it as is?

0
Comment actions Permalink

Hello Shaun,

I wl be targeting 7 at first with a few people on 8. I have
implemented it as an APplicationComonent so far. Do I need to
implement this as the extension for this to work in IntelliJ8 as well
or can I leave it as is?


Registration as ApplicationComponent works in IDEA 8, but it may stop working
in future IDEA versions.

--
Dmitry Jemerov
Development Lead
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"


0

Please sign in to leave a comment.