Loading de.ugoe.cs.swe.TTCN3.ui/src/de/ugoe/cs/swe/ui/labeling/TTCN3LabelProvider.xtend +15 −1 Original line number Diff line number Diff line Loading @@ -4,6 +4,7 @@ package de.ugoe.cs.swe.ui.labeling import com.google.inject.Inject import org.eclipse.emf.ecore.EObject /** * Provides labels for a EObjects. Loading @@ -17,6 +18,19 @@ class TTCN3LabelProvider extends org.eclipse.xtext.ui.label.DefaultEObjectLabelP super(delegate); } def text(EObject element) { var text = element.eClass.name val feature = element.eContainmentFeature if (feature !== null) { text = feature.name + " : " + text } val name = element.eClass.EAllAttributes.findFirst[name.equals("name")]; if (name !== null) text = text + " : " + element.eGet(name); return text; } // Labels and icons can be computed like this: // def text(Greeting ele) { Loading Loading
de.ugoe.cs.swe.TTCN3.ui/src/de/ugoe/cs/swe/ui/labeling/TTCN3LabelProvider.xtend +15 −1 Original line number Diff line number Diff line Loading @@ -4,6 +4,7 @@ package de.ugoe.cs.swe.ui.labeling import com.google.inject.Inject import org.eclipse.emf.ecore.EObject /** * Provides labels for a EObjects. Loading @@ -17,6 +18,19 @@ class TTCN3LabelProvider extends org.eclipse.xtext.ui.label.DefaultEObjectLabelP super(delegate); } def text(EObject element) { var text = element.eClass.name val feature = element.eContainmentFeature if (feature !== null) { text = feature.name + " : " + text } val name = element.eClass.EAllAttributes.findFirst[name.equals("name")]; if (name !== null) text = text + " : " + element.eGet(name); return text; } // Labels and icons can be computed like this: // def text(Greeting ele) { Loading