Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Web Tools Project (WTP) » Add per compilation unit global variables to JSDT
Add per compilation unit global variables to JSDT [message #224792] Mon, 08 December 2008 20:45
Sébastien MIGNIOT is currently offline Sébastien MIGNIOTFriend
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"
Previous Topic:Javascript editor pls do it something somebody :$
Next Topic:Jboss 5 GA - mail.jar
Goto Forum:
  


Current Time: Sun Dec 21 17:26:12 GMT 2014

Powered by FUDForum. Page generated in 0.02485 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software