Hi Antonio,
I'd guess this won't work, either. The name isn't fixed (it is
project-dependent), it's not an Ant build file, what is produced (the
config isn't even produced externally), and the XSL will most likely be
interpreted by NB infrastructure - if I'm using a DataObject. OTOH, it
should be possible to just edit the file in a "simple" editor, probably
it might be possible to use some XML utilities, at least.
There's also a non-XML multiview API, I'll use that.
I've still got one problem with this: How do I load my data into an
Editor/JEditorPane? Do I have instantiate an EditSupport?
When creating WindowComponent in editor mode, I'm getting several bugs
about singletons and restoring editors after restarting NetBeans, and my
current approach is very "synthetic", i.e. windows system does not seem
to be intended to be used this way ...
Could You probably point me to some docs?
Kind regards
Peter Nabbefeld
AntonioV wrote:
> Hi Peter,
>
> I'm not very good at MimeResolvers, so I'm afraid you'll have to resort to a
> more expert answer.
>
> Anyway here goes my quick& dirty solution: what about creating a sibling
> file with a well known extension (so it's easily detected with current NBRCP
> infrastructure), and then build a MultiDataObject from that file as a
> primary file *and* your XSLT as a secondary file?
>
> I know that having a dummy file around is probably not the best solution
> but, hey, maybe it's a simpler way to have things done.
>
> Cheers,
> Antonio
>
> P.S.: If you're using your XSLT to build a "build.xml" file for Ant, then I
> think you can probably add a LookupProvider to your Project, and register
> that in a proper way see:
>
>
http://bits.netbeans.org/dev/javadoc/org-netbeans-modules-project-ant/org/netbeans/spi/project/support/ant/GeneratedFilesHelper.html#generateBuildScriptFromStylesheet%28java.lang.String,%20java.net.URL%29>
> and
>
>
http://bits.netbeans.org/dev/javadoc/org-netbeans-modules-project-ant/org/netbeans/api/project/ant/AntBuildExtender.html>
>
>
>
> epdv wrote:
>> AntonioV wrote:
>>> Hi Peter,
>>>
>>> I think I don't understand the question. So let me explain what I
>>> understand:
>>>
>>> You have a XML file with ".xml" extension. (You say it's a "config" file,
>>> what does that mean? Are you using it inside the "nbproject" directory
>>> integrating it as a part of the "build.xml"?). The contents of the XML
>>> file
>>> do not have a common "root" element (so one file can start with
>>> "<invoices>"
>>> and another can start with "<facturas>").
>> No nbproject. Even worse, it's an XSLT file which *results* in something
>> like a config, without anything making it possible to use a MimeResolver.
>>
>>> What you want to do is to create a DataObject from that file, and then
>>> use a
>>> MultiView to be able to edit it visually.
>>>
>>> Am I right?
>> Yes. I've already thought about using a java implemented mime resolver
>> (like in "good old times" ;-) ), but AFAIK, declarative resolvers have
>> higher precedence, so my file will be resolved as an xsl file anyway.
>> Also, I don't know if NB will work well, if I had to ask for the project
>> owning the file before mime resolution.
>>
>> Thanks
>>
>> Peter
>>
>>> Thanks,
>>> Antonio
>>>
>>>
>>>
>>> epdv wrote:
>>>> Hello!
>>>>
>>>> I've got a special xml config file, whose name may even change from
>>>> project to project. I've already created an ant project type (works :-)
>>>> ), but now I want to create an XML multiview editor as described here:
>>>>
http://blogs.sun.com/geertjan/entry/visual_editor_part_1.
>>>>
>>>> My problem with this is, I'll not be able to declare my config file type
>>>> in layer, as it is completely project dependent. Worse, there's not even
>>>> any public or system id which could be used. So, how can I create an
>>>> XmlMultiViewDataObject from my node's performAction method? BTW, I guess
>>>> the object has to be created from my FileObject and has to be put into
>>>> Lookup somehow - how?
>>>>
>>>> Kind regards
>>>>
>>>> Peter
>>>>
>>>>
>>>>
>>
>>
>>
>