use of jmri.jmrit.revhistory.FileHistory in project JMRI by JMRI.
the class FileHistoryXml method loadDirectly.
/**
* Load RevHistory from an element.
*
* <p>
* If no RevHistory already present in InstanceManager, creates one and adds
* this.
* <P>
* Then adds, instead of replacing, the history information
*/
public boolean loadDirectly(Element e) throws Exception {
if (!e.getName().equals("filehistory")) {
throw new Exception("Unexpected element name: " + e.getName());
}
FileHistory rmain = jmri.InstanceManager.getDefault(FileHistory.class);
FileHistory r = loadFileHistory(e);
rmain.addOperation("Load", "", r);
return true;
}
use of jmri.jmrit.revhistory.FileHistory in project JMRI by JMRI.
the class FileHistoryXml method loadFileHistory.
public static FileHistory loadFileHistory(Element e) {
FileHistory r = new FileHistory();
java.util.List<Element> list = e.getChildren("operation");
for (int i = 0; i < list.size(); i++) {
loadOperation(r, list.get(i));
}
return r;
}
Aggregations