Properly refresh openness state with FileTreeComponent

Has anyone figured out a way to maintain the openness state of multiple levels of a tree structure using FileTreeComponent? Every other topic I’ve seen on the matter is 4+ years old and unresolved. This seems like something that should be pretty simple, but nothing I’ve come across in the documentation seems to work the way I want it to. Basically I would like this pattern:

  • user opens multiple levels of a file tree
  • user drags file into tree
  • store openness state of tree
  • refresh contents of tree
  • restore openness state of tree

The closest I’ve gotten is using get/restoreOpennessState() from the TreeView class. However, even if I wait for the refresh to finish (as determined by looking at isStillLoading() on the DirectoryContentsList object), the best I’ve gotten out of this method is a single level of the file tree being opened back up.

Previous threads on the topic :