Changeset 784 for trunk/src/org/expeditee/items/widgets/JSWidget.java
- Timestamp:
- 01/29/14 15:53:51 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/expeditee/items/widgets/JSWidget.java
r765 r784 5 5 import java.util.List; 6 6 7 import javax.script.Bindings;8 7 import javax.script.Invocable; 9 import javax.script.ScriptContext;10 8 import javax.script.ScriptEngine; 11 9 import javax.swing.JComponent; … … 63 61 this.container.add(component); 64 62 this.scriptEngine.put("component", this.component); 63 this.scriptEngine.eval("save = " + this.save); 64 this.scriptEngine.eval("load = " + this.load); 65 65 } 66 66 … … 69 69 source.getData().get(1).replaceAll("\\\\n", "\n"), 70 70 source.getData().get(2).replaceAll("\\\\n", "\n")); 71 this.scriptEngine.eval("load = " + this.load);72 71 this.invocable.invokeFunction("load", (Object) args); 73 72 } … … 90 89 try { 91 90 List<String> args = new LinkedList<String>(); 92 this.scriptEngine.eval("save = " + this.save);93 91 this.invocable.invokeFunction("save", (Object)args); 94 92 return args.toArray(new String[0]); 95 } catch(NullPointerException e) {96 // caused when a null list is returned97 return null;98 93 } catch (Exception e) { 99 94 e.printStackTrace();
Note:
See TracChangeset
for help on using the changeset viewer.