| Newsgroups |
gmane.comp.java.netbeans.modules.openide.devel |
| Message-ID |
<[email protected]> |
I have a NetBeans RCP app that I am configuring to use a custom file
type. I have followed the available tutorials and suggestions I have
found online, plus I have acquired a few books. I have successful
created a MultiDataObject, MultiView Window/Element and can open any of
my custom files easily showing a BeanTreeView of the DataObject
representing the FileObject for the custom file, plus can create
children of this node when it is opened. So I have a lot of things
working properly.
The part that is not working as I'd expect is the "New File..." menu
item from the IDE's top File Menu list. I am not seeing the template
that was created for me by going through the New FileType wizard. Here
is how I defined/adjusted my template:
@TemplateRegistration(folder = "Other",
iconBase = "com/myorg/loaders/frame.gif",
displayName = "#HTMLtemplate_displayName",
content = "poleappTemplate.poleapp",
description = "Description.html",
position=99,
scriptEngine="freemarker")
@Messages(value = "HTMLtemplate_displayName=App File")
package com.myorg.loaders;
import org.netbeans.api.templates.TemplateRegistration;
import org.openide.util.NbBundle.Messages;
The good news is that several other parts I am trying to use from the
RCP platform are working properly. The goal for me is to enable the
user to create several templates of their own as starting points for
newly created files. This would help their productivity greatly as they
could use one file template with many things already set and use this
to start many similar projects.
When I right-click on my DataObject, I get the "Save as Template"
option which produces a Dialog asking for what category it should store
the file as a template. I see a Templates folder, a subfolder of Other
and a folder called "User Configuration Properties". Within the Other
folder is the file template I have registered (plus "Empty File" and
"Folder" which I can suppress later). If I go to Tools->Template from
the top RCP menu item, I see only the "Other" folder with my template
inside and the same two other items.
The only problem I have happens whether I right-click in the Favorites
Explorer for New-> , or I use the File New... menu item, only the
"Empty File" and "Folder" options are shown. I need to get my file
template shown somehow. So my file template appears beside these two
items in some parts of the app, but not for File New... purposes.
I am using NetBeans 8.02 at the moment. Is it possible that I have
something suppressed in my layer file that might be causing an issue.
Any thoughts would be appreciated.
Steve