Skip to main content



      Home
Home » Language IDEs » Java Development Tools (JDT) » Notification of nature additions/removals
Notification of nature additions/removals [message #173343] Sat, 14 August 2004 08:21 Go to next message
Eclipse UserFriend
Originally posted by: sangamon.t-online.de

Hi,

I would like to show a representation of all projects with a specific
nature in a separate view. How can I receive notifications of nature
additions and removals?

I've tried to hook into (de)configure. This seems to work for the
creation of projects (or adding the nature to existing ones), however,
when I delete a project, the nature's deconfigure() doesn't seem to be
called.

Any hints?

Regards,
Patrick
Re: Notification of nature additions/removals [message #173422 is a reply to message #173343] Mon, 16 August 2004 11:21 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: richkulp.NO.SPAM.us.ibm.com

deconfigure is only called when a nature is removed from a project.
Deleting the project doesn't cause deconfiguration. configure isn't
called on creation of project either. It is only called when a nature is
added to a project after it has been created. The purpose of configure
and deconfigure is to update the project, e.g. add/remove builders. If a
project is being deleted there is no need to deconfigure since the
project is going away. And if the project is created with a nature
already then there is no need for configure because it is assumed that
whatever created the project already configured it correctly for the nature.

As to your question, sorry but there is no direct notification of nature
addition or removal directly. However you can retrieve notification that
the project's description was changed. This would be sent when you added
or removed a nature (because the nature ids are stored in the project's
description), though there are other reasons to send this event too. See
IResourceDelta.DESCRIPTION


--
Thanks, Rich Kulp

Re: Notification of nature additions/removals [message #173453 is a reply to message #173422] Mon, 16 August 2004 12:16 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: sangamon.t-online.de

Rich Kulp wrote:

> deconfigure is only called when a nature is removed from a project.
> Deleting the project doesn't cause deconfiguration. configure isn't
> called on creation of project either. It is only called when a nature is
> added to a project after it has been created. The purpose of configure
> and deconfigure is to update the project, e.g. add/remove builders. If a
> project is being deleted there is no need to deconfigure since the
> project is going away. And if the project is created with a nature
> already then there is no need for configure because it is assumed that
> whatever created the project already configured it correctly for the nature.
>
> As to your question, sorry but there is no direct notification of nature
> addition or removal directly. However you can retrieve notification that
> the project's description was changed. This would be sent when you added
> or removed a nature (because the nature ids are stored in the project's
> description), though there are other reasons to send this event too. See
> IResourceDelta.DESCRIPTION

Thanks for your explanation. I hadn't seen the DESCRIPTION delta yet - I
guess my create/add trigger should go into a resource listener then
instead of the nature's configure().

For project deletion, however, this doesn't help. At the moment I'm
using a hack that remembers projects that contain the given nature on
PRE_DELETE and updates my view on POST_DELETE for remembered projects.
Quite ugly, but it seems to work. Any better idea is still appreciated.

Regards,
Patrick
Re: Notification of nature additions/removals [message #173461 is a reply to message #173453] Mon, 16 August 2004 14:07 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: richkulp.NO.SPAM.us.ibm.com

Well, on deletion, shouldn't the "project" in your view go away? So your
resource listener (which by the way could be the same listener that is
listening for description changes) when it receives a PRE_DELETE for a
project that you have in your view should have that project removed from
your view.

--
Thanks, Rich Kulp

Re: Notification of nature additions/removals [message #173505 is a reply to message #173461] Mon, 16 August 2004 16:40 Go to previous message
Eclipse UserFriend
Originally posted by: sangamon.t-online.de

Rich Kulp wrote:

> Well, on deletion, shouldn't the "project" in your view go away? So your
> resource listener (which by the way could be the same listener that is
> listening for description changes) when it receives a PRE_DELETE for a
> project that you have in your view should have that project removed from
> your view.

I'll have to change some things to make it work that way, but that
sounds definitely better than my current setup. I'll give it a try.
Thanks, again.

Regards,
Patrick
Previous Topic:Determining accessibility of IMembers
Next Topic:EclipseClassLoader info
Goto Forum:
  


Current Time: Sat Jul 26 20:09:43 EDT 2025

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

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

Back to the top