Filtering an Explorer View via CheckableNode

This took me a really long time to figure out, but now it's working—and here it is as a sample:

The scenario is where you have a list in one explorer view and you'd like to use checkboxes to add/remove selected items from that explorer view to/from another explorer view in a different TopComponent:

I spent most of the time trying to use FilterNode.Children, but that's probably not even the purpose of that class. I was trying to use it because I wanted one explorer view to provide a FilterNode on top of a Node from a different explorer view. It didn't work because both views ended up with the same nodes, i.e., the CreateNodes in the FilterNode.Children didn't enable me to create different nodes for the different views. Ultimately I gave up on that approach and simply added/removed items to/from a list that the second children object used to create new nodes in the lower window.

This is how the source structure looks. You can see the two sets of classes for the windows selected. The other classes are "Movie" (which is the domain object), "RootNode" (which includes an action for adding new items to the top window), "CheckNode" (which implements CheckableNode and is added to the Lookup of the node in the top window), and "Utils" (which provides the lists and ChangeSupport that is shared between the other classes).

So not, as intended, a sample of FilterNode.Children. But still very useful, I believe.


OT: do you know any WIKI plug-in for Netbeans?
I mean a plug-in that would allow to edit in one of the wiki syntax (I know, there are many - but any would do it), and have live preview? Or any other sort of "smart" assistance from the IDE: WIKI syntax seems to be used everywhere on the web, but editing it in small browser textareas is just a pain - especially for bigger amount of text.

I found plug-ins for various(and obscure) languages, but none for WIKI :(.

Thanks in advance.

Posted by Andrei I. on October 24, 2009 at 07:05 PM PDT #

Excellent example. Is there a way to remove the root node from the outline view?

Posted by Eduardo Costa on September 28, 2010 at 09:58 AM PDT #

Post a Comment:
  • HTML Syntax: NOT allowed

Geertjan Wielenga (@geertjanw) is a Principal Product Manager in the Oracle Developer Tools group living & working in Amsterdam. He is a Java technology enthusiast, evangelist, trainer, speaker, and writer. He blogs here daily.

The focus of this blog is mostly on NetBeans (a development tool primarily for Java programmers), with an occasional reference to NetBeans, and sometimes diverging to topics relating to NetBeans. And then there are days when NetBeans is mentioned, just for a change.


« July 2016