Skip to content
Snippets Groups Projects
Commit 184cdc06 authored by Andreas Bayha's avatar Andreas Bayha
Browse files

Annotations: Ordering of entries reflects hierarchy

The AnnotationEntries in the annotations view are ordered according to
hierarchy and after that alphabetically now.

Issue-Ref: 4014
Issue-Url: https://af3-developer.fortiss.org/issues/4014


Signed-off-by: default avatarAndreas Bayha <bayha@fortiss.org>
parent 49cc3011
No related branches found
No related tags found
1 merge request!1254014
AnnotationEntry.java 50d8790560ed60ba534b9d84a42f985e8f3e92a4 YELLOW
AnnotationEntry.java 967e6c0eeb47165fcd175c23aa372f0d8385d406 YELLOW
AnnotationValueService.java 01fc46fb381854b16ce78779217ffc7c29036c14 GREEN
IAnnotationValueService.java 81ff274a7b2d4c58e7b8485db857eb83f99710d0 GREEN
......@@ -15,6 +15,8 @@
+--------------------------------------------------------------------------*/
package org.fortiss.tooling.base.annotation;
import static org.fortiss.tooling.kernel.utils.EcoreUtils.getModelElementLevel;
import java.util.ArrayList;
import java.util.List;
......@@ -236,6 +238,14 @@ public class AnnotationEntry implements Comparable<AnnotationEntry> {
public int compareTo(AnnotationEntry otherEntry) {
IModelElement otherModelElement = otherEntry.getModelElement();
IModelElement thisModelElement = this.getModelElement();
int thisLevel = getModelElementLevel(thisModelElement);
int otherLevel = getModelElementLevel(otherModelElement);
if(thisLevel != otherLevel) {
return ((Integer)thisLevel).compareTo(otherLevel);
}
if(thisModelElement instanceof INamedElement &&
otherModelElement instanceof INamedElement) {
INamedElement thisNamed = (INamedElement)thisModelElement;
......
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