Skip to main content



      Home
Home » Language IDEs » Java Development Tools (JDT) » Pre-change listener?
Pre-change listener? [message #64378] Sun, 22 June 2003 08:28 Go to next message
Eclipse UserFriend
Hi,

I wonder if it is possible to get ElementChangedEvents (or something
equivalent) before a change to the JavaModel occurs. I suppose that
PRE_AUTO_BUILD events (as well as POST_CHANGE events) occur after the
change.

My problem is the following situation: When, for example, a class is deleted (along
with its methods), the ElementChangedEvent resp. the contained
IJavaElementDelta contains only the fact that the class itself was
deleted, but no information about its methods. But, since the class is no
longer existent, I cannot get any information about the methods that were
deleted. Is there any way to access that information? (Other than storing
a list of methods myself...)

Regards,
Simon
Re: Pre-change listener? [message #65146 is a reply to message #64378] Mon, 23 June 2003 07:24 Go to previous messageGo to next message
Eclipse UserFriend
Sorry Simon, but this is not currently possible. I doubt this would ever be
implemented, as this would require the Java model to parse every single
..java file to remember its structure in case it is deleted.

Jerome

"Simon Giesecke" <simon.giesecke@acm.org> wrote in message
news:pan.2003.06.22.12.28.24.300696@acm.org...
> Hi,
>
> I wonder if it is possible to get ElementChangedEvents (or something
> equivalent) before a change to the JavaModel occurs. I suppose that
> PRE_AUTO_BUILD events (as well as POST_CHANGE events) occur after the
> change.
>
> My problem is the following situation: When, for example, a class is
deleted (along
> with its methods), the ElementChangedEvent resp. the contained
> IJavaElementDelta contains only the fact that the class itself was
> deleted, but no information about its methods. But, since the class is no
> longer existent, I cannot get any information about the methods that were
> deleted. Is there any way to access that information? (Other than storing
> a list of methods myself...)
>
> Regards,
> Simon
>
Re: Pre-change listener? [message #65465 is a reply to message #65146] Mon, 23 June 2003 15:23 Go to previous messageGo to next message
Eclipse UserFriend
On Mon, 23 Jun 2003 13:24:47 +0200, Jerome Lanneluc wrote:

Jerome,

> Sorry Simon, but this is not currently possible.

ok... then I have to try to find another way to achieve that.

> I doubt this would ever be
> implemented, as this would require the Java model to parse every single
> .java file to remember its structure in case it is deleted.

I thought the JavaModel already stores the structure (down to method
level) for all classes? Or is there only a cache for some most recently
used classes/compilation units?

Another point: I know that there currently is no such ResourceChangeEvent,
but were it possible to introduce a PRE_CHANGE event that is fired before
a change is committed?

Regards,
Simon
Re: Pre-change listener? [message #65837 is a reply to message #65465] Tue, 24 June 2003 05:42 Go to previous message
Eclipse UserFriend
"Simon Giesecke" <simon.giesecke@acm.org> wrote in message
news:pan.2003.06.23.19.23.01.599222@acm.org...

> I thought the JavaModel already stores the structure (down to method
> level) for all classes? Or is there only a cache for some most recently
> used classes/compilation units?

No, the Java model doesn't stores the structure for all classes. As you
guessed, it does it only for the most recently used classes and compilation
units.

> Another point: I know that there currently is no such ResourceChangeEvent,
> but were it possible to introduce a PRE_CHANGE event that is fired before
> a change is committed?

Sorry I don't know the answer to this question. I would post it on the
eclipse.platform newsgroup where the Platform/Core team listens.

Jerome
Previous Topic:newbie question: how to use SAX in eclipse?
Next Topic:Eclipse extremely slow ro respond
Goto Forum:
  


Current Time: Thu May 08 07:06:24 EDT 2025

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

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

Back to the top