Search in sources :

Example 6 with FileHistory

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;
}
Also used : FileHistory(jmri.jmrit.revhistory.FileHistory)

Example 7 with FileHistory

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;
}
Also used : Element(org.jdom2.Element) FileHistory(jmri.jmrit.revhistory.FileHistory)

Aggregations

FileHistory (jmri.jmrit.revhistory.FileHistory)7 Element (org.jdom2.Element)4 TabbedPreferences (apps.gui3.TabbedPreferences)1 InvocationTargetException (java.lang.reflect.InvocationTargetException)1 ArrayList (java.util.ArrayList)1 JFrame (javax.swing.JFrame)1 JScrollBar (javax.swing.JScrollBar)1 JScrollPane (javax.swing.JScrollPane)1 JTextArea (javax.swing.JTextArea)1 NamedBeanHandleManager (jmri.NamedBeanHandleManager)1 EntryExitPairs (jmri.jmrit.signalling.EntryExitPairs)1 JmriJFrame (jmri.util.JmriJFrame)1