Bug 90315 - Create UserLibraries programmatically
Summary: Create UserLibraries programmatically
Status: RESOLVED WORKSFORME
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.0.1   Edit
Hardware: PC Windows 2000
: P3 enhancement (vote)
Target Milestone: 3.1 M7   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-04-05 12:38 EDT by Philippe Krief CLA
Modified: 2005-04-06 09:45 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Philippe Krief CLA 2005-04-05 12:38:42 EDT
Hi,
As it is possible to create programmatically Classpath variables, it would be 
interesting to be able to create programmatically User Libraries.

Instead of Classpath Container, the User Libraries provide simple description 
of a set of libraries which is enough in several common cases...

In my understanding, it will consist in opening the APIs of the 
org.eclipse.jdt.internal.core.UserLibraryManager class.
Btw, one is already accessible when we call:
   org.eclipse.jdt.core.JavaCore.getUserLibraryNames();

Thanks for your understanding
kind regards
Philippe
Comment 1 Philipe Mulet CLA 2005-04-05 15:04:45 EDT
Our API got frozen for 3.1 at the end of M6. 

How would you imagine creating such a library programmatically ? i.e. what would
it buy you as opposed to simply declaring a container ? There is no need to tie
a container with an initializer if you do not need it. Are you expecting
persistence across sessions ?
Comment 2 Philippe Krief CLA 2005-04-06 03:49:53 EDT
"Programmatically" means, for example, during a Plugin startup like we do for a 
classpath variable by using the extension 
org.eclipse.jdt.core.classpathVariableInitializer.

Let me give you a concrete example. When a developer wants to use the P3ML 
framework, he needs to add in his classpath at least 5 jars if it runs against 
the jclMAX: exml.zip, sax2API.zip, dom2API.zip, p3ml-kernel.zip, p3ml-swt.zip.
The few classpath containers that I checked (btw, it would be useful to have a 
nice tutorial explaining how to define a class container and the associated UIs 
to reference and edit it!) are based on the principle that the content of the 
container can change depending on the context.
For P3ML it is not the case; these jars are located in their respective plugin. 
So once the plugin is installed, we are able to define in the workbench the 
path to the different jars...

As far as I understand the classpathVariableInitializer extension point, we are 
in the situation the only difference comes from the fact that with a classpath 
you can only reference 1 jar or one folder. With a UserLibrary you can 
reference a set of jars... 

Does it make sense?
Philippe
Comment 3 Philipe Mulet CLA 2005-04-06 09:45:33 EDT
Existing APIs are just fined as discussed with reporter.
However, we could consider better documenting this area.