Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » Activate plugin during startup
Activate plugin during startup [message #327382] Wed, 16 April 2008 18:54 Go to next message
Eclipse UserFriend
Hi,

I'm creating a plugin that I want to run when Eclipse starts up. I found
the extension org.eclipse.ui.startup, but it has been deprecated. What is
the "new" way to do this in 3.3?

Thanks,
Roshan
Re: Activate plugin during startup [message #327384 is a reply to message #327382] Wed, 16 April 2008 23:28 Go to previous messageGo to next message
Eclipse UserFriend
Hi Roshan,

This extension in general is not deprecated (as far as I know). I think
what you are referring to is this:

"If the extension does not provide a class as an attribute on the startup
element, the plug-in's activator (plug-in class) must implement
org.eclipse.ui.IStartup. Note that this form is deprecated and should no
longer be used. Its functioning relies on the availability of the
org.eclipse.core.runtime.compatibility plug-in and the
org.eclipse.core.runtime.compatibility.registry fragment."

I think all this means is that not specifying a class that implements
IStartup at all, and relying on your plug-in's activator to be called (if
it implements IStartup) in this case is deprecated. Is this what you are
referring to?

Mark.


On Wed, 16 Apr 2008 18:54:10 -0400, Roshan Soni <roshan.soni1@gmail.com>
wrote:

> Hi, I'm creating a plugin that I want to run when Eclipse starts up. I
> found the extension org.eclipse.ui.startup, but it has been deprecated.
> What is the "new" way to do this in 3.3?
>
> Thanks,
> Roshan
>
Re: Activate plugin during startup [message #327394 is a reply to message #327384] Thu, 17 April 2008 09:46 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: richkulp.us.NO_SPAM.ibm.com

By the way, please be careful and do not use IStartUp unless truly
absolutely necessary. Eclipse is based upon the lazy-load mechanism
because if everyone tried to activate at startup then bringing up a
workbench or RCP would crawl to a stop. There are usually other ways to
handle things so that you don't need to be activated at startup.

For example this article though old contains much information that would
get rid of the need to start up immediately:

http://www.eclipse.org/articles/Article-Resource-deltas/reso urce-deltas.html

See the section on Save Participants if the reason you need to start up
immediately is so that you can listen to resource changes and do things
upon them. The Save Participants allows you to catch up later when you
actually do activate to any changes that have occurred since the last
time you were listening.


--
Thanks,
Rich Kulp
Re: Activate plugin during startup [message #327395 is a reply to message #327384] Thu, 17 April 2008 10:10 Go to previous messageGo to next message
Eclipse UserFriend
Thanks Mark, that was what I am referring to, I guess when I read it now
it does make sense that they are just deprecating the usage of that form
and not the class.

Rich, I took a look at the article you pointed out and the last thing I
want to do is startup a plugin at Eclipse startup, but I'm creating a sort
of client server app that needs to run on Eclipse startup and receive
messages from my client. My server app then accesses the UI and changes
the perspective, opens a specific editor w/data from my DB, etc... If you
have any suggestion on a better way for doing something like that, then
I'm all ears.

Thanks,
Roshan
Re: Activate plugin during startup [message #327403 is a reply to message #327395] Thu, 17 April 2008 12:32 Go to previous messageGo to next message
Eclipse UserFriend
"Roshan Soni" <roshan.soni1@gmail.com> wrote in message
news:e04078fe9ba1790c6642e0bb6c7bfbf9$1@www.eclipse.org...
> Thanks Mark, that was what I am referring to, I guess when I read it now
> it does make sense that they are just deprecating the usage of that form
> and not the class.
>
> Rich, I took a look at the article you pointed out and the last thing I
> want to do is startup a plugin at Eclipse startup, but I'm creating a sort
> of client server app that needs to run on Eclipse startup and receive
> messages from my client. My server app then accesses the UI and changes
> the perspective, opens a specific editor w/data from my DB, etc... If you
> have any suggestion on a better way for doing something like that, then
> I'm all ears.


One Eclipse install will often be used in multiple ways: e.g., in one
workspace I'm interested in J2EE projects, but in another perhaps I'm just
using it as a fancy XML editor, and in another I'm doing C++.

So the question you want to ask yourself is "should your functionality be
loaded in each of those cases", that is, if someone has installed your
plug-in into Eclipse should they be forced to use it whenever they use
Eclipse regardless of workspace or task.

If the answer is "yes", then loading at startup is appropriate. If the
answer is "no", then the next question is what the real trigger should be -
for instance, is it when a workspace containing projects with a particular
nature is opened.

You may be able to do a two-tier approach where you have a very small
plug-in that loads at startup and serves only to watch for events that would
provoke it to load the larger plug-in.
Re: Activate plugin during startup [message #327406 is a reply to message #327403] Thu, 17 April 2008 14:44 Go to previous message
Eclipse UserFriend
You make a very good point, I myself have 20 or so workspaces that I use
for different types of programming. As far as I know my plugin just sits
there and doesn't take up noticeable memory. One solution could be to
create a preference page to only start this plugin if the setting is
true.
Previous Topic:multi-threading an IncrementalProjectBuilder??
Next Topic:How to associate one or more content types based on something other than filename (URL protocol++)
Goto Forum:
  


Current Time: Tue Apr 15 05:54:29 EDT 2025

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

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

Back to the top