Class DefaultCatalogTreeManagerXml

  • public class DefaultCatalogTreeManagerXml
    extends XmlFile
    Provides the abstract base and store functionality for configuring the CatalogTreeManager.

    Typically, a subclass will just implement the load(Element catalogTree) class, relying on implementation here to load the individual CatalogTree objects.

    • Method Detail

      • writeCatalogTrees

        public void writeCatalogTrees()
        Write out tree values to a file in the user's preferences directory.
        Throws: - from any I/O issues during write; not handled locally
      • store

        public void store​(Element cat,
                          java.util.Set<CatalogTree> trees)
        Default implementation for storing the contents of a CatalogTreeManager.
        cat - Element to load with contents
        trees - List of contents
      • storeNode

        public void storeNode​(Element parent,
                              CatalogTreeNode node)
        Recursively store a CatalogTree.
        parent - the element to store node in
        node - the root node of the tree
      • store

        public Element store​(java.lang.Object o)
        This is invoked as part of the "store all" mechanism, which is not used for these objects. Hence this is implemented to do nothing.
        o - the object to store
      • load

        public boolean load​(Element catalogTrees)
        Create a CatalogTreeManager object of the correct class, then register and fill it.
        catalogTrees - top level Element to unpack
        true if successful
      • loadCatalogTrees

        public void loadCatalogTrees​(Element catalogTrees)
        Utility method to load the individual CatalogTree objects.
        catalogTrees - element containing trees
      • loadNode

        public void loadNode​(Element element,
                             CatalogTreeNode parent,
                             javax.swing.tree.DefaultTreeModel model)
        Recursively load a CatalogTree.
        element - element containing the node to load
        parent - the parent node of the node in element
        model - the tree model containing the tree to add the node to