UPDATED: RSA for a better brdige with Sirius
diff --git a/plugins/org.eclipse.emf.eef.runtime/src/org/eclipse/emf/eef/runtime/api/notify/ResourceSetAdapter.java b/plugins/org.eclipse.emf.eef.runtime/src/org/eclipse/emf/eef/runtime/api/notify/ResourceSetAdapter.java
index d6454e8..69bc12a 100644
--- a/plugins/org.eclipse.emf.eef.runtime/src/org/eclipse/emf/eef/runtime/api/notify/ResourceSetAdapter.java
+++ b/plugins/org.eclipse.emf.eef.runtime/src/org/eclipse/emf/eef/runtime/api/notify/ResourceSetAdapter.java
@@ -53,6 +53,11 @@
eStructuralFeatureListeners = new HashMap<EStructuralFeature, List<PropertiesEditingSemanticListener>>();
}
+ @Override
+ public boolean isAdapterForType(Object type) {
+ return type == ResourceSetAdapter.class || ResourceSetAdapter.class.getName().equals(type);
+ }
+
/**
* Activates the resource set adapter.
*/
@@ -132,10 +137,21 @@
* the listener to remove
*/
public void removeEditingSemanticListener(PropertiesEditingSemanticListener listener) {
+ unregisterEditingSemanticListener(listener);
+
+ // if there are no listeners left we remove the adapter
+ if (eClassifierListeners.size() + eStructuralFeatureListeners.size() == 0)
+ deactivate();
+ }
+
+ /**
+ * Unregisters the given listener
+ * @param listener {@link PropertiesEditingSemanticListener} to unregister.
+ */
+ public void unregisterEditingSemanticListener(PropertiesEditingSemanticListener listener) {
for (NotificationFilter filter : listener.getFilters()) {
if (filter instanceof EStructuralFeatureNotificationFilter) {
- for (EStructuralFeature feature : ((EStructuralFeatureNotificationFilter)filter)
- .getFeatures()) {
+ for (EStructuralFeature feature : ((EStructuralFeatureNotificationFilter)filter).getFeatures()) {
removeEditingSemanticListener(feature, listener);
}
} else if (filter instanceof EClassifierNotificationFilter) {
@@ -144,10 +160,6 @@
}
}
}
-
- // if there are no listeners left we remove the adapter
- if (eClassifierListeners.size() + eStructuralFeatureListeners.size() == 0)
- deactivate();
}
/**
* Removes the given listener from the registered listeners.