Package org.freeplane.plugin.script.proxy

Examples of org.freeplane.plugin.script.proxy.FormulaCache


          HtmlUtils.htmlToPlain(scriptContext.getStackFront().getText())));
    }
    final ScriptingPermissions restrictedPermissions = ScriptingPermissions.getFormulaPermissions();
    try {
      if (ENABLE_CACHING) {
        final FormulaCache formulaCache = getFormulaCache(nodeModel.getMap());
        Object value = formulaCache.get(nodeModel, text);
        if (value == null) {
          try {
            value = ScriptingEngine.executeScript(nodeModel, text, scriptContext, restrictedPermissions);
            formulaCache.put(nodeModel, text, value);
            if (DEBUG_FORMULA_EVALUATION)
                System.err.println("eval: cache miss: recalculated: " + text);
          }
          catch (ExecuteScriptException e) {
            formulaCache.put(nodeModel, text, e);
                if (DEBUG_FORMULA_EVALUATION)
                    System.err.println("eval: cache miss: exception for: " + text);
            throw e;
          }
        }
View Full Code Here


    }
    return dependencies;
  }

  private static FormulaCache getFormulaCache(MapModel map) {
    FormulaCache formulaCache = (FormulaCache) map.getExtension(FormulaCache.class);
    if (formulaCache == null) {
      formulaCache = new FormulaCache();
      map.addExtension(formulaCache);
    }
    return formulaCache;
  }
View Full Code Here

TOP

Related Classes of org.freeplane.plugin.script.proxy.FormulaCache

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.