Hi Matthias,

Check out the
org.eclipse.wst.jsdt.web.core.internal.project.JsWebNature.java  class in
the org.eclipse.wst.jsdt.web.core. plugin.  It's doing almost exactly what
you've described.  JsWebNature is the helper class that performs JSDT setup
on dynamic/static web projects.

Thanks,
Brad Childs

IBM Software Group
Emerging Internet Technology / Browser Technology Center


                                                                       
             Matthias Kempka                                           
             <[EMAIL PROTECTED]                                         
             ct.com>                                                    To
             Sent by:                  "General discussion of project-wide
             [EMAIL PROTECTED]         or architectural issues."       
             clipse.org                <[email protected]>           
                                                                        cc
                                                                       
             05/13/2008 10:26                                      Subject
             AM                        [wtp-dev] Programmatically setting
                                       up projects for JSDT            
                                                                       
             Please respond to                                         
                 "General                                              
               discussion of                                           
              project-wide or                                          
               architectural                                           
                 issues."                                              
             <[EMAIL PROTECTED]                                         
                   org>                                                
                                                                       
                                                                       




I have problems with setting up JSDT projects programmatically.
Currently, I'm adding libraries to the include path using this code:

     IJavaScriptProject jp = JavaScriptCore.create( project );
     List<IIncludePathEntry> cp = new ArrayList<IIncludePathEntry>();
     cp.add( JavaScriptCore.newSourceEntry( project.getFullPath() ) );

cp
.add
( JavaScriptCore
.newContainerEntry( JavaRuntime.newDefaultJREContainerPath() ) );
     cp.add( JavaScriptCore.newContainerEntry( new
Path( "org.eclipse.wst.jsdt.USER_LIBRARY/myQx" ),
                                               false ) );
     IPath outputLocation = project.getFolder( "bin" ).getFullPath();
     jp.setRawIncludepath( cp.toArray( new
IIncludePathEntry[ cp.size() ] ),
                           outputLocation,
                           monitor );

However, I don't see how to add an existing system library.
Specifically, I'd like to add the ECMA 3 library to my include path
for a testcase for bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=231809
But trying to add a library entry using new
Path( "org.eclipse.wst.jsdt.launching.baseBrowserLibrary" ) in any of
the static methods JavaScriptCore provides failed so far.

I've also tried to just copy the .settings/ directory from an existing
project to my newly created project, then refresh and reread it, but
without success.

Are there some API calls that I can call to create a web based
Javascript project?

Regards,
Matthias
--
Dipl.-Inform. Matthias Kempka
Innoopract Informationssysteme GmbH
[EMAIL PROTECTED]
Tel:  0721 - 66 47 33 - 0
Fax: 0721 - 66 47 33 29
========================= Legal Disclaimer =====================
According to Section 80 of the German Corporation Act
Innoopract Informationssysteme GmbH must indicate the following
information:
Address: Stephanienstrasse 20, 76133 Karlsruhe Germany
General Manager: Jochen Krause, Eric von der Heyden
Registered Office: Karlsruhe, Commercial Register Karlsruhe HRB 7883
============================================================





_______________________________________________
wtp-dev mailing list
[email protected]
https://dev.eclipse.org/mailman/listinfo/wtp-dev

<<inline: graycol.gif>>

<<inline: pic18427.gif>>

<<inline: ecblank.gif>>

_______________________________________________
wtp-dev mailing list
[email protected]
https://dev.eclipse.org/mailman/listinfo/wtp-dev

Reply via email to