GeeCON Prague 2014*
The moose likes IDEs, Version Control and other tools and the fly likes IElementChangedListener Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Engineering » IDEs, Version Control and other tools
Bookmark "IElementChangedListener" Watch "IElementChangedListener" New topic
Author

IElementChangedListener

Alexandru Popescu
Ranch Hand

Joined: Jul 12, 2004
Posts: 995
API:
An element changed listener receives notification of changes to Java elements
maintained by the Java model.


1. What kind of notifications this listener refers to?
2. What is the meaning of Java elements and Java model?

./pope


blog - InfoQ.com
Alexandru Popescu
Ranch Hand

Joined: Jul 12, 2004
Posts: 995
Can anybody point me at least to some piece of documentation about this?

10x in advance,
./pope
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24187
    
  34

These terms come from the JDT, the Java Development Tools. A Java project is represented internally by the JDT plugin as, more or less, a tree of "elements": packages, classes, members are all "Java elements." This tree is the "Java model". Changes occur to the model when you type, when a refactoring is done, etc. If you register an IElementChangedListener, it gets notified when any of these changes occur.


[Jess in Action][AskingGoodQuestions]
Eric Clayberg
author
Ranch Hand

Joined: Sep 24, 2004
Posts: 63
Can anybody point me at least to some piece of documentation about this?
The Eclipse system generates change events indicating, for example, the files and folders that have been added, modified, and removed during the course of an operation. The Java tools issue similar events covering the creation, modification and deletion of Java elements (methods, fields, types, etc.). Interested objects can subscribe to these events and take whatever action is necessary to keep themselves synchronized with Eclipse. We cover this in chapter 8 ("Resource Change Tracking") of our book.

API docs for all of the Eclipse APIs are available on the eclipse.org web site. See...IElementChangedListener


Eric Clayberg
Software Engineering Manager
Google
Alexandru Popescu
Ranch Hand

Joined: Jul 12, 2004
Posts: 995
Originally posted by Ernest Friedman-Hill:
These terms come from the JDT, the Java Development Tools. A Java project is represented internally by the JDT plugin as, more or less, a tree of "elements": packages, classes, members are all "Java elements." This tree is the "Java model". Changes occur to the model when you type, when a refactoring is done, etc. If you register an IElementChangedListener, it gets notified when any of these changes occur.


Exactly what I expected. Thanks Ernest and Eric. I have already read the API ;-). What is interesting is that the same event is triggered for resource changes (files, folders) and also for logical resources (methods, fields, imports).

./pope
 
GeeCON Prague 2014
 
subject: IElementChangedListener