Add per compilation unit global variables to JSDT [message #224792] |
Mon, 08 December 2008 20:45 |
Sébastien MIGNIOT Messages: 1 Registered: July 2009 |
Junior Member |
|
|
Hi,
I'm extending the CompilationUnitEditor to enable
custom JavaScript source editing in my business
application.
In my app, *each* source can have its own global
variables, for instance the following source
'ShowCompany.js' is only executable when the variable
'company' has been set.
How can I add global variables *per source editor*
and not at the project level (using extension points
for libraries) in JSDT ?
How can I make them strongly typed (i.e. have a
prototype declaration for the 'company' global
variable) ?
Thx a lot,
Seb
PS1: Example 'ShowCompany.js' source :
var log = "";
var i;
log += "Company name: "+company.getName()+"\n";
for(i=0; i<company.getEmployeesCount(); i++) {
log += "\tEmployee["+i+"]: "+company.getEmployee(i).getName()+"\n";
}
alert(log);
PS2: we use rhino to execute those scripts and populate
"by hand" the rhino context. So each source has its "own"
global variables. But we know at edition time which one
should be recognized as "global", "for this source only"
|
|
|
Powered by
FUDForum. Page generated in 0.02980 seconds