@Override public void update() { // テーブルヘッダは起動中変更できないので、ファイルは増減させない for (Script script : this.get()) { if (script.isUpdated()) { script.reload(); } } }
@Override public boolean isUpdated() { // テーブルヘッダは起動中変更できないので、ファイルは増減させない for (Script script : this.get()) { if (script.isUpdated()) { return true; } } return false; }
private synchronized Script getTableStyleScript_(String prefix) { Script script = this.scripts.get(prefix); if (script == null) { File scriptFile = this.getTableStyleScriptFile(prefix); script = new Script(scriptFile, TableItemCreator.class, scriptFile.exists()); this.scripts.put(prefix, script); } else if (script.isUpdated()) { script.reload(); } return script; }
private void loadScripts() { Map<String, Script> oldScripts = this.scripts; this.scripts = new TreeMap<>(); for (File file : this.getScriptFiles()) { Script script = oldScripts.get(file.getPath()); if ((script == null)) { script = this.makeScript(file, this.type); } else if (script.isUpdated()) { script.reload(); } this.scripts.put(file.getName(), script); } }
public boolean isUpdated() { File[] files = this.getScriptFiles(); if (this.scripts.size() != files.length) { return true; } for (File file : files) { Script script = this.scripts.get(file.getPath()); if (script == null) { return true; } if (script.isUpdated()) { return true; } } return false; }