use of apps.PerformScriptModel in project JMRI by JMRI.
the class PerformScriptModelXml method store.
/**
* Default implementation for storing the model contents
*
* @param o Object to store, of type PerformActonModel
* @return Element containing the complete info
*/
@Override
public Element store(Object o) {
Element e = new Element("perform");
PerformScriptModel g = (PerformScriptModel) o;
e.setAttribute("name", FileUtil.getPortableFilename(g.getFileName()));
e.setAttribute("type", "ScriptFile");
e.setAttribute("class", this.getClass().getName());
return e;
}
use of apps.PerformScriptModel in project JMRI by JMRI.
the class PerformScriptModelXml method load.
@Override
public boolean load(Element shared, Element perNode) throws Exception {
boolean result = true;
String fileName = shared.getAttribute("name").getValue();
fileName = FileUtil.getAbsoluteFilename(fileName);
PerformScriptModel m = new PerformScriptModel();
m.setFileName(fileName);
InstanceManager.getDefault(StartupActionsManager.class).addAction(m);
return result;
}
Aggregations