You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@netbeans.apache.org by Andreas Sewe <se...@cqse.eu> on 2018/07/30 08:34:28 UTC

Explorer views: How to create intermediate Node layers not present in the data model?

Hi,

I'm a currently working my way through the NetBeans Platform for
Beginners book and struggling with the following: I want to extend the
example in section 7.1.6.2 (an explorer view to create and delete Car
objects) such that the node tree gets an intermediate layer like this:

Root
- Brands starting with 'A'
  - Aston Martin
 Brands starting with 'B'
 - Bugatti
 - BMW
 Brands starting with 'M'
 - Mercedes

So, my requirements are this:

- I don't want to represent the intermediate layer in my data model; it
should still be just a list of Car objects with a brand property.

- I want to display the intermediate "Brands starting with 'X'" nodes
only if a brand starting with the letter actually exists in my data
model. We don't want to clutter the user interface with 26 nodes for
letters A to Z.

- If the user deletes the last Car with a brand starting with, say, 'M',
then the respective node should vanish from the UI.

After several hours of experimentation I am stuck. Hence, any pointer
how to achieve that, e.g., where to attach what listeners are greatly
appreciated.

Best wishes,

Andreas

-- 
Dr. Andreas Sewe | sewe@cqse.eu | +49 152 56342856
CQSE GmbH | Lichtenbergstrasse 8 | 85748 Garching | www.cqse.eu
Amtsgericht Muenchen | HRB 177678 | GF: F. Deissenboeck, M. Feilkas