| java.lang.Object fr.aliacom.commands.Command fr.aliacom.commands.ASyncCommand fr.aliacom.commands.PythonCommand
PythonCommand | class PythonCommand extends ASyncCommand (Code) | | Instances of PythonCommand execute execute python script
with jython.
author: tom author: (c) 2001, 2003 Thomas Cataldo |
PythonCommand | public PythonCommand(IForm form, String script, FormContext ctx)(Code) | | Create a python command that will execute a python script.
The script is loaded from the script repository provided by the
running
fr.aliacom.form.common.IApplication .
When this script is executed, all the
fr.aliacom.form.common.FormVariable defined in the given context will apear as real python variables.
A special variable named FORM is automagically added the python
variables before execution. It will referenced the
IForm instance passed
to this constructor.
A variable named LOG is also added. This is a reference to
a log4j logger.
You should notice that (f.getFormContext() == ctx) might be false. Thanks to this,
sub-parts of the UI (tabs,...) can be created dynamically from XML without poluting
the FormContext of the main window. Consider 2 tabs in the main window
with a textfield in each tab, created from the same XML file. The XML contains
something like <textField id="myText"/> . When a PythonCommand
linked to a button in the tab is executed, you clearly want it to refer to the
correct TextField.
Parameters: form - the form referenced by the FORM variable in the script. Parameters: script - the script to execute, loaded by an fr.aliacom.form.storage.IScriptRepository. Parameters: ctx - the variables defined when the script is executed |
getForm | public IForm getForm()(Code) | | Method getForm.
IForm |
setForm | public void setForm(IForm form)(Code) | | Parameters: form - |
|
|