Skip to main content



      Home
Home » Language IDEs » Java Development Tools (JDT) » 2 questions concerning ElementChangedEvent / IJavaElementDelta
2 questions concerning ElementChangedEvent / IJavaElementDelta [message #226535] Sun, 26 March 2006 12:39
Eclipse UserFriend
Originally posted by: fastfood.zedat.fu-berlin.de

hello *

i try to get information about changes to the java model and to the
source code.
i use an IElementChangedListener to get POST_RECONCILE events from the
java core.

my first question is, is it possible to get any information about the
source code change, for example, in a method body, at least where the
change took place(e.g. a handle for the IMethod)?

as long as there is a change to the model(e.g. add/delete of a field or
method), i can get deltas for the modified children by calling
event.getDelta().get...Children()
but in case of a fine grained change to the content(flags F_CONTENT +
F_FINE_GRAINED), there are no children at all.
its still possible to get all the methods(and their code) off the
effected compilation unit, but i can't tell what method changed.

i use a workaround where i keep the source code of all methods in a
separate place and compare the before/after state every time an event
occurs, but i don't like it tbh.
so, is there any other way to get this information, or should i maybe
just use another listener?

while developing the workaround i stumbled over another problem.
when an event indicates a remove or add of a method, the handle i get
from the delta
for the removed method is 'null'.
is there any possibility to get information about that removed element,
like the source code or declaration?

i'd really appreciate any answers to my questions, thanks in advance


mkranz
Previous Topic:Adding Rows by HSQL
Next Topic:How to add a local directory to the classpath?
Goto Forum:
  


Current Time: Sat Jul 26 00:47:59 EDT 2025

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

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

Back to the top