Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » Open project notification when plugin isn't loaded
Open project notification when plugin isn't loaded [message #299433] Thu, 16 February 2006 16:22 Go to next message
Eclipse UserFriend
Hi,

I need to detect when project with certain nature is opened. I've read
disscusions about this so I know I need to use IResourceChangeListener and
use earlyStartup for case that project is opened while my plugin is not
loaded.

This approach has some disadvantages - loading of my plugin will slow down
Eclipse start and earlyStartup can be switched off.

While going through the newsgroups I've found out that quite many people
need the Open project notification. So I think it's worthy to define new
extension point dealing with this.

It can work like this: there would be extension point allowing to define
nature and class implementing some interface. When project with the nature
would be opened, some method of the class would be called.

Do you think this is a good idea and I should post it bugzilla? Or is
there some other possibility how to solve my problem?

--
Jiri
Re: Open project notification when plugin isn't loaded [message #299529 is a reply to message #299433] Mon, 20 February 2006 07:43 Go to previous messageGo to next message
Eclipse UserFriend
I have no comment on the content (although it doesn't sound like a bad
idea), but it's important that you open an enhancement request in
bugzilla anyway. Describe your usecase, perhaps some advantage to this
feature, and then post the bug number to the newsgroup.

They only other thing I'll mention is that sometimes you want to use the
org.eclipse.ui.startup extension to setup listeners, so on notification
you can call into your main functionality. If you do go this route,
please make sure that the startup plugin is small and has no
dependancies on your main plugin ... or you will force eager startup of
all of your plugins, and that's bad.

Later,
PW
Re: Open project notification when plugin isn't loaded [message #299559 is a reply to message #299433] Mon, 20 February 2006 11:31 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: john.eclipsefaq.org

You should really try to avoid activating your plugin just when a
project with a certain nature is opened. Do you think your plugin
*really* needs to be activated at that point? The user has just opened
the project, they haven't specifically requested anything of your plugin
at that point. I recommend looking into ISaveParticipant as a way of
finding out the resource change delta for things that occurred before
your plugin was activated. See the "Save participants" section in this
article for details:

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

jt wrote:
> Hi,
>
> I need to detect when project with certain nature is opened. I've read
> disscusions about this so I know I need to use IResourceChangeListener
> and use earlyStartup for case that project is opened while my plugin is
> not loaded.
>
> This approach has some disadvantages - loading of my plugin will slow
> down Eclipse start and earlyStartup can be switched off.
>
> While going through the newsgroups I've found out that quite many people
> need the Open project notification. So I think it's worthy to define new
> extension point dealing with this.
>
> It can work like this: there would be extension point allowing to define
> nature and class implementing some interface. When project with the
> nature would be opened, some method of the class would be called.
>
> Do you think this is a good idea and I should post it bugzilla? Or is
> there some other possibility how to solve my problem?
>
> --
> Jiri
>
Re: Open project notification when plugin isn't loaded [message #299584 is a reply to message #299559] Mon, 20 February 2006 15:08 Go to previous messageGo to next message
Eclipse UserFriend
Hi,

I need to activate plugin when project with is opened, because I add some
virtual files to project. Concretely, project is a view to database,
different db objects are reprezented by virtual files.

I know that much better would be if I put some layer between tree in
Navigator and local file system, so that I can provide virtual files only
when requested.

I was looking hard for something like that, but I didn't find anything, so
I just add virtual files when project is opened or when reload is
requested. Does Eclipse provide some better way?

--
Jiri
Re: Open project notification when plugin isn't loaded [message #299586 is a reply to message #299584] Mon, 20 February 2006 17:33 Go to previous message
Eclipse UserFriend
Originally posted by: john.eclipsefaq.org

Well, it turns out that in Eclipse 3.2 an API has been added to do
exactly that. The org.eclipse.core.filesystem plugin has an extension
point where you can register a provider for your virtual file system.
Then, a project can be created with a URI associated with your file
system. This gives you complete control over how that project interacts
with the file system, allowing you to insert a complete virtual file
system, or even augment the local file system with extra virtual files.
If your plugin is the file system provider for a project, it will be
loaded automatically whenever that project needs to access its file
system (which occurs on project open).
--

jt wrote:
> Hi,
>
> I need to activate plugin when project with is opened, because I add
> some virtual files to project. Concretely, project is a view to
> database, different db objects are reprezented by virtual files.
>
> I know that much better would be if I put some layer between tree in
> Navigator and local file system, so that I can provide virtual files
> only when requested.
> I was looking hard for something like that, but I didn't find anything,
> so I just add virtual files when project is opened or when reload is
> requested. Does Eclipse provide some better way?
>
> --
> Jiri
>
Previous Topic:Error log view support
Next Topic:Content Assist - long hang
Goto Forum:
  


Current Time: Wed Jul 23 16:59:51 EDT 2025

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

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

Back to the top