Not having found a documentation or references as how javax.script scripting 
languages get employed
in JavaFX, I was wondering whether there is an up-to-date, current 
documentation of that support, if
any at all?

E.g. it seems that it is not possible to have different scripting engines 
execute event handlers for
the same document (there seems to be no type-attribute or language-attribute 
available that denotes
the scripting language to use to execute the code supplied in an 
event-attribute like onAction).

Or, at least in JavaFX 8, the filename is not supplied for external files, 
although it could be
supplied (and would be important for debugging) like the name the 
source-attribute of a fx:script
element (e.g. <fx:script source="somescriptfile.type"/>). [One would merely 
have to add an attribute
to the ScriptContext.ENGINE_SCOPE Bindings under the key ScriptEngine.FILENAME, 
ie.
"javax.script.filename".]

There would be more, maybe interesting features that javax.script defines that 
could be taken
advantage of (like defining arguments to supply in certain situations which 
would merely need to
employ the key ScriptEngine.ARGV, ie. "javax.script.argv" for the Object array 
to store in the
ScriptContext.ENGINE_SCOPE Bindings.

---rony

Reply via email to