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

EStructuralFeatureValueProviderBase(EClass annotatedSpecificationEClass)

- If there is only one EStructuralFeature in the annotation's EClass, registered it with the DEFAULT_KEY
- This results in a more readable column heading (which is exactly the String returned by the user-supplied implementation of getAnnotationName(), instead of "<user-supplied String> : <EStructuralFeature name>"
refs 1841
parent a4c7cd65
No related branches found
No related tags found
No related merge requests found
......@@ -23,6 +23,7 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EAttribute;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EClassifier;
......@@ -121,10 +122,19 @@ public abstract class EStructuralFeatureValueProviderBase<T extends IAnnotatedSp
structuralFeatureMap = new HashMap<String, EStructuralFeature>();
for(EStructuralFeature structuralFeature : (inheritedFeatures
? annotatedSpecificationEClass.getEAllStructuralFeatures()
: annotatedSpecificationEClass.getEStructuralFeatures())) {
structuralFeatureMap.put(structuralFeature.getName(), structuralFeature);
EList<EStructuralFeature> featureList;
if(inheritedFeatures) {
featureList = annotatedSpecificationEClass.getEAllStructuralFeatures();
} else {
featureList = annotatedSpecificationEClass.getEStructuralFeatures();
}
if(featureList.size() == 1) {
structuralFeatureMap.put(DEFAULT_KEY, featureList.get(0));
} else {
for(EStructuralFeature structuralFeature : featureList) {
structuralFeatureMap.put(structuralFeature.getName(), structuralFeature);
}
}
handlesMultipleEstructuralFeatures = true;
......
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