I'm trying to use ProjectBrowserRoot root = designerContext.getProjectBrowserRoot(); and its children and childrens children to get project resources. I can get them as AbstractNavTreeNode, but whenever I try casting them (if thats the right thing to do here) to the more useful subtype of AbstractResourceNavTreeNode (or its subtypes) it breaks everything.
I'd like to use these so I can get selected project resources for use elsewhere.
I feel like I'm missing something here about how this works.
Not all nav tree nodes have a resource. I'd be surprised if the ones they manage are actually exposed in the nav tree, too. Is there any reason you cannot just query the project for the resources themselves? (Via DesignerContext => DesignableProject)
Ah that might be why. I'm doing it this way because I'd like to get the currently selected resource for a custom designer menu (rather then selecting the resource separately through a ProjectResourceSelector). I did not see a way to tell if a resource is selected through the designable project but I may have missed something.