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.
lol thanks. That helped, I was able to 'solve' the problem with a surrounding try catch, so either that or hardcoding the names to what classes they will cast to should be an okay workaround
not my own resource node, just a dockableFrame. Adding to this however i found there is a getSelectionModel on the browser root which should simplify finding the selected items.