Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'platform_specific/2019-12/org.eclipse.egf.emf.pattern/templates/pattern._03wVEGJ-Ed-FqczH3ESmRw/method._03wVG2J-Ed-FqczH3ESmRw.pt')
-rw-r--r--platform_specific/2019-12/org.eclipse.egf.emf.pattern/templates/pattern._03wVEGJ-Ed-FqczH3ESmRw/method._03wVG2J-Ed-FqczH3ESmRw.pt49
1 files changed, 49 insertions, 0 deletions
diff --git a/platform_specific/2019-12/org.eclipse.egf.emf.pattern/templates/pattern._03wVEGJ-Ed-FqczH3ESmRw/method._03wVG2J-Ed-FqczH3ESmRw.pt b/platform_specific/2019-12/org.eclipse.egf.emf.pattern/templates/pattern._03wVEGJ-Ed-FqczH3ESmRw/method._03wVG2J-Ed-FqczH3ESmRw.pt
new file mode 100644
index 000000000..1b4a9351b
--- /dev/null
+++ b/platform_specific/2019-12/org.eclipse.egf.emf.pattern/templates/pattern._03wVEGJ-Ed-FqczH3ESmRw/method._03wVG2J-Ed-FqczH3ESmRw.pt
@@ -0,0 +1,49 @@
+
+
+<%if (genModel.isStyleProviders()) {%>
+ return ((<%=genModel.getImportedName("org.eclipse.emf.edit.provider.StyledString")%>)getStyledText(object)).getString();
+<%} else {%>
+<%if (genClass.isMapEntry()) {%>
+ <%=genClass.getImportedInterfaceName()%><%if (genModel.useGenerics()) {%><?, ?><%}%> <%=genClass.getSafeUncapName()%> = (<%=genClass.getImportedInterfaceName()%><%if (genModel.useGenerics()) {%><?, ?><%}%>)object;
+ <%if (!genClass.getMapEntryKeyFeature().isPropertyMultiLine() && !genClass.getMapEntryValueFeature().isPropertyMultiLine()) {%>
+ return "" + <%=genClass.getSafeUncapName()%>.getKey() + " -> " + <%=genClass.getSafeUncapName()%>.getValue();<%=genModel.getNonNLS()%><%=genModel.getNonNLS(2)%>
+ <%} else {%>
+ <%if (genClass.getMapEntryKeyFeature().isPropertyMultiLine()) {%>
+ String key = crop("" + <%=genClass.getSafeUncapName()%>.getKey());<%=genModel.getNonNLS()%>
+ <%} else {%>
+ String key = "" + <%=genClass.getSafeUncapName()%>.getKey();<%=genModel.getNonNLS()%>
+ <%}%>
+ <%if (genClass.getMapEntryValueFeature().isPropertyMultiLine()) {%>
+ String value = crop("" + <%=genClass.getSafeUncapName()%>.getValue());<%=genModel.getNonNLS()%>
+ <%} else {%>
+ String value = "" + <%=genClass.getSafeUncapName()%>.getValue();<%=genModel.getNonNLS()%>
+ <%}%>
+ return key + " -> " + value;<%=genModel.getNonNLS()%>
+ <%}%>
+<%} else if (genClass.getLabelFeature() != null) { GenFeature labelFeature = genClass.getLabelFeature();%>
+ <%if (labelFeature.isPrimitiveType() && !labelFeature.getGenClass().isDynamic() && !labelFeature.isSuppressedGetVisibility()) {%>
+ <%=genClass.getImportedInterfaceName()%><%=genClass.getInterfaceWildTypeArguments()%> <%=genClass.getSafeUncapName()%> = (<%=genClass.getImportedInterfaceName()%><%=genClass.getInterfaceWildTypeArguments()%>)object;
+ return getString("_UI_<%=genClass.getName()%>_type") + " " + <%=genClass.getSafeUncapName()%>.<%=genClass.getLabelFeature().getGetAccessor()%>();<%=genModel.getNonNLS()%><%=genModel.getNonNLS(2)%>
+ <%} else {%>
+ <%if (labelFeature.isStringType() && !labelFeature.getGenClass().isDynamic() && !labelFeature.isSuppressedGetVisibility()) {%>
+ <%if (labelFeature.isPropertyMultiLine()) {%>
+ String label = crop(((<%=genClass.getImportedInterfaceName()%><%=genClass.getInterfaceWildTypeArguments()%>)object).<%=labelFeature.getGetAccessor()%>());
+ <%} else {%>
+ String label = ((<%=genClass.getImportedInterfaceName()%><%=genClass.getInterfaceWildTypeArguments()%>)object).<%=labelFeature.getGetAccessor()%>();
+ <%}%>
+ <%} else {%>
+ <%if (labelFeature.isSuppressedGetVisibility() || labelFeature.getGenClass().isDynamic()) {%>
+ <%=genModel.getImportedName("java.lang.Object")%> labelValue = ((<%=genModel.getImportedName("org.eclipse.emf.ecore.EObject")%>)object).eGet(<%=labelFeature.getQualifiedFeatureAccessor()%>);
+ <%} else {%>
+ <%=labelFeature.getRawImportedType()%> labelValue = ((<%=genClass.getImportedInterfaceName()%><%=genClass.getInterfaceWildTypeArguments()%>)object).<%=labelFeature.getGetAccessor()%>();
+ <%}%>
+ String label = labelValue == null ? null : labelValue.toString();
+ <%}%>
+ return label == null || label.length() == 0 ?
+ getString("_UI_<%=genClass.getName()%>_type") :<%=genModel.getNonNLS()%>
+ getString("_UI_<%=genClass.getName()%>_type") + " " + label;<%=genModel.getNonNLS()%><%=genModel.getNonNLS(2)%>
+ <%}%>
+<%} else {%>
+ return getString("_UI_<%=genClass.getName()%>_type");<%=genModel.getNonNLS()%>
+<%}%>
+<%}%>

Back to the top