I am creating an editor application, and I am having a problem with my menus. In the object menu, I want to display several objects types using a JTree
. These object types are dynamically registered by plugins and follow this style:
trigger.button
trigger.lever
out.door.fallgate
trigger.plate
out.door.door
...
This list of names is unsorted and I want to build a TreeNode
structure for a JTree
like this:
- trigger
- button
- lever
- plate
- out
- door
- fallgate
- door
- door
Additionally, if the user selects a leaf node, I need to recreate the object name (e.g. trigger.button) from the TreePath
. Could someone please advise how this can be done.