X

Geertjan's Blog

  • December 11, 2006

Common Palette API + MultiView Windows API

Geertjan Wielenga
Product Manager
I wanted to try to combine the Common Palette API with the MultiView Windows API, just to see if I could do it. So, I started with the sample that you get at the end of the NetBeans Component Palette Module Tutorial, by turning the editor into the source view of a multiview editor. Once that was working, I created a TopComponent, implementing MultiViewElement, and then created a MultiViewDescription for the TopComponent, and added that MultiViewDescription implementation to the array of MultiViewDescriptions in the CloneableEditorSupport implementation. Then, as usual, associated the palette with the TopComponent's constructor. It was just an experiment, so I added the same palette to both views, even though it doesn't actually work for the visual view (because I haven't implemented a drop target in the TopComponent and because the palette items are for a text based editor, not for a visual component).

The result of all of this is that I now have a palette in my source view, as shown here:

But I also have a palette in my visual view, as shown here:

Mohamed and co's Plethora open source project provides something similar.

Be the first to comment

Comments ( 0 )
Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.Captcha