Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--plugins/uml/nattable/org.eclipse.papyrus.uml.nattable/src/org/eclipse/papyrus/uml/nattable/manager/axis/AbstractStereotypedElementUMLSynchronizedOnFeatureAxisManager.java16
-rw-r--r--plugins/uml/nattable/org.eclipse.papyrus.uml.nattable/src/org/eclipse/papyrus/uml/nattable/utils/UMLTableUtils.java40
2 files changed, 35 insertions, 21 deletions
diff --git a/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable/src/org/eclipse/papyrus/uml/nattable/manager/axis/AbstractStereotypedElementUMLSynchronizedOnFeatureAxisManager.java b/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable/src/org/eclipse/papyrus/uml/nattable/manager/axis/AbstractStereotypedElementUMLSynchronizedOnFeatureAxisManager.java
index 98e92c34f1c..90aa7d2de67 100644
--- a/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable/src/org/eclipse/papyrus/uml/nattable/manager/axis/AbstractStereotypedElementUMLSynchronizedOnFeatureAxisManager.java
+++ b/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable/src/org/eclipse/papyrus/uml/nattable/manager/axis/AbstractStereotypedElementUMLSynchronizedOnFeatureAxisManager.java
@@ -9,7 +9,7 @@
*
* Contributors:
* Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
- * Nicolas FAUVERGUE (ALL4TEC) nicolas.fauvergue@all4tec.net - Bug 439501
+ * Nicolas FAUVERGUE (ALL4TEC) nicolas.fauvergue@all4tec.net - Bug 439501, 499007
*
*****************************************************************************/
package org.eclipse.papyrus.uml.nattable.manager.axis;
@@ -18,6 +18,7 @@ import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
+import java.util.HashSet;
import java.util.List;
import java.util.Map;
@@ -56,6 +57,11 @@ public abstract class AbstractStereotypedElementUMLSynchronizedOnFeatureAxisMana
* the map between the stereotypes applications and the base_element
*/
protected Map<EObject, Element> stereotypedElementsMap;
+
+ /**
+ * The list of resources listened.
+ */
+ protected Collection<Resource> listenedResources;
/**
@@ -109,7 +115,11 @@ public abstract class AbstractStereotypedElementUMLSynchronizedOnFeatureAxisMana
* @return
*/
protected Collection<Resource> getResourceToListen() {
- return Collections.singleton(getTableContext().eResource());
+ if(null == this.listenedResources){
+ this.listenedResources = new HashSet<Resource>();
+ this.listenedResources.add(getTableContext().eResource());
+ }
+ return this.listenedResources;
}
/**
@@ -385,6 +395,8 @@ public abstract class AbstractStereotypedElementUMLSynchronizedOnFeatureAxisMana
@Override
public void dispose() {
super.dispose();
+ this.listenedResources.clear();
+ this.listenedResources = null;
this.listenerMap.clear();
this.stereotypedElementsMap.clear();
}
diff --git a/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable/src/org/eclipse/papyrus/uml/nattable/utils/UMLTableUtils.java b/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable/src/org/eclipse/papyrus/uml/nattable/utils/UMLTableUtils.java
index 4323ef05494..b18dd0ce960 100644
--- a/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable/src/org/eclipse/papyrus/uml/nattable/utils/UMLTableUtils.java
+++ b/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable/src/org/eclipse/papyrus/uml/nattable/utils/UMLTableUtils.java
@@ -102,28 +102,30 @@ public class UMLTableUtils {
// Bug 435417 : Search the properties by their qualified name instead of search by its stereotypes first
// This allows to manage the inherit properties and the stereotypes in packages
- final Iterator<Profile> appliedProfilesIterator = element.getNearestPackage().getAllAppliedProfiles().iterator();
- while(appliedProfilesIterator.hasNext() && null == result){
- final Profile appliedProfile = appliedProfilesIterator.next();
-
- // Bug 488082 : Loop on all stereotypes (check in sub packages)
- final Iterator<Stereotype> stereotypesIterator = StereotypeUtil.getAllStereotypes(appliedProfile).iterator();
- while(stereotypesIterator.hasNext() && null == result){
- final Stereotype ownedStereotype = stereotypesIterator.next();
- final Iterator<Property> propertiesIterator = ownedStereotype.getAllAttributes().iterator();
- while(propertiesIterator.hasNext() && null == result){
- final Property property = propertiesIterator.next();
- if(property.getQualifiedName().equals(propertyQN)){
- result = property;
+ if (null != element.getNearestPackage()){
+ final Iterator<Profile> appliedProfilesIterator = element.getNearestPackage().getAllAppliedProfiles().iterator();
+ while(appliedProfilesIterator.hasNext() && null == result){
+ final Profile appliedProfile = appliedProfilesIterator.next();
+
+ // Bug 488082 : Loop on all stereotypes (check in sub packages)
+ final Iterator<Stereotype> stereotypesIterator = StereotypeUtil.getAllStereotypes(appliedProfile).iterator();
+ while(stereotypesIterator.hasNext() && null == result){
+ final Stereotype ownedStereotype = stereotypesIterator.next();
+ final Iterator<Property> propertiesIterator = ownedStereotype.getAllAttributes().iterator();
+ while(propertiesIterator.hasNext() && null == result){
+ final Property property = propertiesIterator.next();
+ if(property.getQualifiedName().equals(propertyQN)){
+ result = property;
+ }
}
}
}
- }
-
- // 2. if not, the profile could be applied on a sub-package of the nearest package
- /* the table can show element which are not children of its context, so the profile could not be available in its context */
- if(null == result){
- result = getProperty(element.getNearestPackage().getNestedPackages(), propertyQN);
+
+ // 2. if not, the profile could be applied on a sub-package of the nearest package
+ /* the table can show element which are not children of its context, so the profile could not be available in its context */
+ if(null == result){
+ result = getProperty(element.getNearestPackage().getNestedPackages(), propertyQN);
+ }
}
}
return result;

Back to the top