Skip to content
Snippets Groups Projects
Commit 6b728409 authored by Simon Barner's avatar Simon Barner
Browse files

- Ensure that the annotation view is updated when switching between multiple...

- Ensure that the annotation view is updated when switching between multiple projects by fixing a bug in the EAdapter registration
refs 2236
parent 0baf2155
No related branches found
No related tags found
No related merge requests found
......@@ -229,19 +229,22 @@ public abstract class AnnotationViewPartBase extends ViewPart implements ISelect
lastAnnotationEntriesMap.put(rootElement, annotationEntries);
}
// If required, do change listener registration
if(watchedElement == null) {
watchedElement = rootElement;
while(watchedElement.eContainer() != null) {
watchedElement = watchedElement.eContainer();
}
// If required, update change listener registration
EObject newWatchedElement = rootElement;
while(newWatchedElement.eContainer() != null) {
newWatchedElement = newWatchedElement.eContainer();
}
if(watchedElement != newWatchedElement) {
if(watchedElement != null) {
watchedElement.eAdapters().remove(changeListener);
}
watchedElement = newWatchedElement;
watchedElement.eAdapters().add(changeListener);
}
// Update the view
update(annotationEntries);
}
/** Update concrete view */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment