class_docstr: A setting to be used to display directories and their files
  
  The FileCollectionDisplay shows directory trees with mechanisms to
  communicate directory additions and deletions to its parent module.
  
  The central data structure is the dictionary, "self.file_tree". The keys
  for the top-level of the dictionary are the directories managed by the
  setting. If a key represents a directory, its value is another directory.
  If a key represents a file, its value is either True (the file is included
  in the collection) or False (the file is filtered out of the collection).
  
  Directory dictionaries can be filtered: this is done by setting the
  special key, "None" to either True or False.
  
  The FileCollectionDisplay manages the tree and it should be treated as
  read-only by callers. Callers can request that nodes be added, removed,
  filtered or not filtered by calling the appropriate notification function
  with a nested collection of two-tuples and strings (modpaths). Two-tuples
  represent directories whose subdirectories or files are being operated on.
  Strings represent directories or files that are being operated on. The first
  element of the two-tuple is the directory name and the second is a
  sub-collection of two-tuples. For instance, to operate on foo/bar, send:
  
  ("foo", ("bar", ))
  
  The FileCollectionDisplay communicates events on individual files or
  directories by specifying a path as a collection of path parts. These
  can be any sort of object and it is the caller's job to maintain the
  display names of each of them and their node categories (used for
  icon display).
docstr: Constructor
  
  text - the label to the left of the setting
  
  value - the value for the control. This is a serialization of
          the appearance (for instance, whether to show or hide
          filtered files).
  
  fn_on_drop - called when files are dropped. The signature is
               fn_on_drop(pathnames, check_for_directories) The first
               argument is a list of pathnames of the dropped files.
               The second argument is True if the user has performed
               a file name drop which might include directories and
               False if the user has dropped text file names.
  
  fn_on_remove - called when the UI requests that files be removed. Has
                 one argument which is a collection of paths to remove.
  
  fn_get_path_info - called when the UI needs to know the display name,
               icon type, context menu and tool tip for an item. These
               are returned in a four-tuple by the callee, e.g:
               [ "image.tif", NODE_MONOCHROME_IMAGE,
                 "image of well A01 on plate P-12345",
                 ( "Show image", "Show metadata", "Delete image")]
  
  fn_on_menu_command - called when the user selects a context menu
               command. The argument is the text from the context menu or
               None if the default command.
  
  fn_on_bkgnd_control - called when the UI wants to stop, pause or resume
               all background processing. BKGND_PAUSE asks for the
               caller to pause processing, BKGND_RESUME asks for the
               caller to resume, BKGND_STOP asks for processing to be
               aborted, BKGND_GET_STATE asks for the caller to
               return its current state = BKGND_PAUSE if it is paused,
               BKGND_RESUME if it is running or BKGND_STOP if it is
               idle.
  
  hide_text - the text displayed next to the hide checkbox.
docstr_tok: ["Constructor","text","-","the","label","to","the","left","of","the","setting","value","-","the","value","for","the","control",".","This","is","a","serialization","of","the","appearance","(","for","instance",",","whether","to","show","or","hide","filtered","files",")",".","fn_on_drop","-","called","when","files","are","dropped",".","The","signature","is","fn_on_drop","(","pathnames",",","check_for_directories",")","The","first","argument","is","a","list","of","pathnames","of","the","dropped","files",".","The","second","argument","is","True","if","the","user","has","performed","a","file","name","drop","which","might","include","directories","and","False","if","the","user","has","dropped","text","file","names",".","fn_on_remove","-","called","when","the","UI","requests","that","files","be","removed",".","Has","one","argument","which","is","a","collection","of","paths","to","remove",".","fn_get_path_info","-","called","when","the","UI","needs","to","know","the","display","name",",","icon","type",",","context","menu","and","tool","tip","for","an","item",".","These","are","returned","in","a","four-tuple","by","the","callee",",","e.g",":","[","``","image.tif","''",",","NODE_MONOCHROME_IMAGE",",","``","image","of","well","A01","on","plate","P-12345","''",",","(","``","Show","image","''",",","``","Show","metadata","''",",","``","Delete","image","''",")","]","fn_on_menu_command","-","called","when","the","user","selects","a","context","menu","command",".","The","argument","is","the","text","from","the","context","menu","or","None","if","the","default","command",".","fn_on_bkgnd_control","-","called","when","the","UI","wants","to","stop",",","pause","or","resume","all","background","processing",".","BKGND_PAUSE","asks","for","the","caller","to","pause","processing",",","BKGND_RESUME","asks","for","the","caller","to","resume",",","BKGND_STOP","asks","for","processing","to","be","aborted",",","BKGND_GET_STATE","asks","for","the","caller","to","return","its","current","state","=","BKGND_PAUSE","if","it","is","paused",",","BKGND_RESUME","if","it","is","running","or","BKGND_STOP","if","it","is","idle",".","hide_text","-","the","text","displayed","next","to","the","hide","checkbox","."]
code: def __init__(
      self,
      text,
      value,
      fn_on_drop,
      fn_on_remove,
      fn_get_path_info,
      fn_on_menu_command,
      fn_on_bkgnd_control,
      hide_text="Hide filtered files",
      **kwargs,
  ):
      """Constructor
  
      text - the label to the left of the setting
  
      value - the value for the control. This is a serialization of
              the appearance (for instance, whether to show or hide
              filtered files).
  
      fn_on_drop - called when files are dropped. The signature is
                   fn_on_drop(pathnames, check_for_directories) The first
                   argument is a list of pathnames of the dropped files.
                   The second argument is True if the user has performed
                   a file name drop which might include directories and
                   False if the user has dropped text file names.
  
      fn_on_remove - called when the UI requests that files be removed. Has
                     one argument which is a collection of paths to remove.
  
      fn_get_path_info - called when the UI needs to know the display name,
                   icon type, context menu and tool tip for an item. These
                   are returned in a four-tuple by the callee, e.g:
                   [ "image.tif", NODE_MONOCHROME_IMAGE,
                     "image of well A01 on plate P-12345",
                     ( "Show image", "Show metadata", "Delete image")]
  
      fn_on_menu_command - called when the user selects a context menu
                   command. The argument is the text from the context menu or
                   None if the default command.
  
      fn_on_bkgnd_control - called when the UI wants to stop, pause or resume
                   all background processing. BKGND_PAUSE asks for the
                   caller to pause processing, BKGND_RESUME asks for the
                   caller to resume, BKGND_STOP asks for processing to be
                   aborted, BKGND_GET_STATE asks for the caller to
                   return its current state = BKGND_PAUSE if it is paused,
                   BKGND_RESUME if it is running or BKGND_STOP if it is
                   idle.
  
      hide_text - the text displayed next to the hide checkbox.
      """
      super(self.__class__, self).__init__(text, value, **kwargs)
      self.fn_on_drop = fn_on_drop
      self.fn_on_remove = fn_on_remove
      self.fn_get_path_info = fn_get_path_info
      self.fn_on_menu_command = fn_on_menu_command
      self.fn_on_bkgnd_control = fn_on_bkgnd_control
      self.hide_text = hide_text
      self.fn_update = None
      self.file_tree = {}
      self.properties = {self.SHOW_FILTERED: True}
      try:
          properties = json.loads(value)
          if isinstance(properties, dict):
              self.properties.update(properties)
      except:
          pass
  
imports: import json
  from ._setting import Setting
label_desc: Use image node_id 1 to create a new FileCollectionDisplay object from inherited base classes: Setting with example: obj = FileCollectionDisplay(text, value, fn_on_drop, fn_on_remove, fn_get_path_info, fn_on_menu_command, fn_on_bkgnd_control, hide_text)