Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » REPOST: How to load a plugin programatically?
REPOST: How to load a plugin programatically? [message #277186] Mon, 06 December 2004 10:15 Go to next message
Eclipse UserFriend
Originally posted by: reply.group.com

Hi,

How do I programatically load a plugin?
I would like to activate and load a plugin that is located at an external
location.
I would not like to use links folder as the plugin location might change
frequently.
I can get the plugin location using a runtime vm argument.
Is there any straight forward API that I can use to load a plugin using
parameters like plugin name and plugin location?

I would appreciate any suggestions.

Thanks
SJ
Re: REPOST: How to load a plugin programatically? [message #277225 is a reply to message #277186] Tue, 07 December 2004 02:57 Go to previous message
Eclipse UserFriend
Hi SJ

You can use the OSGI installBundle() and start() methods to it. You have to
get access the BundleContext. You get it when the plugin is started.

stefan


try {
URL url = new
URL(" http://localhost:8080/showcase/plugins/com.inventage.showcas e.extension
..test_1.0.0.jar");
URLConnection connection = url.openConnection();
BundleContext context =
PlatformPlugin.getDefault().getBundleContext();
Bundle bundle =
context.installBundle("com.inventage.showcase.extension.test ",
connection.getInputStream());
bundle.start();
}
catch (BundleException e) {
e.printStackTrace();
}
catch (MalformedURLException e) {
e.printStackTrace();
}
catch (IOException e) {
e.printStackTrace();
}



Am 6.12.2004 16:15 Uhr schrieb "SJ" unter <reply@group.com> in
cp1t2h$fr9$1@www.eclipse.org:

> Hi,
>
> How do I programatically load a plugin?
> I would like to activate and load a plugin that is located at an external
> location.
> I would not like to use links folder as the plugin location might change
> frequently.
> I can get the plugin location using a runtime vm argument.
> Is there any straight forward API that I can use to load a plugin using
> parameters like plugin name and plugin location?
>
> I would appreciate any suggestions.
>
> Thanks
> SJ
>
>
Previous Topic:FormEditor and SectionPart
Next Topic:Keyboard Listener
Goto Forum:
  


Current Time: Tue Jun 03 06:39:03 EDT 2025

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

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

Back to the top