Package jmri.jmrit.catalog.configurexml
Class DefaultCatalogTreeManagerXml
java.lang.Object
jmri.jmrit.XmlFile
jmri.jmrit.catalog.configurexml.DefaultCatalogTreeManagerXml
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.
-
Nested Class Summary
Nested classes/interfaces inherited from class jmri.jmrit.XmlFile
XmlFile.Validate -
Field Summary
Fields inherited from class jmri.jmrit.XmlFile
dtdLocation, xsltLocation -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanload(org.jdom2.Element catalogTrees) Create a CatalogTreeManager object of the correct class, then register and fill it.voidloadCatalogTrees(org.jdom2.Element catalogTrees) Utility method to load the individual CatalogTree objects.voidloadNode(org.jdom2.Element element, CatalogTreeNode parent, DefaultTreeModel model) Recursively load a CatalogTree.voidorg.jdom2.ElementThis is invoked as part of the "store all" mechanism, which is not used for these objects.voidstore(org.jdom2.Element cat, Set<CatalogTree> trees) Default implementation for storing the contents of a CatalogTreeManager.voidstoreNode(org.jdom2.Element parent, CatalogTreeNode node) Recursively store a CatalogTree.voidWrite out tree values to a file in the user's preferences directory.Methods inherited from class jmri.jmrit.XmlFile
addDefaultInfo, backupFileName, checkFile, createFileNameWithDate, dumpElement, findFile, getBuilder, getDefaultDtdLocation, getDefaultValidate, getDtdLocation, getProcessingInstructionHRef, getProcessingInstructionType, getRoot, getValidate, makeBackupFile, makeBackupFile, newDocument, newDocument, revertBackupFile, rootFromFile, rootFromInputStream, rootFromName, rootFromURL, setDefaultDtdLocation, setDefaultValidate, setDtdLocation, setValidate, userFileChooser, userFileChooser, writeXML, xmlDir
-
Constructor Details
-
DefaultCatalogTreeManagerXml
public DefaultCatalogTreeManagerXml()
-
-
Method Details
-
writeCatalogTrees
Write out tree values to a file in the user's preferences directory.- Throws:
IOException- from any I/O issues during write; not handled locally
-
store
Default implementation for storing the contents of a CatalogTreeManager.- Parameters:
cat- Element to load with contentstrees- List of contents
-
storeNode
Recursively store a CatalogTree.- Parameters:
parent- the element to store node innode- the root node of the tree
-
store
This is invoked as part of the "store all" mechanism, which is not used for these objects. Hence this is implemented to do nothing.- Parameters:
o- the object to store- Returns:
- null
-
readCatalogTrees
-
load
Create a CatalogTreeManager object of the correct class, then register and fill it.- Parameters:
catalogTrees- top level Element to unpack- Returns:
- true if successful
-
loadCatalogTrees
Utility method to load the individual CatalogTree objects.- Parameters:
catalogTrees- element containing trees
-
loadNode
Recursively load a CatalogTree.- Parameters:
element- element containing the node to loadparent- the parent node of the node in elementmodel- the tree model containing the tree to add the node to
-