Acsess projects in workspace from plugin [message #327492] |
Tue, 22 April 2008 10:06 |
Eclipse User |
|
|
|
Originally posted by: automatic.javalobby.org
Hi,
As part of the plugin we are developing, we need to add jars, folders and eclipse projects in workspace into our plugin classpath.
Please help me on how to add eclipse projects in workspace to our plugin classpath, or point me to the resources that help me acheive this.
Thank You,
dheer
|
|
|
Re: Acsess projects in workspace from plugin [message #327495 is a reply to message #327492] |
Tue, 22 April 2008 12:12 |
Eclipse User |
|
|
|
Originally posted by: merks.ca.ibm.com
dheer,
The only way to affect a plugin's classpath is to add dependencies in
its MANIFEST.MF to other plugins. So the only way is to modify the
MANIFEST.MF itself. This assumes the plugin you are talking about is
also a project in the workspace, because if it isn't, it's not possible
to modify its classpath. It's still possible to load classes from the
workspace, but you'd use techniques like a URLClassLoader for that...
reindheer wrote:
> Hi,
>
> As part of the plugin we are developing, we need to add jars, folders and eclipse projects in workspace into our plugin classpath.
>
> Please help me on how to add eclipse projects in workspace to our plugin classpath, or point me to the resources that help me acheive this.
>
> Thank You,
> dheer
>
|
|
|
Re: Acsess projects in workspace from plugin [message #327514 is a reply to message #327495] |
Wed, 23 April 2008 04:57 |
Eclipse User |
|
|
|
Originally posted by: automatic.javalobby.org
Hi,
Thank you for replying.
The plugin we are building is a diagnostic tool for an OODBMS. It helps in querying and browsing objects stored in the database. We display objects even if the class definition is not present using reflection.
However if the developer wants to include the project in the workspace(like we add projects, jars to the build path ) using preferences, is it possible using URLClassLoader.
From what you said it's not possible unless the plugin is in the workpsace too. Could you please confirm.
Any other way we could acheive this by adding the projects or jars to plugin classpath before eclipse is started?
Thank you,
dheer
|
|
|
Re: Acsess projects in workspace from plugin [message #327519 is a reply to message #327514] |
Wed, 23 April 2008 10:43 |
Eclipse User |
|
|
|
Originally posted by: merks.ca.ibm.com
Dheer,
Comments below.
reindheer wrote:
> Hi,
>
> Thank you for replying.
>
> The plugin we are building is a diagnostic tool for an OODBMS. It helps in querying and browsing objects stored in the database. We display objects even if the class definition is not present using reflection.
>
> However if the developer wants to include the project in the workspace(like we add projects, jars to the build path ) using preferences, is it possible using URLClassLoader.
>
You could have a look at how EMF's
org.eclipse.emf.codegen.jet.JETEmitter loads .class files from a project
compiled in the workspace using a URLClassLoader. It's dangerous to
load and run classes, so it's probably not a good approach...
> From what you said it's not possible unless the plugin is in the workpsace too. Could you please confirm.
>
A plugin's classpath is fixed and can't be changed at runtime (at least
as far as I know). Using buddy class loading, it's possible for a
plugin to load classes from plugins that depend on it, but generally,
without the buddy support, a plugin can only load classes from itself or
from plugins that it directly or indirectly depends on. In all cases, it
can only load classes from plugins installed in the running environment.
> Any other way we could acheive this by adding the projects or jars to plugin classpath before eclipse is started?
>
Yes. The Eclipse way would be to defined an extension point in your
plugin and to have others wishing to extend your plugin provide
additional plugins that use that extension point to provide whatever
additional capabilities are needed.
> Thank you,
> dheer
>
|
|
|
|
Powered by
FUDForum. Page generated in 0.04172 seconds