Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Suppressing lazy loading of a plugin?
Suppressing lazy loading of a plugin? [message #331044] Thu, 21 August 2008 21:48 Go to next message
Eclipse UserFriend
Originally posted by: nick.allen.onlinehome.de

Hi,

I would like to add a resource change listener to the workspace when
Eclipse starts. This is of course relatively straight forward. The
problem is that my plugin is not instantiated until the user uses one of
its features (eg selecting a menu item). This is far too late - I need
my plugin to be automatically started when Eclipse starts up.

How do I do that?

Thanks,

Nick
Re: Suppressing lazy loading of a plugin? [message #331045 is a reply to message #331044] Thu, 21 August 2008 21:52 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: nick.allen.onlinehome.de

I'm becoming a master of answering my own questions! It looks like I
just need to change Eclipse-LazyStart to false in MANIFEST.MF.

Nick

Nicholas Allen wrote:
> Hi,
>
> I would like to add a resource change listener to the workspace when
> Eclipse starts. This is of course relatively straight forward. The
> problem is that my plugin is not instantiated until the user uses one of
> its features (eg selecting a menu item). This is far too late - I need
> my plugin to be automatically started when Eclipse starts up.
>
> How do I do that?
>
> Thanks,
>
> Nick
Re: Suppressing lazy loading of a plugin? [message #331046 is a reply to message #331045] Thu, 21 August 2008 22:01 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: richkulp.us.NO_SPAM.ibm.com

BUT don't do it! It is very expensive. Many plugins think they need this
and then it really slows down the startup.

Instead use the Save Participant interface instead.

See

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

Nicholas Allen wrote:
> I'm becoming a master of answering my own questions! It looks like I
> just need to change Eclipse-LazyStart to false in MANIFEST.MF.
>


--
Thanks,
Rich Kulp
Re: Suppressing lazy loading of a plugin? [message #331047 is a reply to message #331046] Thu, 21 August 2008 22:22 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: nick.allen.onlinehome.de

Ok - but my plugin is tiny (currently 30kb). Will it really be that slow?

Also, if I understood correctly I can only register a save participant
once my plugin is loaded - right? Once I register I get a backlog of
changes sent to me that may have happened a long time ago. If I am
correct in this assumption then this will not work for what I want. Let
me know if I am mistaken - I am still extremely new to Eclipse.

Cheers,

Nick

Rich Kulp wrote:
> BUT don't do it! It is very expensive. Many plugins think they need this
> and then it really slows down the startup.
>
> Instead use the Save Participant interface instead.
>
> See
>
> http://www.eclipse.org/articles/Article-Resource-deltas/reso urce-deltas.html
>
>
> Nicholas Allen wrote:
>> I'm becoming a master of answering my own questions! It looks like I
>> just need to change Eclipse-LazyStart to false in MANIFEST.MF.
>>
>
>
Re: Suppressing lazy loading of a plugin? [message #331048 is a reply to message #331045] Thu, 21 August 2008 22:30 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: nick.allen.onlinehome.de

Nicholas Allen wrote:
> I'm becoming a master of answering my own questions! It looks like I
> just need to change Eclipse-LazyStart to false in MANIFEST.MF.

Actually, it seems I need to use the org.eclipse.startup extension point
to achieve this. Eclipse-LazyStart false means my plugin never starts...

Nick
Re: Suppressing lazy loading of a plugin? [message #331063 is a reply to message #331047] Fri, 22 August 2008 12:54 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: richkulp.us.NO_SPAM.ibm.com

You are one small plugin, but they all add up.

Why can't you respond once your plugin is activated. Why do you need to
listen to the resources immediately? What would you do right away that
couldn't be done later when your plugin is finally activated?

Nicholas Allen wrote:
> Ok - but my plugin is tiny (currently 30kb). Will it really be that slow?
>
> Also, if I understood correctly I can only register a save participant
> once my plugin is loaded - right? Once I register I get a backlog of
> changes sent to me that may have happened a long time ago. If I am
> correct in this assumption then this will not work for what I want. Let
> me know if I am mistaken - I am still extremely new to Eclipse.
>
> Cheers,
>
> Nick
>
> Rich Kulp wrote:
>> BUT don't do it! It is very expensive. Many plugins think they need this
>> and then it really slows down the startup.
>>
>> Instead use the Save Participant interface instead.
>>
>> See
>>
>> http://www.eclipse.org/articles/Article-Resource-deltas/reso urce-deltas.html
>>
>>
>> Nicholas Allen wrote:
>>> I'm becoming a master of answering my own questions! It looks like I
>>> just need to change Eclipse-LazyStart to false in MANIFEST.MF.
>>>
>>

--
Thanks,
Rich Kulp
Re: Suppressing lazy loading of a plugin? [message #331081 is a reply to message #331063] Sat, 23 August 2008 16:00 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: nick.allen.onlinehome.de

I am writing a plug-in for the Bazaar version control system. If the
user renames a file (eg by renaming a class) I need to tell Bazaar that
the file has been moved as soon (or shortly after) that happens. If I
have not added a listener when Eclipse starts then I will not hear about
any file moves until the user uses one of my menu commands. This could
be hours (or even days) later - I can't see how this could ever work...

Nick
Re: Suppressing lazy loading of a plugin? [message #331083 is a reply to message #331081] Sun, 24 August 2008 06:22 Go to previous messageGo to next message
Prakash G.R. is currently offline Prakash G.R.Friend
Messages: 621
Registered: July 2009
Senior Member
Nick,

I might be wrong, but IMHO, if you are creating plugins for the version
control system, probably you should be hooking into the team api. Not
the IResouceChangeListener

- Prakash

www.eclipse-tips.com


Nicholas Allen wrote:
> I am writing a plug-in for the Bazaar version control system. If the
> user renames a file (eg by renaming a class) I need to tell Bazaar that
> the file has been moved as soon (or shortly after) that happens. If I
> have not added a listener when Eclipse starts then I will not hear about
> any file moves until the user uses one of my menu commands. This could
> be hours (or even days) later - I can't see how this could ever work...
>
> Nick
Re: Suppressing lazy loading of a plugin? [message #331084 is a reply to message #331083] Sun, 24 August 2008 12:49 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: nick.allen.onlinehome.de

AFAICT the Team API is not particularly good for distributed version
control systems. For example, it forces users to register the VCS for
each branch (my plug-in auto detects this). The Team stuff is much more
oriented towards centralized VCS. If it's possible to have rename
support without any configuration from the user (as is currently
possible in my plug-in) then I may consider using it instead. If it
requires the user to invoke Team/Share... from context menu for each
branch (which is what I think is required from my limited
investigations) then I definitely won't use it for rename support...

Nick

Prakash G.R. wrote:
> Nick,
>
> I might be wrong, but IMHO, if you are creating plugins for the
> version control system, probably you should be hooking into the team
> api. Not the IResouceChangeListener
>
> - Prakash
>
> www.eclipse-tips.com
>
>
> Nicholas Allen wrote:
>> I am writing a plug-in for the Bazaar version control system. If the
>> user renames a file (eg by renaming a class) I need to tell Bazaar that
>> the file has been moved as soon (or shortly after) that happens. If I
>> have not added a listener when Eclipse starts then I will not hear about
>> any file moves until the user uses one of my menu commands. This could
>> be hours (or even days) later - I can't see how this could ever work...
>>
>> Nick
Re: Suppressing lazy loading of a plugin? [message #331087 is a reply to message #331084] Sun, 24 August 2008 16:32 Go to previous messageGo to next message
Prakash G.R. is currently offline Prakash G.R.Friend
Messages: 621
Registered: July 2009
Senior Member
I never went thru the team api. But it should provide all the options
like comparing with different versions, replacing the content with a old
version, syncing up a tree etc. It appears that you are looking only for
Save operation?

- Prakash

www.blog.eclipse-tips.com


Nicholas Allen wrote:
> AFAICT the Team API is not particularly good for distributed version
> control systems. For example, it forces users to register the VCS for
> each branch (my plug-in auto detects this). The Team stuff is much more
> oriented towards centralized VCS. If it's possible to have rename
> support without any configuration from the user (as is currently
> possible in my plug-in) then I may consider using it instead. If it
> requires the user to invoke Team/Share... from context menu for each
> branch (which is what I think is required from my limited
> investigations) then I definitely won't use it for rename support...
>
> Nick
>
> Prakash G.R. wrote:
>> Nick,
>>
>> I might be wrong, but IMHO, if you are creating plugins for the
>> version control system, probably you should be hooking into the team
>> api. Not the IResouceChangeListener
>>
>> - Prakash
>>
>> www.eclipse-tips.com
>>
>>
>> Nicholas Allen wrote:
>>> I am writing a plug-in for the Bazaar version control system. If the
>>> user renames a file (eg by renaming a class) I need to tell Bazaar that
>>> the file has been moved as soon (or shortly after) that happens. If I
>>> have not added a listener when Eclipse starts then I will not hear about
>>> any file moves until the user uses one of my menu commands. This could
>>> be hours (or even days) later - I can't see how this could ever work...
>>>
>>> Nick
Re: Suppressing lazy loading of a plugin? [message #331225 is a reply to message #331048] Thu, 28 August 2008 14:33 Go to previous message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

Nicholas Allen wrote:
> Nicholas Allen wrote:
>> I'm becoming a master of answering my own questions! It looks like I
>> just need to change Eclipse-LazyStart to false in MANIFEST.MF.
>
> Actually, it seems I need to use the org.eclipse.startup extension point
> to achieve this. Eclipse-LazyStart false means my plugin never starts...

Right, lazystart (and now autostart) is about automatically activating
the plugin when the first resource/class is loaded from it (as opposed
to manually requesting a start from the OSGi framework).

As for the other suggestions ... don't use org.eclipse.ui.startup!

OK, that being said, there is a cost once a plugin is started, the
framework feels free to load any and all resources (especially UI
resources).

The solution ... a lib/core plugin that uses org.eclipse.ui.startup to
add your resource listener, but contains little beyond your core data
model and contains no UI.

The second plugin that contains your UI and most of your functionality
can then work normally, and you will have minimized both the memory cost
and the performance cost for your early startup.

--
Paul Webster
http://wiki.eclipse.org/Platform_Command_Framework
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Menu_Contributions
http://wiki.eclipse.org/Menus_Extension_Mapping
http://help.eclipse.org/help33/index.jsp?topic=/org.eclipse. platform.doc.isv/guide/workbench.htm


Previous Topic:How to get notified when Eclipse renames or deletes a file in the workspace?
Next Topic:Undoable Operation Not Working
Goto Forum:
  


Current Time: Wed Jul 03 17:26:42 GMT 2024

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

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

Back to the top