X

Geertjan's Blog

  • January 17, 2006

MultiView Editor Sample

Geertjan Wielenga
Product Manager
If you go to my Update Center (http://blogs.sun.com/roller/resources/geertjan/updates_geertjan.xml), as described in Publish Plug-ins Painlessly! (Part 1), you will find a new plug-in module—"MultiView API Sample":

If you install this plug-in module, you'll find a new sample in the New Project wizard (look around in the "Samples" folder). So, you can open this sample and look at the sources (and learn from them and build your own multiview editor on top of it).

When you install the sample (in the current development IDE) and then expand the top package, you'll find a file called "abc.story". This is an example file. All files with the extension ".story" are handled by the loader that the "MultiView API Sample" plug-in sample provides. Here's the icon provided by the loader:

When you open the above file, you see this content in the XML view:

And, when you click the Design toggle button at the top of the Source Editor, you'll see this:

(By the way, the content that you see in the sample "abc.story" file is, coincidentally, about creating NetBeans plug-in modules...)

And, this implementation of multiview support uses a newer multiview support API, one that is made specifically for XML files. As with several other APIs, though, this API has not been finalized, so beware of assuming otherwise.

Join the discussion

Comments ( 7 )
  • Martin Adamek Tuesday, January 17, 2006
    Dear diary. I came home after dinner and installed Multiview API Sample module from Geertjan's update center. Then I wrote multiview editor for persistence.xml and went to bed. I'm gonna commit in NetBeans CVS today.
  • Geertjan Wednesday, January 18, 2006
    Haha. Excellent!
  • Geertjan Wednesday, January 18, 2006
    By the way, Martin, your comment really made my day. Maybe my week. What you did is EXACTLY what I was hoping would begin happening with these API samples. In some ways, they're templates. The only way in which they're NOT templates is that no expert NetBeans user in the apisupport area (or in the web area) has looked at these samples to see whether the code is optimal, well written, efficient, etc. In other words, these API samples all come from different sources (some I developed myself, others were made by other developers, while others come from the NetBeans sources). But, in this particular case, i.e., for the MultiView API Sample, the sources come from the XML module in the NetBeans sources -- it is in the "test" folder, and is used by QE (I guess) to test whether the MultiView API works or not. But, you might have noticed a third view in this module -- you can also present the XML in a tree hierarchy. Not sure if that's useful for persistence.xml, but at least, if you want to use it, it's included in the module. Anyway, thanks for intuitively using the module as I had intended it to be used (but remember that there might be a lot of imperfections in the code).
  • Ramón Ramos Saturday, January 21, 2006
    Hi Geertjan,
    I am having module dependency errors when I try to install any plugin from your update center. I use NB 5.0 RC2. Do you assume NB 5.1?
  • Ramón Ramos Sunday, January 22, 2006
    I just wanted me to be notified of new comments. I checked the box this time :-)
  • Geertjan Sunday, January 22, 2006
    Yes, I do assume NB 5.1 (i.e., this is the post-5.0 development build you can get from www.netbeans.org's download page). I'd like to make all the modules available for 5.0, but will only do so when 5.0 comes out (otherwise I'd have to make versions of these modules for Beta 1, Beta 2, RC1, RC2, etc. etc. etc. which is a bit cumbersome). So, round about the time 5.0 comes out, everything in my Update Center will work with 5.0. Until then, I will target the 5.1 (post-5.0 dev build) only. I'd prefer to support all the abovementioned versions, but it would be difficult to manage, I think (unless someone REALLY wants me to). Apologies for the ambivalence.
  • Geertjan Sunday, January 22, 2006
    By the way, one reason why I'm using 5.1 (i.e., the post-5.0 development build) is that it includes functionality for automating the creation of autoupdate decsriptors. This is very useful if you're adding modules to your own update center. But this functionality will not be part of 5.0. (Possibly available via other means soon after 5.0 is released.)
Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.