Filtering an Explorer View via CheckableNode
By Geertjan on Oct 24, 2009
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.