Skip to main content



      Home
Home » Language IDEs » ServerTools (WTP) » Add per compilation unit global variables to JSDT
Add per compilation unit global variables to JSDT [message #224792] Mon, 08 December 2008 15:45
Eclipse UserFriend
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: Wed Jul 02 11:22:19 EDT 2025

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

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

Back to the top