FileBrowserComponent tree view directory openness state


I’m implementing a tree view FileBrowserComponent. For styling I’m using the FileBrowserComponent::LookAndFeelMethod

 virtual void drawFileBrowserRow (Graphics&, int width, int height,
                                         const File& file,
                                         const String& filename,
                                         Image* optionalIcon,
                                         const String& fileSizeDescription,
                                         const String& fileTimeDescription,
                                         bool isDirectory,
                                         bool isItemSelected,
                                         int itemIndex,

Now when painting a directory-row with this , I’d like to know if the directory is currently expanded/open (the child elements are visible), or closed, to display the appropriate folder icon. The isItemSelected variable only communicates the actual mouse selection state, so that’s useless for the purpose of knowing if the directory is expanded in the tree view.

Any tips on how to accomplish this?