Skip to main content



      Home
Home » Newcomers » Newcomers » What is the extension point to do something while Eclipse is starting
What is the extension point to do something while Eclipse is starting [message #270623] Tue, 05 May 2009 06:43 Go to next message
Eclipse UserFriend
Hi,

I am going to build my plugin, and I want to load some properties from
files when Eclipse is starting. I mean when we open Eclipse, we will see a
small window with Eclipse icon and Ganymede in the middle of our screen,
and we can see some plugins are loading during that time. I want my plugin
to do some loading during that time, not after the Eclipse has started
(the workbench is shown).
I have tried org.eclipse.ui.startup and
org.eclipse.core.runtime.preferences, but they are not what I need. Those
extension points will be called after Eclipse starts. So is there any
extension point which could do something while Eclipse is starting?
Thank you.
Re: What is the extension point to do something while Eclipse is starting [message #270624 is a reply to message #270623] Tue, 05 May 2009 06:54 Go to previous messageGo to next message
Eclipse UserFriend
Aaron,

I'm curious what difference it makes as long as what you need to do gets
done before it's needed in some visible way by something else that's
starting. I.e., what is the reason for this extreme eagerness? I'm not
sure there is a way to achieve that, but the point is that even if there
is a way, users generally like to have the actual window come up as
quickly as possible...


Aaron Yu wrote:
> Hi,
>
> I am going to build my plugin, and I want to load some properties from
> files when Eclipse is starting. I mean when we open Eclipse, we will
> see a small window with Eclipse icon and Ganymede in the middle of our
> screen, and we can see some plugins are loading during that time. I
> want my plugin to do some loading during that time, not after the
> Eclipse has started (the workbench is shown).
> I have tried org.eclipse.ui.startup and
> org.eclipse.core.runtime.preferences, but they are not what I need.
> Those extension points will be called after Eclipse starts. So is
> there any extension point which could do something while Eclipse is
> starting?
> Thank you.
>
Re: What is the extension point to do something while Eclipse is starting [message #270626 is a reply to message #270624] Tue, 05 May 2009 07:28 Go to previous messageGo to next message
Eclipse UserFriend
Hi Ed,

Thank you for replying to me.
The reason why I need this is that, I am going to load the properties from
a very slow file system, so it will take a long time to finish the job. If
the loading is not completed, my plugin can not be used. I want my plugin
to be completely initiated during Eclipse is starting, so after getting
the workbench, I can use my plugin, though it will take a long to start
Eclipse. However, it seems that I can not achieve this...
Anyway, thank you very much.


Ed Merks wrote:

> Aaron,

> I'm curious what difference it makes as long as what you need to do gets
> done before it's needed in some visible way by something else that's
> starting. I.e., what is the reason for this extreme eagerness? I'm not
> sure there is a way to achieve that, but the point is that even if there
> is a way, users generally like to have the actual window come up as
> quickly as possible...


> Aaron Yu wrote:
>> Hi,
>>
>> I am going to build my plugin, and I want to load some properties from
>> files when Eclipse is starting. I mean when we open Eclipse, we will
>> see a small window with Eclipse icon and Ganymede in the middle of our
>> screen, and we can see some plugins are loading during that time. I
>> want my plugin to do some loading during that time, not after the
>> Eclipse has started (the workbench is shown).
>> I have tried org.eclipse.ui.startup and
>> org.eclipse.core.runtime.preferences, but they are not what I need.
>> Those extension points will be called after Eclipse starts. So is
>> there any extension point which could do something while Eclipse is
>> starting?
>> Thank you.
>>
Re: What is the extension point to do something while Eclipse is starting [message #270630 is a reply to message #270626] Tue, 05 May 2009 08:50 Go to previous messageGo to next message
Eclipse UserFriend
Aaron,

Comments below.

Aaron Yu wrote:
> Hi Ed,
>
> Thank you for replying to me.
> The reason why I need this is that, I am going to load the properties
> from a very slow file system, so it will take a long time to finish
> the job.
That sounds like an argument for deferring it, not for doing it early.
Have you ever noticed for example that before you can use JDT, it goes
into an Initializing Java Tooling phase?
> If the loading is not completed, my plugin can not be used.
So when your plugin is needed ought to be when you start the
initialization...
> I want my plugin to be completely initiated during Eclipse is
> starting, so after getting the workbench, I can use my plugin, though
> it will take a long to start Eclipse.
I still don't get it. Everything seems to argue that you should defer
this long running thing until first it's needed rather than to slow down
everything just for it.
> However, it seems that I can not achieve this...
So far it's not even clear that an early start plugin is needed let
along something earlier than that. And yes, I'm not sure it's possible
even.
> Anyway, thank you very much.
>
>
> Ed Merks wrote:
>
>> Aaron,
>
>> I'm curious what difference it makes as long as what you need to do
>> gets done before it's needed in some visible way by something else
>> that's starting. I.e., what is the reason for this extreme
>> eagerness? I'm not sure there is a way to achieve that, but the
>> point is that even if there is a way, users generally like to have
>> the actual window come up as quickly as possible...
>
>
>> Aaron Yu wrote:
>>> Hi,
>>>
>>> I am going to build my plugin, and I want to load some properties
>>> from files when Eclipse is starting. I mean when we open Eclipse, we
>>> will see a small window with Eclipse icon and Ganymede in the middle
>>> of our screen, and we can see some plugins are loading during that
>>> time. I want my plugin to do some loading during that time, not
>>> after the Eclipse has started (the workbench is shown).
>>> I have tried org.eclipse.ui.startup and
>>> org.eclipse.core.runtime.preferences, but they are not what I need.
>>> Those extension points will be called after Eclipse starts. So is
>>> there any extension point which could do something while Eclipse is
>>> starting?
>>> Thank you.
>>>
>
>
Re: What is the extension point to do something while Eclipse is starting [message #270663 is a reply to message #270630] Tue, 05 May 2009 22:20 Go to previous messageGo to next message
Eclipse UserFriend
Hi Ed,

I think I have to refactory my plugin. I've noticed the JDT and the
Initializing Java Tooling phase, but I am not sure how to put some work
into that phase. Could you give me some references or suggestions about
that?
Thank you.


Ed Merks wrote:

> Aaron,

> Comments below.

> Aaron Yu wrote:
>> Hi Ed,
>>
>> Thank you for replying to me.
>> The reason why I need this is that, I am going to load the properties
>> from a very slow file system, so it will take a long time to finish
>> the job.
> That sounds like an argument for deferring it, not for doing it early.
> Have you ever noticed for example that before you can use JDT, it goes
> into an Initializing Java Tooling phase?
>> If the loading is not completed, my plugin can not be used.
> So when your plugin is needed ought to be when you start the
> initialization...
>> I want my plugin to be completely initiated during Eclipse is
>> starting, so after getting the workbench, I can use my plugin, though
>> it will take a long to start Eclipse.
> I still don't get it. Everything seems to argue that you should defer
> this long running thing until first it's needed rather than to slow down
> everything just for it.
>> However, it seems that I can not achieve this...
> So far it's not even clear that an early start plugin is needed let
> along something earlier than that. And yes, I'm not sure it's possible
> even.
>> Anyway, thank you very much.
>>
>>
>> Ed Merks wrote:
>>
>>> Aaron,
>>
>>> I'm curious what difference it makes as long as what you need to do
>>> gets done before it's needed in some visible way by something else
>>> that's starting. I.e., what is the reason for this extreme
>>> eagerness? I'm not sure there is a way to achieve that, but the
>>> point is that even if there is a way, users generally like to have
>>> the actual window come up as quickly as possible...
>>
>>
>>> Aaron Yu wrote:
>>>> Hi,
>>>>
>>>> I am going to build my plugin, and I want to load some properties
>>>> from files when Eclipse is starting. I mean when we open Eclipse, we
>>>> will see a small window with Eclipse icon and Ganymede in the middle
>>>> of our screen, and we can see some plugins are loading during that
>>>> time. I want my plugin to do some loading during that time, not
>>>> after the Eclipse has started (the workbench is shown).
>>>> I have tried org.eclipse.ui.startup and
>>>> org.eclipse.core.runtime.preferences, but they are not what I need.
>>>> Those extension points will be called after Eclipse starts. So is
>>>> there any extension point which could do something while Eclipse is
>>>> starting?
>>>> Thank you.
>>>>
>>
>>
Re: What is the extension point to do something while Eclipse is starting [message #270665 is a reply to message #270663] Wed, 06 May 2009 09:41 Go to previous messageGo to next message
Eclipse UserFriend
Aaron,

I think they use Jobs for that. I'm not sure...


Aaron Yu wrote:
> Hi Ed,
>
> I think I have to refactory my plugin. I've noticed the JDT and the
> Initializing Java Tooling phase, but I am not sure how to put some
> work into that phase. Could you give me some references or suggestions
> about that?
> Thank you.
>
>
> Ed Merks wrote:
>
>> Aaron,
>
>> Comments below.
>
>> Aaron Yu wrote:
>>> Hi Ed,
>>>
>>> Thank you for replying to me.
>>> The reason why I need this is that, I am going to load the
>>> properties from a very slow file system, so it will take a long time
>>> to finish the job.
>> That sounds like an argument for deferring it, not for doing it
>> early. Have you ever noticed for example that before you can use
>> JDT, it goes into an Initializing Java Tooling phase?
>>> If the loading is not completed, my plugin can not be used.
>> So when your plugin is needed ought to be when you start the
>> initialization...
>>> I want my plugin to be completely initiated during Eclipse is
>>> starting, so after getting the workbench, I can use my plugin,
>>> though it will take a long to start Eclipse.
>> I still don't get it. Everything seems to argue that you should
>> defer this long running thing until first it's needed rather than to
>> slow down everything just for it.
>>> However, it seems that I can not achieve this...
>> So far it's not even clear that an early start plugin is needed let
>> along something earlier than that. And yes, I'm not sure it's
>> possible even.
>>> Anyway, thank you very much.
>>>
>>>
>>> Ed Merks wrote:
>>>
>>>> Aaron,
>>>
>>>> I'm curious what difference it makes as long as what you need to do
>>>> gets done before it's needed in some visible way by something else
>>>> that's starting. I.e., what is the reason for this extreme
>>>> eagerness? I'm not sure there is a way to achieve that, but the
>>>> point is that even if there is a way, users generally like to have
>>>> the actual window come up as quickly as possible...
>>>
>>>
>>>> Aaron Yu wrote:
>>>>> Hi,
>>>>>
>>>>> I am going to build my plugin, and I want to load some properties
>>>>> from files when Eclipse is starting. I mean when we open Eclipse,
>>>>> we will see a small window with Eclipse icon and Ganymede in the
>>>>> middle of our screen, and we can see some plugins are loading
>>>>> during that time. I want my plugin to do some loading during that
>>>>> time, not after the Eclipse has started (the workbench is shown).
>>>>> I have tried org.eclipse.ui.startup and
>>>>> org.eclipse.core.runtime.preferences, but they are not what I
>>>>> need. Those extension points will be called after Eclipse starts.
>>>>> So is there any extension point which could do something while
>>>>> Eclipse is starting?
>>>>> Thank you.
>>>>>
>>>
>>>
>
>
Re: What is the extension point to do something while Eclipse is starting [message #270666 is a reply to message #270663] Wed, 06 May 2009 11:13 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: eclipse-news.rizzoweb.com

Aaron Yu wrote:
> Hi Ed,
>
> I think I have to refactory my plugin. I've noticed the JDT and the
> Initializing Java Tooling phase, but I am not sure how to put some work
> into that phase. Could you give me some references or suggestions about
> that?
> Thank you.

I'm pretty sure the JDT plugins initiate Jobs from their start() method,
which is what Ed has been recommending you do (do your initialization
only when your plug-in is started, not any earlier).

Hope this helps,
Eric


> Ed Merks wrote:
>
>> Aaron,
>
>> Comments below.
>
>> Aaron Yu wrote:
>>> Hi Ed,
>>>
>>> Thank you for replying to me.
>>> The reason why I need this is that, I am going to load the properties
>>> from a very slow file system, so it will take a long time to finish
>>> the job.
>> That sounds like an argument for deferring it, not for doing it
>> early. Have you ever noticed for example that before you can use JDT,
>> it goes into an Initializing Java Tooling phase?
>>> If the loading is not completed, my plugin can not be used.
>> So when your plugin is needed ought to be when you start the
>> initialization...
>>> I want my plugin to be completely initiated during Eclipse is
>>> starting, so after getting the workbench, I can use my plugin, though
>>> it will take a long to start Eclipse.
>> I still don't get it. Everything seems to argue that you should defer
>> this long running thing until first it's needed rather than to slow
>> down everything just for it.
>>> However, it seems that I can not achieve this...
>> So far it's not even clear that an early start plugin is needed let
>> along something earlier than that. And yes, I'm not sure it's
>> possible even.
>>> Anyway, thank you very much.
>>>
>>>
>>> Ed Merks wrote:
>>>
>>>> Aaron,
>>>
>>>> I'm curious what difference it makes as long as what you need to do
>>>> gets done before it's needed in some visible way by something else
>>>> that's starting. I.e., what is the reason for this extreme
>>>> eagerness? I'm not sure there is a way to achieve that, but the
>>>> point is that even if there is a way, users generally like to have
>>>> the actual window come up as quickly as possible...
>>>
>>>
>>>> Aaron Yu wrote:
>>>>> Hi,
>>>>>
>>>>> I am going to build my plugin, and I want to load some properties
>>>>> from files when Eclipse is starting. I mean when we open Eclipse,
>>>>> we will see a small window with Eclipse icon and Ganymede in the
>>>>> middle of our screen, and we can see some plugins are loading
>>>>> during that time. I want my plugin to do some loading during that
>>>>> time, not after the Eclipse has started (the workbench is shown).
>>>>> I have tried org.eclipse.ui.startup and
>>>>> org.eclipse.core.runtime.preferences, but they are not what I need.
>>>>> Those extension points will be called after Eclipse starts. So is
>>>>> there any extension point which could do something while Eclipse is
>>>>> starting?
>>>>> Thank you.
>>>>>
>>>
>>>
>
>
Re: What is the extension point to do something while Eclipse is starting [message #270667 is a reply to message #270666] Wed, 06 May 2009 11:33 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: eclipse-news.rizzoweb.com

Eric Rizzo wrote:
> Aaron Yu wrote:
>> Hi Ed,
>>
>> I think I have to refactory my plugin. I've noticed the JDT and the
>> Initializing Java Tooling phase, but I am not sure how to put some
>> work into that phase. Could you give me some references or suggestions
>> about that?
>> Thank you.
>
> I'm pretty sure the JDT plugins initiate Jobs from their start() method,
> which is what Ed has been recommending you do (do your initialization
> only when your plug-in is started, not any earlier).

For reference, look at
org.eclipse.jdt.internal.ui.JavaPlugin.start(BundleContext) (that is the
Activator class for the org.eclipse.jdt.ui plug-in).
That method does a lot of things, one of which is create an instance of
a InitializeAfterLoadJob that does the work of initialization. This is
the pattern most plug-ins should follow when they need to do lengthy
initialization when they are activated.

Eric



>> Ed Merks wrote:
>>
>>> Aaron,
>>
>>> Comments below.
>>
>>> Aaron Yu wrote:
>>>> Hi Ed,
>>>>
>>>> Thank you for replying to me.
>>>> The reason why I need this is that, I am going to load the
>>>> properties from a very slow file system, so it will take a long time
>>>> to finish the job.
>>> That sounds like an argument for deferring it, not for doing it
>>> early. Have you ever noticed for example that before you can use
>>> JDT, it goes into an Initializing Java Tooling phase?
>>>> If the loading is not completed, my plugin can not be used.
>>> So when your plugin is needed ought to be when you start the
>>> initialization...
>>>> I want my plugin to be completely initiated during Eclipse is
>>>> starting, so after getting the workbench, I can use my plugin,
>>>> though it will take a long to start Eclipse.
>>> I still don't get it. Everything seems to argue that you should
>>> defer this long running thing until first it's needed rather than to
>>> slow down everything just for it.
>>>> However, it seems that I can not achieve this...
>>> So far it's not even clear that an early start plugin is needed let
>>> along something earlier than that. And yes, I'm not sure it's
>>> possible even.
>>>> Anyway, thank you very much.
>>>>
>>>>
>>>> Ed Merks wrote:
>>>>
>>>>> Aaron,
>>>>
>>>>> I'm curious what difference it makes as long as what you need to do
>>>>> gets done before it's needed in some visible way by something else
>>>>> that's starting. I.e., what is the reason for this extreme
>>>>> eagerness? I'm not sure there is a way to achieve that, but the
>>>>> point is that even if there is a way, users generally like to have
>>>>> the actual window come up as quickly as possible...
>>>>
>>>>
>>>>> Aaron Yu wrote:
>>>>>> Hi,
>>>>>>
>>>>>> I am going to build my plugin, and I want to load some properties
>>>>>> from files when Eclipse is starting. I mean when we open Eclipse,
>>>>>> we will see a small window with Eclipse icon and Ganymede in the
>>>>>> middle of our screen, and we can see some plugins are loading
>>>>>> during that time. I want my plugin to do some loading during that
>>>>>> time, not after the Eclipse has started (the workbench is shown).
>>>>>> I have tried org.eclipse.ui.startup and
>>>>>> org.eclipse.core.runtime.preferences, but they are not what I
>>>>>> need. Those extension points will be called after Eclipse starts.
>>>>>> So is there any extension point which could do something while
>>>>>> Eclipse is starting?
>>>>>> Thank you.
>>>>>>
>>>>
>>>>
>>
>>
Re: What is the extension point to do something while Eclipse is starting [message #270668 is a reply to message #270626] Wed, 06 May 2009 11:35 Go to previous messageGo to next message
Eclipse UserFriend
"Aaron Yu" <fan.yu@morganstanley.com> wrote in message
news:8639eeb40d83b075412024aff74c3a41$1@www.eclipse.org...
> Hi Ed,
>
> Thank you for replying to me.
> The reason why I need this is that, I am going to load the properties from
> a very slow file system, so it will take a long time to finish the job. If
> the loading is not completed, my plugin can not be used. I want my plugin
> to be completely initiated during Eclipse is starting, so after getting
> the workbench, I can use my plugin, though it will take a long to start
> Eclipse. However, it seems that I can not achieve this...

I don't think there is any way within Eclipse to do it any earlier than the
early start extension, and even that is highly discouraged for products that
are going to be used by the general public.

The reason it's discouraged is that every early-start plugin causes a
performance impact for every user who has it installed, even if they are
working in a workspace that does not use any of your plugin's functionality.
For instance, if I installed your plugin just to check it out in a test
workspace, then from then on I would have slow startup performance in all my
normal workspaces even though I wasn't using your features.

However, if this is for a proprietary product (I'm just guessing based on
your email URL) then you might want to look into modifying the Eclipse
launcher (it's a C program that then launches the Java Eclipse process), to
fork a separate process to copy the properties locally. Your plugin could
then launch a Job in its start() method, to wait till it sees the files
appear locally. Or, you could write a script to do the same thing, and
launch Eclipse with the script.

I'm interested in this "very slow file system." Are you able to divulge
more about that? Even if there's nothing that can be done right now, new
use cases are always interesting to learn about and can help direct future
thinking.
Re: What is the extension point to do something while Eclipse is starting [message #270678 is a reply to message #270667] Wed, 06 May 2009 23:19 Go to previous message
Eclipse UserFriend
Hi Eric,

Thank you, I will take a look at that code.

Eric Rizzo wrote:

> Eric Rizzo wrote:
>> Aaron Yu wrote:
>>> Hi Ed,
>>>
>>> I think I have to refactory my plugin. I've noticed the JDT and the
>>> Initializing Java Tooling phase, but I am not sure how to put some
>>> work into that phase. Could you give me some references or suggestions
>>> about that?
>>> Thank you.
>>
>> I'm pretty sure the JDT plugins initiate Jobs from their start() method,
>> which is what Ed has been recommending you do (do your initialization
>> only when your plug-in is started, not any earlier).

> For reference, look at
> org.eclipse.jdt.internal.ui.JavaPlugin.start(BundleContext) (that is the
> Activator class for the org.eclipse.jdt.ui plug-in).
> That method does a lot of things, one of which is create an instance of
> a InitializeAfterLoadJob that does the work of initialization. This is
> the pattern most plug-ins should follow when they need to do lengthy
> initialization when they are activated.

> Eric



>>> Ed Merks wrote:
>>>
>>>> Aaron,
>>>
>>>> Comments below.
>>>
>>>> Aaron Yu wrote:
>>>>> Hi Ed,
>>>>>
>>>>> Thank you for replying to me.
>>>>> The reason why I need this is that, I am going to load the
>>>>> properties from a very slow file system, so it will take a long time
>>>>> to finish the job.
>>>> That sounds like an argument for deferring it, not for doing it
>>>> early. Have you ever noticed for example that before you can use
>>>> JDT, it goes into an Initializing Java Tooling phase?
>>>>> If the loading is not completed, my plugin can not be used.
>>>> So when your plugin is needed ought to be when you start the
>>>> initialization...
>>>>> I want my plugin to be completely initiated during Eclipse is
>>>>> starting, so after getting the workbench, I can use my plugin,
>>>>> though it will take a long to start Eclipse.
>>>> I still don't get it. Everything seems to argue that you should
>>>> defer this long running thing until first it's needed rather than to
>>>> slow down everything just for it.
>>>>> However, it seems that I can not achieve this...
>>>> So far it's not even clear that an early start plugin is needed let
>>>> along something earlier than that. And yes, I'm not sure it's
>>>> possible even.
>>>>> Anyway, thank you very much.
>>>>>
>>>>>
>>>>> Ed Merks wrote:
>>>>>
>>>>>> Aaron,
>>>>>
>>>>>> I'm curious what difference it makes as long as what you need to do
>>>>>> gets done before it's needed in some visible way by something else
>>>>>> that's starting. I.e., what is the reason for this extreme
>>>>>> eagerness? I'm not sure there is a way to achieve that, but the
>>>>>> point is that even if there is a way, users generally like to have
>>>>>> the actual window come up as quickly as possible...
>>>>>
>>>>>
>>>>>> Aaron Yu wrote:
>>>>>>> Hi,
>>>>>>>
>>>>>>> I am going to build my plugin, and I want to load some properties
>>>>>>> from files when Eclipse is starting. I mean when we open Eclipse,
>>>>>>> we will see a small window with Eclipse icon and Ganymede in the
>>>>>>> middle of our screen, and we can see some plugins are loading
>>>>>>> during that time. I want my plugin to do some loading during that
>>>>>>> time, not after the Eclipse has started (the workbench is shown).
>>>>>>> I have tried org.eclipse.ui.startup and
>>>>>>> org.eclipse.core.runtime.preferences, but they are not what I
>>>>>>> need. Those extension points will be called after Eclipse starts.
>>>>>>> So is there any extension point which could do something while
>>>>>>> Eclipse is starting?
>>>>>>> Thank you.
>>>>>>>
>>>>>
>>>>>
>>>
>>>
Previous Topic:Get soft-tabs to work like actual tabs.
Next Topic:64 bit Windows Eclipse Modeling Package
Goto Forum:
  


Current Time: Wed Jun 18 12:33:16 EDT 2025

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

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

Back to the top