Search in sources :

Example 1 with ScriptingPermissions

use of org.freeplane.plugin.script.ScriptingPermissions in project freeplane by freeplane.

the class ScriptAddOnProperties method parseScripts.

private List<Script> parseScripts(Vector<XMLElement> xmlElements) {
    final ArrayList<Script> scripts = new ArrayList<Script>();
    if (xmlElements == null || xmlElements.isEmpty())
        return scripts;
    for (XMLElement scriptXmlNode : xmlElements.get(0).getChildren()) {
        final Script script = new Script();
        for (Entry<Object, Object> entry : scriptXmlNode.getAttributes().entrySet()) {
            if (entry.getKey().equals("name")) {
                script.name = (String) entry.getValue();
            } else if (entry.getKey().equals("executionMode")) {
                script.executionMode = parseExecutionMode(entry.getValue().toString());
            } else if (entry.getKey().equals("menuTitleKey")) {
                script.menuTitleKey = entry.getValue().toString();
            } else if (entry.getKey().equals("menuLocation")) {
                script.menuLocation = entry.getValue().toString();
            }
        }
        script.permissions = new ScriptingPermissions(scriptXmlNode.getAttributes());
        scripts.add(script);
    }
    return scripts;
}
Also used : ArrayList(java.util.ArrayList) ScriptingPermissions(org.freeplane.plugin.script.ScriptingPermissions) XMLElement(org.freeplane.n3.nanoxml.XMLElement)

Aggregations

ArrayList (java.util.ArrayList)1 XMLElement (org.freeplane.n3.nanoxml.XMLElement)1 ScriptingPermissions (org.freeplane.plugin.script.ScriptingPermissions)1