jmri.jmrit.catalog.configurexml
Class DefaultCatalogTreeManagerXml

java.lang.Object
  extended by jmri.jmrit.XmlFile
      extended by jmri.jmrit.catalog.configurexml.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.

Author:
Pete Cressman Copyright: Copyright (c) 2009

Field Summary
 
Fields inherited from class jmri.jmrit.XmlFile
dtdLocation, xsltLocation
 
Constructor Summary
DefaultCatalogTreeManagerXml()
           
 
Method Summary
 boolean load(Element catalogTrees)
          Create a CatalogTreeManager object of the correct class, then register and fill it.
 void load(Element element, Object o)
           
 void loadCatalogTrees(Element catalogTrees)
          Utility method to load the individual CatalogTree objects.
 void loadNode(Element element, CatalogTreeNode parent, DefaultTreeModel model)
          Recursively load a CatalogTree
 void readCatalogTrees()
           
 void store(Element cat, List<String> trees)
          Default implementation for storing the contents of a CatalogTreeManager
 Element store(Object o)
          This is invoked as part of the "store all" mechanism, which is not used for these objects.
 void storeNode(Element parent, CatalogTreeNode node)
          Recursively store a CatalogTree
 void writeCatalogTrees()
           
 
Methods inherited from class jmri.jmrit.XmlFile
addDefaultInfo, backupFileName, checkFile, createFileNameWithDate, dumpElement, ensurePrefsPresent, findFile, getBuilder, getRootViaURI, getVerify, makeBackupFile, makeBackupFile, newDocument, newDocument, prefsDir, reportError1, reportError2, resourcesDir, revertBackupFile, rootFromFile, rootFromName, rootFromURL, scriptsDir, setScriptsFileLocationDefault, setUserFileLocationDefault, setVerify, userFileChooser, userFileChooser, userFileChooser, userFileChooser, userFileLocationDefault, writeXML, xmlDir
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultCatalogTreeManagerXml

public DefaultCatalogTreeManagerXml()
Method Detail

writeCatalogTrees

public void writeCatalogTrees()
                       throws IOException
Throws:
IOException

store

public void store(Element cat,
                  List<String> trees)
Default implementation for storing the contents of a CatalogTreeManager

Parameters:
cat - Element to load with contents
trees - List of contents

storeNode

public void storeNode(Element parent,
                      CatalogTreeNode node)
Recursively store a CatalogTree


store

public Element store(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.


readCatalogTrees

public void readCatalogTrees()

load

public void load(Element element,
                 Object o)
          throws Exception
Throws:
Exception

load

public boolean load(Element catalogTrees)
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

public void loadCatalogTrees(Element catalogTrees)
Utility method to load the individual CatalogTree objects.


loadNode

public void loadNode(Element element,
                     CatalogTreeNode parent,
                     DefaultTreeModel model)
Recursively load a CatalogTree



Copyright © 1997 - 2011 JMRI Community.
JMRI, DecoderPro, PanelPro, SoundPro, DispatcherPro and associated logos are our trademarks.

Additional information on copyright, trademarks and licenses is linked here.
Site hosted by: Get JMRI Model Railroad Interface at SourceForge.net. Fast, secure and Free Open Source software downloads