refactor autowirehelper
Signed-off-by: Ralf Mollik <ramollik@compex-commerce.com>
diff --git a/jenkins.build.config.xml b/jenkins.build.config.xml
index fe069dd..175aff4 100644
--- a/jenkins.build.config.xml
+++ b/jenkins.build.config.xml
@@ -23,5 +23,6 @@
<jenkins.build.dependency>org.eclipse.osbp.runtime</jenkins.build.dependency>
<jenkins.build.dependency>org.eclipse.osbp.utils</jenkins.build.dependency>
<jenkins.build.dependency>org.eclipse.osbp.utils.functionnormalizer</jenkins.build.dependency>
+ <jenkins.build.dependency>org.eclipse.osbp.xtext.i18n</jenkins.build.dependency>
</jenkins.build.dependencies>
</jenkins>
diff --git a/org.eclipse.osbp.autowireHelper.feature/feature.xml b/org.eclipse.osbp.autowireHelper.feature/feature.xml
index 18ba215..192baab 100644
--- a/org.eclipse.osbp.autowireHelper.feature/feature.xml
+++ b/org.eclipse.osbp.autowireHelper.feature/feature.xml
@@ -17,7 +17,7 @@
label="%featureName"
version="0.9.0.qualifier"
provider-name="%providerName"
- plugin="org.eclipse.osbp.autowireHelper">
+ plugin="org.eclipse.osbp.license">
<description>
%description
diff --git a/org.eclipse.osbp.autowireHelper/META-INF/MANIFEST.MF b/org.eclipse.osbp.autowireHelper/META-INF/MANIFEST.MF
index 86a7f2d..eee58c5 100644
--- a/org.eclipse.osbp.autowireHelper/META-INF/MANIFEST.MF
+++ b/org.eclipse.osbp.autowireHelper/META-INF/MANIFEST.MF
@@ -31,7 +31,8 @@
org.eclipse.core.runtime;bundle-version="3.10.0",
org.eclipse.xtext.ui;bundle-version="[2.11.0,2.12.0)",
org.eclipse.osbp.ecview.extension.api;bundle-version="[0.9.0,0.10.0)",
- org.apache.commons.lang;bundle-version="2.6.0"
+ org.apache.commons.lang;bundle-version="2.6.0",
+ org.eclipse.osbp.xtext.i18n;bundle-version="0.9.0"
Export-Package: org.eclipse.osbp.autowirehelper;version="0.9.0",
org.eclipse.osbp.autowirehelper.utils;version="0.9.0"
Import-Package: javax.annotation,
diff --git a/org.eclipse.osbp.autowireHelper/src/org/eclipse/osbp/autowirehelper/AutowireHelper.xtend b/org.eclipse.osbp.autowireHelper/src/org/eclipse/osbp/autowirehelper/AutowireHelper.xtend
index 20fa870..18f24c0 100644
--- a/org.eclipse.osbp.autowireHelper/src/org/eclipse/osbp/autowirehelper/AutowireHelper.xtend
+++ b/org.eclipse.osbp.autowireHelper/src/org/eclipse/osbp/autowirehelper/AutowireHelper.xtend
@@ -100,6 +100,9 @@
import org.eclipse.osbp.runtime.common.layouting.IPropertyConstants
import org.eclipse.xtext.common.types.JvmField
import org.eclipse.osbp.runtime.common.annotations.TargetEnumConstraints
+import org.eclipse.osbp.runtime.common.annotations.UIGroup
+import org.eclipse.osbp.runtime.common.annotations.ExtraStyle
+import org.eclipse.osbp.xtext.i18n.I18NKeyGenerator
@SuppressWarnings("restriction")
class AutowireHelper implements IAutowireDelegate {
@@ -130,10 +133,6 @@
YBeanSlot yMainBeanslot
override autowire(UiLayout uiLayout, UiModelDerivedStateComputerx computer, boolean mobile) {
- if (!uiLayout.autowire) {
- return
- }
-
this.computer = computer;
this.mobile = mobile;
@@ -141,14 +140,8 @@
this.yLayout = computer.associatedUi(uiLayout)
this.yView = yLayout.view
this.yMainBeanslot = getBeanSlot(uiLayout)
- switch (uiLayout) {
- UiHorizontalLayout: {
- layouter = if(!mobile) new StrategyLayoutLayouter else new MobileLayouter
- layouter.setup(uiLayout, yLayout)
- }
- default:
- return
- }
+ layouter = new StrategyLayoutLayouter
+ layouter.setup(uiLayout, yLayout)
val BindableTypeResolver resolver = new BindableTypeResolver
var resolvedType = resolver.resolveType(uiLayout.autoWireSource)
@@ -163,9 +156,7 @@
// creates the a suspect structure based on the operation infos
sortedOpInfoMapList.createSuspectStructure(beanType, mobile, null)
-
}
-
}
/**
@@ -329,8 +320,11 @@
} else {
suspect = type.createBlopUploadComponent(it)
}
- } else if (it.domainReference) {
+ } else if (it.domainReference && !it.hidden) {
suspect = type.createBeanReferenceField(it)
+ if(it.readonly) {
+ suspect.tags.add(ILayoutingStrategy.TAG__READONLY)
+ }
} else if (it.field !== null && it.field.collection) {
if (it.asGrid) {
suspect = type.createGrid(it)
@@ -343,7 +337,12 @@
// mark groups
if (suspect !== null && it.isGroupMember) {
suspect.tags.add(ILayoutingStrategy.TAG__GROUP)
- suspect.groupName = it.groupMemberName
+ suspect.groupName = it.getAnnotationValue(typeof(UIGroup), 0)
+ }
+ // mark extra style
+ if (suspect !== null && it.hasExtraStyle) {
+ suspect.tags.add(ILayoutingStrategy.TAG__EXTRASTYLE)
+ suspect.styleName = it.getAnnotationValue(typeof(ExtraStyle), 0)
}
if (parentSuspect === null) {
type.completeSuspect(it, suspect, dtoType)
@@ -354,6 +353,17 @@
if(suspect !== null) suspect.properties.put(keyAndValue.key.toLowerCase, keyAndValue.value)
}
]
+ if(uiLayout.saveAndNew) {
+ var suspect = createSaveAndNew
+ suspect.id = '''«uiLayout.generateId».«ILayoutingStrategy.TAG__SAVEANDNEW»'''
+ suspect.label = I18NKeyGenerator.key(ILayoutingStrategy.TAG__SAVEANDNEW)
+ suspect.labelI18nKey = I18NKeyGenerator.key(ILayoutingStrategy.TAG__SAVEANDNEW)
+ if (parentSuspect !== null) {
+ parentSuspect.children.add(suspect)
+ } else {
+ layouter.add(suspect)
+ }
+ }
}
def boolean visible(OperationInfo info) {
@@ -753,6 +763,13 @@
suspect
}
+ def YTypedSuspect createSaveAndNew() {
+ val suspect = YECviewFactory.eINSTANCE.createYTypedSuspect
+ suspect.tags += ILayoutingStrategy.TAG__SAVEANDNEW
+ suspect.typeQualifiedName = ILayoutingStrategy.TAG__SAVEANDNEW.toFirstUpper
+ suspect
+ }
+
def YTypedSuspect createDecimalField(JvmType type, OperationInfo info) {
val suspect = YECviewFactory.eINSTANCE.createYTypedSuspect
suspect.tags += ILayoutingStrategy.TAG__DECIMAL
@@ -1036,408 +1053,390 @@
} else if (type.byteArray) {
suspect.tags += ILayoutingStrategy.TAG__RICH_TEXT__BLOB
} else {
- throw new IllegalArgumentException(
- "RichTextFields need to be bound to String or byte[]. " + type.qualifiedName +
- " is not a valid option.")
- }
+ throw new IllegalArgumentException("RichTextFields need to be bound to String or byte[]. " + type.qualifiedName +" is not a valid option.")
+ }
+ suspect.type = computer.loadClass(uiLayout.eResource.resourceSet, type.qualifiedName)
+ suspect.typeQualifiedName = type.qualifiedName
+ suspect
+ }
- suspect.type = computer.loadClass(uiLayout.eResource.resourceSet, type.qualifiedName)
- suspect.typeQualifiedName = type.qualifiedName
- suspect
+ def YSuspect createMaskedTextField(JvmType type, OperationInfo info, String mask) {
+ val suspect = YECviewFactory.eINSTANCE.createYTypedSuspect
+ suspect.tags += ILayoutingStrategy.TAG__MASKED_TEXT_FIELD
+ suspect.properties.put(IPropertyConstants.PROPERTY_MASK, mask)
+ suspect.type = computer.loadClass(uiLayout.eResource.resourceSet, type.qualifiedName)
+ suspect.typeQualifiedName = type.qualifiedName
+ suspect
+ }
+
+ def YSuspect createMaskedDecimalField(JvmType type, OperationInfo info, String mask) {
+ val suspect = YECviewFactory.eINSTANCE.createYTypedSuspect
+ suspect.tags += ILayoutingStrategy.TAG__MASKED_DECIMAL_FIELD
+ suspect.properties.put(IPropertyConstants.PROPERTY_MASK, mask)
+ suspect.type = computer.loadClass(uiLayout.eResource.resourceSet, type.qualifiedName)
+ suspect.typeQualifiedName = type.qualifiedName
+ suspect
+ }
+
+ def YSuspect createPasswordField(JvmType type, OperationInfo info) {
+ val suspect = YECviewFactory.eINSTANCE.createYTypedSuspect
+
+ if (type.string) {
+ suspect.tags += ILayoutingStrategy.TAG__PASSWORD
+ } else {
+ throw new IllegalArgumentException(
+ "PasswordField need to be bound to String. " + type.qualifiedName + " is not a valid option.")
}
- def YSuspect createMaskedTextField(JvmType type, OperationInfo info, String mask) {
- val suspect = YECviewFactory.eINSTANCE.createYTypedSuspect
- suspect.tags += ILayoutingStrategy.TAG__MASKED_TEXT_FIELD
- suspect.properties.put(IPropertyConstants.PROPERTY_MASK, mask)
- suspect.type = computer.loadClass(uiLayout.eResource.resourceSet, type.qualifiedName)
- suspect.typeQualifiedName = type.qualifiedName
- suspect
+ suspect.type = computer.loadClass(uiLayout.eResource.resourceSet, type.qualifiedName)
+ suspect.typeQualifiedName = type.qualifiedName
+ suspect
+ }
+
+ def YSuspect createBlopUploadComponent(JvmType type, OperationInfo info) {
+ val suspect = YECviewFactory.eINSTANCE.createYTypedSuspect
+ suspect.tags += ILayoutingStrategy.TAG__BLOB
+ suspect.type = computer.loadClass(uiLayout.eResource.resourceSet, type.qualifiedName)
+ suspect.typeQualifiedName = type.qualifiedName
+ suspect
+ }
+
+ def YSuspect createCustomDecimalField(JvmType type, OperationInfo info) {
+ val suspect = YECviewFactory.eINSTANCE.createYTypedSuspect
+ suspect.tags += ILayoutingStrategy.TAG__DECIMAL
+ suspect.type = computer.loadClass(uiLayout.eResource.resourceSet, type.qualifiedName)
+ suspect.typeQualifiedName = type.qualifiedName
+ suspect
+ }
+
+ /**
+ * Create the bindings and install at the view
+ */
+ def createBinding(YEmbeddable yField, OperationInfo info, JvmType type, String fieldProperty) {
+
+ // use the autoWireSource as the model endpoint
+ val UiBindingEndpointAssignment uiModelEndpoint = uiLayout.autoWireSource as UiBindingEndpointAssignment
+ val yModelEndpoint = computer.createValueBindingEndpoint(uiModelEndpoint)
+ val detailValueEndpoint = yModelEndpoint.createDetailValueEndpoint
+ detailValueEndpoint.propertyPath = info.name
+ detailValueEndpoint.type = computer.loadClass(uiLayout.eResource.resourceSet, beanType.qualifiedName)
+
+ // create the field endpoint
+ val yFieldEndpoint = BindingFactory.eINSTANCE.createYECViewModelValueBindingEndpoint
+ yFieldEndpoint.element = yField
+ yFieldEndpoint.propertyPath = fieldProperty
+ yFieldEndpoint.typeQualifiedName = beanType.qualifiedName
+ yFieldEndpoint.type = computer.loadClass(uiLayout.eResource.resourceSet, beanType.qualifiedName)
+ if (yFieldEndpoint.type !== null && yFieldEndpoint.type.isAssignableFrom(typeof(EObject))) {
+ yFieldEndpoint.emfNsURI = yField.eClass.EPackage.nsURI
}
- def YSuspect createMaskedDecimalField(JvmType type, OperationInfo info, String mask) {
- val suspect = YECviewFactory.eINSTANCE.createYTypedSuspect
- suspect.tags += ILayoutingStrategy.TAG__MASKED_DECIMAL_FIELD
- suspect.properties.put(IPropertyConstants.PROPERTY_MASK, mask)
- suspect.type = computer.loadClass(uiLayout.eResource.resourceSet, type.qualifiedName)
- suspect.typeQualifiedName = type.qualifiedName
- suspect
- }
+ // bind model to target
+ val yBinding = BindingFactory.eINSTANCE.createYValueBinding();
+ yBinding.setTargetEndpoint(yFieldEndpoint);
+ yBinding.setModelEndpoint(detailValueEndpoint);
+ yBinding.setModelToTargetStrategy(YBindingUpdateStrategy.UPDATE);
+ yBinding.setTargetToModelStrategy(
+ if(info.readonly) YBindingUpdateStrategy.NEVER else YBindingUpdateStrategy.UPDATE)
- def YSuspect createPasswordField(JvmType type, OperationInfo info) {
- val suspect = YECviewFactory.eINSTANCE.createYTypedSuspect
+ // register the binding at the current view
+ yLayout.view.orCreateBindingSet.bindings += yBinding
- if (type.string) {
- suspect.tags += ILayoutingStrategy.TAG__PASSWORD
- } else {
- throw new IllegalArgumentException(
- "PasswordField need to be bound to String. " + type.qualifiedName + " is not a valid option.")
- }
+ // set the i18n key based on the binding
+ // yField.labelI18nKey = I18nKeyProvider.toI18nKey(beanType.qualifiedName, detailValueEndpoint.propertyPath)
+ yField.labelI18nKey = detailValueEndpoint.propertyPath
+ }
- suspect.type = computer.loadClass(uiLayout.eResource.resourceSet, type.qualifiedName)
- suspect.typeQualifiedName = type.qualifiedName
- suspect
- }
+ /**
+ * Create the bindings and install at the view
+ */
+ def createModelValueBinding(YSuspect suspect, String propertyPath, JvmType type, String fieldProperty,
+ JvmType parentType) {
- def YSuspect createBlopUploadComponent(JvmType type, OperationInfo info) {
- val suspect = YECviewFactory.eINSTANCE.createYTypedSuspect
- suspect.tags += ILayoutingStrategy.TAG__BLOB
- suspect.type = computer.loadClass(uiLayout.eResource.resourceSet, type.qualifiedName)
- suspect.typeQualifiedName = type.qualifiedName
- suspect
- }
+ val YBeanSlot subTypeBeanSlot = suspect.findSubTypeBeanSlot
+ var YValueBindingEndpoint endpoint = null
+ var path = ""
- def YSuspect createCustomDecimalField(JvmType type, OperationInfo info) {
- val suspect = YECviewFactory.eINSTANCE.createYTypedSuspect
- suspect.tags += ILayoutingStrategy.TAG__DECIMAL
- suspect.type = computer.loadClass(uiLayout.eResource.resourceSet, type.qualifiedName)
- suspect.typeQualifiedName = type.qualifiedName
- suspect
- }
-
- /**
- * Create the bindings and install at the view
- */
- def createBinding(YEmbeddable yField, OperationInfo info, JvmType type, String fieldProperty) {
+ // If a subTypeBeanSlot could be found, then we need to create a binding endpoint against this beanslot.
+ // The main slot has a different type then detail beanslot. And we can not bind fields contained in the subtype
+ // to the main bean slot. Eclipse databinding requires a proper type at binding creation.
+ if (subTypeBeanSlot === null) {
// use the autoWireSource as the model endpoint
- val UiBindingEndpointAssignment uiModelEndpoint = uiLayout.autoWireSource as UiBindingEndpointAssignment
+ val UiBindingEndpointAssignment uiModelEndpoint = uiLayout.
+ autoWireSource as UiBindingEndpointAssignment
val yModelEndpoint = computer.createValueBindingEndpoint(uiModelEndpoint)
val detailValueEndpoint = yModelEndpoint.createDetailValueEndpoint
- detailValueEndpoint.propertyPath = info.name
- detailValueEndpoint.type = computer.loadClass(uiLayout.eResource.resourceSet, beanType.qualifiedName)
-
- // create the field endpoint
- val yFieldEndpoint = BindingFactory.eINSTANCE.createYECViewModelValueBindingEndpoint
- yFieldEndpoint.element = yField
- yFieldEndpoint.propertyPath = fieldProperty
- yFieldEndpoint.typeQualifiedName = beanType.qualifiedName
- yFieldEndpoint.type = computer.loadClass(uiLayout.eResource.resourceSet, beanType.qualifiedName)
- if (yFieldEndpoint.type !== null && yFieldEndpoint.type.isAssignableFrom(typeof(EObject))) {
- yFieldEndpoint.emfNsURI = yField.eClass.EPackage.nsURI
- }
-
- // bind model to target
- val yBinding = BindingFactory.eINSTANCE.createYValueBinding();
- yBinding.setTargetEndpoint(yFieldEndpoint);
- yBinding.setModelEndpoint(detailValueEndpoint);
- yBinding.setModelToTargetStrategy(YBindingUpdateStrategy.UPDATE);
- yBinding.setTargetToModelStrategy(
- if(info.readonly) YBindingUpdateStrategy.NEVER else YBindingUpdateStrategy.UPDATE)
-
- // register the binding at the current view
- yLayout.view.orCreateBindingSet.bindings += yBinding
-
- // set the i18n key based on the binding
- // yField.labelI18nKey = I18nKeyProvider.toI18nKey(beanType.qualifiedName, detailValueEndpoint.propertyPath)
- yField.labelI18nKey = detailValueEndpoint.propertyPath
+ detailValueEndpoint.propertyPath = propertyPath
+ detailValueEndpoint.type = computer.loadClass(uiLayout.eResource.resourceSet,
+ parentType.qualifiedName)
+ endpoint = detailValueEndpoint
+ path = detailValueEndpoint.propertyPath
+ } else {
+ endpoint = subTypeBeanSlot.createBindingEndpoint(propertyPath)
+ path = propertyPath
}
- /**
- * Create the bindings and install at the view
- */
- def createModelValueBinding(YSuspect suspect, String propertyPath, JvmType type, String fieldProperty,
- JvmType parentType) {
+ suspect.getValueBindingEndpoints().add(endpoint);
- val YBeanSlot subTypeBeanSlot = suspect.findSubTypeBeanSlot
- var YValueBindingEndpoint endpoint = null
- var path = ""
+ if (suspect.tags.contains(ILayoutingStrategy.TAG__SUGGEST_TEXT)) {
+ // we need to create a second binding for the DTO. First binding was prepared for the text
+ //
+ // use the autoWireSource as the model endpoint
+ val UiBindingEndpointAssignment uiModelEndpoint = uiLayout.
+ autoWireSource as UiBindingEndpointAssignment
+ var yModelEndpoint = computer.createValueBindingEndpoint(uiModelEndpoint)
+ yModelEndpoint = EcoreUtil.copy(yModelEndpoint);
+ yModelEndpoint.tags+="dtoBinding"
+ suspect.getValueBindingEndpoints().add(yModelEndpoint);
+ }
- // If a subTypeBeanSlot could be found, then we need to create a binding endpoint against this beanslot.
- // The main slot has a different type then detail beanslot. And we can not bind fields contained in the subtype
- // to the main bean slot. Eclipse databinding requires a proper type at binding creation.
- if (subTypeBeanSlot === null) {
+ // set the i18n key based on the binding
+ // suspect.labelI18nKey = I18nKeyProvider.toI18nKey(beanType.qualifiedName, path)
+ suspect.labelI18nKey = path
+ suspect.label = propertyPath
+ }
- // use the autoWireSource as the model endpoint
- val UiBindingEndpointAssignment uiModelEndpoint = uiLayout.
- autoWireSource as UiBindingEndpointAssignment
- val yModelEndpoint = computer.createValueBindingEndpoint(uiModelEndpoint)
+ /**
+ * Creates a binding which points to the container of the property
+ */
+ def createModelValueContainerBinding(YSuspect suspect, String propertyPath, JvmType type, String property) {
+
+ var fieldProperty = property
+ if (fieldProperty.contains(".")) {
+ fieldProperty = fieldProperty.substring(0, fieldProperty.lastIndexOf("."))
+ } else {
+ fieldProperty = null
+ }
+
+ val YBeanSlot subTypeBeanSlot = suspect.findSubTypeBeanSlot
+ var YValueBindingEndpoint endpoint = null
+
+ // If a subTypeBeanSlot could be found, then we need to create a binding endpoint against this beanslot.
+ // The main slot has a different type then detail beanslot. And we can not bind fields contained in the subtype
+ // to the main bean slot. Eclipse databinding requires a proper type at binding creation.
+ if (subTypeBeanSlot === null) {
+
+ // use the autoWireSource as the model endpoint
+ val UiBindingEndpointAssignment uiModelEndpoint = uiLayout.
+ autoWireSource as UiBindingEndpointAssignment
+ val yModelEndpoint = computer.createValueBindingEndpoint(uiModelEndpoint)
+ endpoint = yModelEndpoint
+ if (fieldProperty !== null) {
val detailValueEndpoint = yModelEndpoint.createDetailValueEndpoint
detailValueEndpoint.propertyPath = propertyPath
detailValueEndpoint.type = computer.loadClass(uiLayout.eResource.resourceSet,
- parentType.qualifiedName)
+ beanType.qualifiedName)
endpoint = detailValueEndpoint
- path = detailValueEndpoint.propertyPath
- } else {
- endpoint = subTypeBeanSlot.createBindingEndpoint(propertyPath)
- path = propertyPath
}
-
- suspect.getValueBindingEndpoints().add(endpoint);
-
- // set the i18n key based on the binding
- // suspect.labelI18nKey = I18nKeyProvider.toI18nKey(beanType.qualifiedName, path)
- suspect.labelI18nKey = path
- suspect.label = propertyPath
+ } else {
+ endpoint = subTypeBeanSlot.createBindingEndpoint(propertyPath)
}
- /**
- * Creates a binding which points to the container of the property
- */
- def createModelValueContainerBinding(YSuspect suspect, String propertyPath, JvmType type, String property) {
+ suspect.containerValueBindingEndpoint = endpoint
+ }
- var fieldProperty = property
- if (fieldProperty.contains(".")) {
- fieldProperty = fieldProperty.substring(0, fieldProperty.lastIndexOf("."))
- } else {
- fieldProperty = null
- }
-
- val YBeanSlot subTypeBeanSlot = suspect.findSubTypeBeanSlot
- var YValueBindingEndpoint endpoint = null
-
- // If a subTypeBeanSlot could be found, then we need to create a binding endpoint against this beanslot.
- // The main slot has a different type then detail beanslot. And we can not bind fields contained in the subtype
- // to the main bean slot. Eclipse databinding requires a proper type at binding creation.
- if (subTypeBeanSlot === null) {
-
- // use the autoWireSource as the model endpoint
- val UiBindingEndpointAssignment uiModelEndpoint = uiLayout.
- autoWireSource as UiBindingEndpointAssignment
- val yModelEndpoint = computer.createValueBindingEndpoint(uiModelEndpoint)
- endpoint = yModelEndpoint
- if (fieldProperty !== null) {
- val detailValueEndpoint = yModelEndpoint.createDetailValueEndpoint
- detailValueEndpoint.propertyPath = propertyPath
- detailValueEndpoint.type = computer.loadClass(uiLayout.eResource.resourceSet,
- beanType.qualifiedName)
- endpoint = detailValueEndpoint
- }
- } else {
- endpoint = subTypeBeanSlot.createBindingEndpoint(propertyPath)
- }
-
- suspect.containerValueBindingEndpoint = endpoint
+ /**
+ * Checks if the suspect is contained in an YSubTypeSuspect. <br>
+ * If so, then the detail beanslot of the YSubTypeSuspect is returned. Null otherwise.
+ */
+ def YBeanSlot findSubTypeBeanSlot(YSuspect suspect) {
+ if (suspect === null) {
+ return null
+ }
+ if (suspect instanceof YSubTypeSuspect) {
+ return suspect.beanSlot
}
- /**
- * Checks if the suspect is contained in an YSubTypeSuspect. <br>
- * If so, then the detail beanslot of the YSubTypeSuspect is returned. Null otherwise.
- */
- def YBeanSlot findSubTypeBeanSlot(YSuspect suspect) {
- if (suspect === null) {
- return null
- }
- if (suspect instanceof YSubTypeSuspect) {
- return suspect.beanSlot
- }
+ val parent = suspect.eContainer
+ if (parent instanceof YSuspect) {
+ return parent.findSubTypeBeanSlot
+ }
+ return null
+ }
- val parent = suspect.eContainer
- if (parent instanceof YSuspect) {
- return parent.findSubTypeBeanSlot
- }
+ /**
+ * Create the bindings and install at the view
+ */
+ def createModelListBinding(YSuspect suspect, OperationInfo info, JvmType type, String fieldProperty) {
+
+ val YBeanSlot subTypeBeanSlot = suspect.findSubTypeBeanSlot
+ var YListBindingEndpoint endpoint = null
+ if (subTypeBeanSlot === null) {
+ // use the autoWireSource as the model endpoint
+ val UiBindingEndpointAssignment uiModelEndpoint = uiLayout.
+ autoWireSource as UiBindingEndpointAssignment
+ endpoint = createListBindingEndpointWithNested(uiModelEndpoint, info.name)
+ } else {
+ endpoint = subTypeBeanSlot.createListBindingEndpoint(info.name, subTypeBeanSlot.valueType)
+ }
+
+ suspect.getValueBindingEndpoints().add(endpoint);
+
+ // set the i18n key based on the binding
+ // suspect.labelI18nKey = I18nKeyProvider.toI18nKey(beanType.qualifiedName, info.name)
+ suspect.labelI18nKey = info.name
+ suspect.label = info.name
+ }
+
+ /**
+ * Creates a listbinding with respect to nested collection fields. <p>
+ * For instance:<br>
+ * beanSlot contains Person. We want to bind the children of persons father to a table.
+ * So we need to access the children collection of the beanslot by a nested property path: <code>beanslot.father.children</code>
+ */
+ def YListBindingEndpoint createListBindingEndpointWithNested(UiBindingEndpointAssignment epDef,
+ String attributePath) {
+ if (epDef === null) {
return null
}
- /**
- * Create the bindings and install at the view
- */
- def createModelListBinding(YSuspect suspect, OperationInfo info, JvmType type, String fieldProperty) {
+ var YListBindingEndpoint result = null;
+ val BindingInfoHelper.BindingInfo info = new BindingInfoHelper.BindingInfo()
+ bindingInfoHelper.collectBindingInfo(epDef, info);
- val YBeanSlot subTypeBeanSlot = suspect.findSubTypeBeanSlot
- var YListBindingEndpoint endpoint = null
- if (subTypeBeanSlot === null) {
- // use the autoWireSource as the model endpoint
- val UiBindingEndpointAssignment uiModelEndpoint = uiLayout.
- autoWireSource as UiBindingEndpointAssignment
- endpoint = createListBindingEndpointWithNested(uiModelEndpoint, info.name)
- } else {
- endpoint = subTypeBeanSlot.createListBindingEndpoint(info.name, subTypeBeanSlot.valueType)
+ if (info.bindingRoot instanceof UiBeanSlot) {
+ val uiBeanSlot = info.bindingRoot as UiBeanSlot
+
+ val YBeanSlot yBeanSlot = computer.associatedUi(uiBeanSlot)
+ val YBeanSlotListBindingEndpoint ep = factory.createBeanSlotListBindingEndpoint
+ ep.beanSlot = yBeanSlot
+
+ ep.attributePath = toNestedCollectionPath(info, attributePath)
+ result = ep
+ } else if (info.bindingRoot instanceof UiEmbeddable) {
+ val YEmbeddable yElement = computer.associatedUi(info.bindingRoot)
+ val YECViewModelListBindingEndpoint ep = factory.createECViewModelListBindingEndpoint
+ ep.element = yElement
+ ep.propertyPath = toNestedCollectionPath(info, attributePath)
+ if (info.typeForBinding !== null) {
+ ep.typeQualifiedName = info.typeForBinding.qualifiedName
+ ep.type = computer.loadClass(epDef.eResource.resourceSet, ep.typeQualifiedName)
}
-
- suspect.getValueBindingEndpoints().add(endpoint);
-
- // set the i18n key based on the binding
- // suspect.labelI18nKey = I18nKeyProvider.toI18nKey(beanType.qualifiedName, info.name)
- suspect.labelI18nKey = info.name
- suspect.label = info.name
+ if (yElement !== null) {
+ ep.emfNsURI = yElement.eClass.EPackage.nsURI
+ }
+ result = ep
}
- /**
- * Creates a listbinding with respect to nested collection fields. <p>
- * For instance:<br>
- * beanSlot contains Person. We want to bind the children of persons father to a table.
- * So we need to access the children collection of the beanslot by a nested property path: <code>beanslot.father.children</code>
- */
- def YListBindingEndpoint createListBindingEndpointWithNested(UiBindingEndpointAssignment epDef,
- String attributePath) {
- if (epDef === null) {
- return null
- }
+ return result
+ }
- var YListBindingEndpoint result = null;
- val BindingInfoHelper.BindingInfo info = new BindingInfoHelper.BindingInfo()
- bindingInfoHelper.collectBindingInfo(epDef, info);
-
- if (info.bindingRoot instanceof UiBeanSlot) {
- val uiBeanSlot = info.bindingRoot as UiBeanSlot
-
- val YBeanSlot yBeanSlot = computer.associatedUi(uiBeanSlot)
- val YBeanSlotListBindingEndpoint ep = factory.createBeanSlotListBindingEndpoint
- ep.beanSlot = yBeanSlot
-
- ep.attributePath = toNestedCollectionPath(info, attributePath)
- result = ep
- } else if (info.bindingRoot instanceof UiEmbeddable) {
- val YEmbeddable yElement = computer.associatedUi(info.bindingRoot)
- val YECViewModelListBindingEndpoint ep = factory.createECViewModelListBindingEndpoint
- ep.element = yElement
- ep.propertyPath = toNestedCollectionPath(info, attributePath)
- if (info.typeForBinding !== null) {
- ep.typeQualifiedName = info.typeForBinding.qualifiedName
- ep.type = computer.loadClass(epDef.eResource.resourceSet, ep.typeQualifiedName)
- }
- if (yElement !== null) {
- ep.emfNsURI = yElement.eClass.EPackage.nsURI
- }
- result = ep
- }
-
- return result
+ def toNestedCollectionPath(BindingInfo info, String attributePath) {
+ val StringBuilder b = new StringBuilder
+ if (!info.path.toString.nullOrEmpty) {
+ b.append(info.path.toString)
}
- def toNestedCollectionPath(BindingInfo info, String attributePath) {
- val StringBuilder b = new StringBuilder
- if (!info.path.toString.nullOrEmpty) {
- b.append(info.path.toString)
+ if (!attributePath.nullOrEmpty) {
+ if (b.length > 0) {
+ b.append(".")
}
-
- if (!attributePath.nullOrEmpty) {
- if (b.length > 0) {
- b.append(".")
- }
- b.append(attributePath)
- }
- val pathResult = b.toString
- pathResult
+ b.append(attributePath)
}
+ val pathResult = b.toString
+ pathResult
+ }
- /**
- * Creates y column info element
- */
- def YColumnInfo createYColumnInfo(JvmType type) {
- val YColumnInfo columnInfo = YECviewFactory.eINSTANCE.createYColumnInfo
+ /**
+ * Creates y column info element
+ */
+ def YColumnInfo createYColumnInfo(JvmType type) {
+ val YColumnInfo columnInfo = YECviewFactory.eINSTANCE.createYColumnInfo
- columnInfo.typeQualifiedName = type.qualifiedName
- columnInfo.type = computer.loadClass(uiLayout.eResource.resourceSet, columnInfo.typeQualifiedName)
- columnInfo
- }
+ columnInfo.typeQualifiedName = type.qualifiedName
+ columnInfo.type = computer.loadClass(uiLayout.eResource.resourceSet, columnInfo.typeQualifiedName)
+ columnInfo
+ }
- /**
- * Sets properties into y column info
- */
- def setYColumnInfoProperties(YColumnInfo columnInfo, List<AutowireUtil.Pair> propList) {
- var properties = columnInfo.properties
- if (propList !== null) {
- for (prop : propList) {
- properties.put(prop.key, prop.value)
- }
- }
- }
-
- public interface Layouter {
- def void setup(UiLayout uiRootLayout, YLayout yRootLayout)
-
- def void add(YEmbeddable element);
-
- def void add(YSuspect suspect);
-
- def void pushHierarchy(YTypedCompoundSuspect suspect);
-
- def void popHierarchy();
-
- }
-
- public static class MobileLayouter implements Layouter {
-
- VMVerticalComponentGroup group
-
- override setup(UiLayout uiRootLayout, YLayout yRootLayout) {
- group = VaadinMobileFactory.eINSTANCE.createVMVerticalComponentGroup
-
- yRootLayout.elements += group
- }
-
- override add(YEmbeddable element) {
- group.addElement(element)
- }
-
- override add(YSuspect ySuspect) {
- // layout.suspects += ySuspect
- }
-
- override pushHierarchy(YTypedCompoundSuspect suspect) {
- throw new UnsupportedOperationException("TODO: auto-generated method stub")
- }
-
- override popHierarchy() {
- throw new UnsupportedOperationException("TODO: auto-generated method stub")
- }
-
- }
-
- public static class StrategyLayoutLayouter implements Layouter {
-
- Stack<YTypedCompoundSuspect> currentSubDtoSuspect = new Stack
- YStrategyLayout layout
-
- override setup(UiLayout uiRootLayout, YLayout yRootLayout) {
- layout = YECviewFactory.eINSTANCE.createYStrategyLayout
- layout.id = "strategyLayout"
- layout.numberColumns = uiRootLayout.numberColumns
- yRootLayout.numberColumns = uiRootLayout.numberColumns
-
- yRootLayout.elements += layout
- yRootLayout.view.visibilityProcessors +=
- YVisibilityFactory.eINSTANCE.createYAuthorizationVisibilityProcessor
- if (yRootLayout instanceof YAlignmentContainer) {
- yRootLayout.applyAlignment(layout, YAlignment.FILL_FILL)
- }
- }
-
- override add(YEmbeddable element) {
- }
-
- override add(YSuspect ySuspect) {
- if (!currentSubDtoSuspect.isEmpty) {
- currentSubDtoSuspect.peek.children += ySuspect
- } else {
- layout.suspects += ySuspect
- }
- }
-
- override pushHierarchy(YTypedCompoundSuspect suspect) {
- currentSubDtoSuspect.push(suspect)
- }
-
- override popHierarchy() {
- currentSubDtoSuspect.pop
- }
-
- }
-
- /**
- * The Class LocalResourceAccess.
- */
- public static class LocalResourceAccess implements IReferenceFinder.ILocalResourceAccess {
-
- ResourceSet rs
-
- new(ResourceSet rs) {
- this.rs = rs
- }
-
- /*
- * (non-Javadoc)
- *
- * @see
- * org.eclipse.xtext.findReferences.IReferenceFinder.IResourceAccess
- * #readOnly(org.eclipse.emf.common.util.URI,
- * org.eclipse.xtext.util.concurrent.IUnitOfWork)
- */
- override <R> R readOnly(URI targetURI, IUnitOfWork<R, ResourceSet> work) {
- return work.exec(rs);
+ /**
+ * Sets properties into y column info
+ */
+ def setYColumnInfoProperties(YColumnInfo columnInfo, List<AutowireUtil.Pair> propList) {
+ var properties = columnInfo.properties
+ if (propList !== null) {
+ for (prop : propList) {
+ properties.put(prop.key, prop.value)
}
}
}
+
+ public interface Layouter {
+ def void setup(UiLayout uiRootLayout, YLayout yRootLayout)
+
+ def void add(YEmbeddable element);
+
+ def void add(YSuspect suspect);
+
+ def void pushHierarchy(YTypedCompoundSuspect suspect);
+
+ def void popHierarchy();
+
+ }
+
+ public static class StrategyLayoutLayouter implements Layouter {
+
+ Stack<YTypedCompoundSuspect> currentSubDtoSuspect = new Stack
+ YStrategyLayout layout
+
+ override setup(UiLayout uiRootLayout, YLayout yRootLayout) {
+ layout = YECviewFactory.eINSTANCE.createYStrategyLayout
+ layout.id = "strategyLayout"
+ layout.numberColumns = uiRootLayout.numberColumns
+ layout.saveAndNew = uiRootLayout.saveAndNew
+ yRootLayout.numberColumns = uiRootLayout.numberColumns
+
+ yRootLayout.elements += layout
+ yRootLayout.view.visibilityProcessors +=
+ YVisibilityFactory.eINSTANCE.createYAuthorizationVisibilityProcessor
+ if (yRootLayout instanceof YAlignmentContainer) {
+ yRootLayout.applyAlignment(layout, YAlignment.FILL_FILL)
+ }
+ }
+
+ override add(YEmbeddable element) {
+ }
+
+ override add(YSuspect ySuspect) {
+ if (!currentSubDtoSuspect.isEmpty) {
+ currentSubDtoSuspect.peek.children += ySuspect
+ } else {
+ layout.suspects += ySuspect
+ }
+ }
+
+ override pushHierarchy(YTypedCompoundSuspect suspect) {
+ currentSubDtoSuspect.push(suspect)
+ }
+
+ override popHierarchy() {
+ currentSubDtoSuspect.pop
+ }
+
+ }
+
+ /**
+ * The Class LocalResourceAccess.
+ */
+ public static class LocalResourceAccess implements IReferenceFinder.ILocalResourceAccess {
+
+ ResourceSet rs
+
+ new(ResourceSet rs) {
+ this.rs = rs
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.xtext.findReferences.IReferenceFinder.IResourceAccess
+ * #readOnly(org.eclipse.emf.common.util.URI,
+ * org.eclipse.xtext.util.concurrent.IUnitOfWork)
+ */
+ override <R> R readOnly(URI targetURI, IUnitOfWork<R, ResourceSet> work) {
+ return work.exec(rs);
+ }
+ }
+ }
\ No newline at end of file
diff --git a/org.eclipse.osbp.autowireHelper/src/org/eclipse/osbp/autowirehelper/utils/AutowireUtil.xtend b/org.eclipse.osbp.autowireHelper/src/org/eclipse/osbp/autowirehelper/utils/AutowireUtil.xtend
index 2b692f7..317ebaf 100644
--- a/org.eclipse.osbp.autowireHelper/src/org/eclipse/osbp/autowirehelper/utils/AutowireUtil.xtend
+++ b/org.eclipse.osbp.autowireHelper/src/org/eclipse/osbp/autowirehelper/utils/AutowireUtil.xtend
@@ -60,7 +60,6 @@
import org.eclipse.xtext.naming.IQualifiedNameProvider
class AutowireUtil {
- @Inject extension IQualifiedNameProvider
@Inject extension TypeHelper
@Inject
private TypeReferences typeReferences;
@@ -78,8 +77,7 @@
parent = parent.eContainer
}
var uimodel = parent as UiModel
- return '''«uimodel.packageName»«IF viewName != null».«viewName»«ENDIF»«IF resolvedType != null».«resolvedType.
- identifier»«ENDIF»'''
+ return '''«uimodel.packageName»«IF viewName !== null».«viewName»«ENDIF»«IF resolvedType !== null».«resolvedType.simpleName»«ENDIF»'''
}
public def UiView getUiView(UiLayout layout) {
diff --git a/org.eclipse.osbp.autowireHelper/xtend-gen/org/eclipse/osbp/autowirehelper/AutowireHelper.java b/org.eclipse.osbp.autowireHelper/xtend-gen/org/eclipse/osbp/autowirehelper/AutowireHelper.java
index 71da61e..788ce62 100644
--- a/org.eclipse.osbp.autowireHelper/xtend-gen/org/eclipse/osbp/autowirehelper/AutowireHelper.java
+++ b/org.eclipse.osbp.autowireHelper/xtend-gen/org/eclipse/osbp/autowirehelper/AutowireHelper.java
@@ -86,20 +86,21 @@
import org.eclipse.osbp.ecview.semantic.uimodel.UiBindingEndpointAssignment;
import org.eclipse.osbp.ecview.semantic.uimodel.UiBindingExpression;
import org.eclipse.osbp.ecview.semantic.uimodel.UiEmbeddable;
-import org.eclipse.osbp.ecview.semantic.uimodel.UiHorizontalLayout;
import org.eclipse.osbp.ecview.semantic.uimodel.UiLayout;
import org.eclipse.osbp.ecview.semantic.uimodel.UiTypedBindable;
import org.eclipse.osbp.mobile.vaadin.ecview.model.VMSwitch;
-import org.eclipse.osbp.mobile.vaadin.ecview.model.VMVerticalComponentGroup;
import org.eclipse.osbp.mobile.vaadin.ecview.model.VaadinMobileFactory;
import org.eclipse.osbp.runtime.common.annotations.DomainDescription;
import org.eclipse.osbp.runtime.common.annotations.DomainKey;
+import org.eclipse.osbp.runtime.common.annotations.ExtraStyle;
import org.eclipse.osbp.runtime.common.annotations.FilterDepth;
import org.eclipse.osbp.runtime.common.annotations.OnKanbanCard;
import org.eclipse.osbp.runtime.common.annotations.TargetEnumConstraints;
+import org.eclipse.osbp.runtime.common.annotations.UIGroup;
import org.eclipse.osbp.runtime.common.annotations.UniqueEntry;
import org.eclipse.osbp.runtime.common.layouting.IPropertyConstants;
import org.eclipse.osbp.utils.functionnormalizer.api.FunctionTypingAPI;
+import org.eclipse.osbp.xtext.i18n.I18NKeyGenerator;
import org.eclipse.xtend2.lib.StringConcatenation;
import org.eclipse.xtext.common.types.JvmAnnotationReference;
import org.eclipse.xtext.common.types.JvmDeclaredType;
@@ -138,36 +139,6 @@
public abstract void popHierarchy();
}
- public static class MobileLayouter implements AutowireHelper.Layouter {
- private VMVerticalComponentGroup group;
-
- @Override
- public void setup(final UiLayout uiRootLayout, final YLayout yRootLayout) {
- this.group = VaadinMobileFactory.eINSTANCE.createVMVerticalComponentGroup();
- EList<YEmbeddable> _elements = yRootLayout.getElements();
- _elements.add(this.group);
- }
-
- @Override
- public void add(final YEmbeddable element) {
- this.group.addElement(element);
- }
-
- @Override
- public void add(final YSuspect ySuspect) {
- }
-
- @Override
- public void pushHierarchy(final YTypedCompoundSuspect suspect) {
- throw new UnsupportedOperationException("TODO: auto-generated method stub");
- }
-
- @Override
- public void popHierarchy() {
- throw new UnsupportedOperationException("TODO: auto-generated method stub");
- }
- }
-
public static class StrategyLayoutLayouter implements AutowireHelper.Layouter {
private Stack<YTypedCompoundSuspect> currentSubDtoSuspect = new Stack<YTypedCompoundSuspect>();
@@ -178,6 +149,7 @@
this.layout = YECviewFactory.eINSTANCE.createYStrategyLayout();
this.layout.setId("strategyLayout");
this.layout.setNumberColumns(uiRootLayout.getNumberColumns());
+ this.layout.setSaveAndNew(uiRootLayout.isSaveAndNew());
yRootLayout.setNumberColumns(uiRootLayout.getNumberColumns());
EList<YEmbeddable> _elements = yRootLayout.getElements();
_elements.add(this.layout);
@@ -285,32 +257,15 @@
@Override
public void autowire(final UiLayout uiLayout, final UiModelDerivedStateComputerx computer, final boolean mobile) {
- boolean _isAutowire = uiLayout.isAutowire();
- boolean _not = (!_isAutowire);
- if (_not) {
- return;
- }
this.computer = computer;
this.mobile = mobile;
this.uiLayout = uiLayout;
this.yLayout = computer.<YLayout>associatedUi(uiLayout);
this.yView = this.yLayout.getView();
this.yMainBeanslot = this.getBeanSlot(uiLayout);
- boolean _matched = false;
- if (uiLayout instanceof UiHorizontalLayout) {
- _matched=true;
- AutowireHelper.Layouter _xifexpression = null;
- if ((!mobile)) {
- _xifexpression = new AutowireHelper.StrategyLayoutLayouter();
- } else {
- _xifexpression = new AutowireHelper.MobileLayouter();
- }
- this.layouter = _xifexpression;
- this.layouter.setup(uiLayout, this.yLayout);
- }
- if (!_matched) {
- return;
- }
+ AutowireHelper.StrategyLayoutLayouter _strategyLayoutLayouter = new AutowireHelper.StrategyLayoutLayouter();
+ this.layouter = _strategyLayoutLayouter;
+ this.layouter.setup(uiLayout, this.yLayout);
final BindableTypeResolver resolver = new BindableTypeResolver();
JvmType resolvedType = resolver.resolveType(uiLayout.getAutoWireSource());
if ((resolvedType instanceof JvmDeclaredType)) {
@@ -403,176 +358,179 @@
}
}
- public void createSuspectStructure(final Map<String, OperationExtensions.OperationInfo> opInfoMap, final JvmDeclaredType dtoType, final boolean mobile, final YTypedCompoundSuspect parentSuspect) {
- final Function1<OperationExtensions.OperationInfo, Boolean> _function = (OperationExtensions.OperationInfo it) -> {
- return Boolean.valueOf(this.visible(it));
- };
- final Consumer<OperationExtensions.OperationInfo> _function_1 = (OperationExtensions.OperationInfo it) -> {
- JvmType type = null;
- try {
- type = it.getGetter().getReturnType().getType();
- } catch (final Throwable _t) {
- if (_t instanceof NullPointerException) {
- final NullPointerException e = (NullPointerException)_t;
- return;
- } else {
- throw Exceptions.sneakyThrow(_t);
- }
- }
- YSuspect suspect = null;
- ArrayList<AutowireUtil.Pair> properties = CollectionLiterals.<AutowireUtil.Pair>newArrayList();
- JvmField _field = it.getField();
- boolean _tripleNotEquals = (_field != null);
- if (_tripleNotEquals) {
- String _qualifiedName = it.getField().getDeclaringType().getQualifiedName();
- String _plus = (_qualifiedName + ".");
- String _name = it.getName();
- String _plus_1 = (_plus + _name);
- properties.addAll(this._autowireUtil.toProperties(dtoType, _plus_1));
- }
- boolean _isBoolean = this._typeHelper.isBoolean(type);
- if (_isBoolean) {
- if (mobile) {
- this.createMobileSwitch(type, it);
- } else {
- suspect = this.createCheckbox(type, it);
- }
- } else {
- boolean _isNumberWithDigits = this._typeHelper.isNumberWithDigits(type);
- if (_isNumberWithDigits) {
- suspect = this.createDecimalField(type, it);
- boolean _isAttribute = this._autowireUtil.isAttribute(dtoType, it.getName(), "NumberToUomo");
- if (_isAttribute) {
- EList<String> _tags = suspect.getTags();
- _tags.add(ILayoutingStrategy.TAG__NUMBER_TO_UOMO);
+ public Boolean createSuspectStructure(final Map<String, OperationExtensions.OperationInfo> opInfoMap, final JvmDeclaredType dtoType, final boolean mobile, final YTypedCompoundSuspect parentSuspect) {
+ boolean _xblockexpression = false;
+ {
+ final Function1<OperationExtensions.OperationInfo, Boolean> _function = (OperationExtensions.OperationInfo it) -> {
+ return Boolean.valueOf(this.visible(it));
+ };
+ final Consumer<OperationExtensions.OperationInfo> _function_1 = (OperationExtensions.OperationInfo it) -> {
+ JvmType type = null;
+ try {
+ type = it.getGetter().getReturnType().getType();
+ } catch (final Throwable _t) {
+ if (_t instanceof NullPointerException) {
+ final NullPointerException e = (NullPointerException)_t;
+ return;
} else {
- LDataType dataType = this._autowireUtil.toDataType(dtoType, it.getName());
- if ((dataType != null)) {
- String dataTypeName = dataType.getJvmTypeReference().getType().getIdentifier();
- boolean _equals = dataTypeName.equals(Double.class.getCanonicalName());
- if (_equals) {
- suspect = this.createCustomDecimalField(type, it);
- }
- }
+ throw Exceptions.sneakyThrow(_t);
+ }
+ }
+ YSuspect suspect = null;
+ ArrayList<AutowireUtil.Pair> properties = CollectionLiterals.<AutowireUtil.Pair>newArrayList();
+ JvmField _field = it.getField();
+ boolean _tripleNotEquals = (_field != null);
+ if (_tripleNotEquals) {
+ String _qualifiedName = it.getField().getDeclaringType().getQualifiedName();
+ String _plus = (_qualifiedName + ".");
+ String _name = it.getName();
+ String _plus_1 = (_plus + _name);
+ properties.addAll(this._autowireUtil.toProperties(dtoType, _plus_1));
+ }
+ boolean _isBoolean = this._typeHelper.isBoolean(type);
+ if (_isBoolean) {
+ if (mobile) {
+ this.createMobileSwitch(type, it);
+ } else {
+ suspect = this.createCheckbox(type, it);
}
} else {
- boolean _isNumberWithoutDigits = this._typeHelper.isNumberWithoutDigits(type);
- if (_isNumberWithoutDigits) {
- final Function1<AutowireUtil.Pair, Boolean> _function_2 = (AutowireUtil.Pair it_1) -> {
- return Boolean.valueOf(it_1.key.equals(IPropertyConstants.PROPERTY_KEY__FIELD_TYPE));
- };
- AutowireUtil.Pair _findFirst = IterableExtensions.<AutowireUtil.Pair>findFirst(properties, _function_2);
- String _value = null;
- if (_findFirst!=null) {
- _value=_findFirst.value;
- }
- final String fieldType = _value;
- if (((fieldType != null) && IterableExtensions.<AutowireUtil.Pair>exists(properties, ((Function1<AutowireUtil.Pair, Boolean>) (AutowireUtil.Pair it_1) -> {
- return Boolean.valueOf(fieldType.equalsIgnoreCase(IPropertyConstants.PROPERTY_SLIDER));
- })))) {
- suspect = this.createSlider(type, it, properties);
+ boolean _isNumberWithDigits = this._typeHelper.isNumberWithDigits(type);
+ if (_isNumberWithDigits) {
+ suspect = this.createDecimalField(type, it);
+ boolean _isAttribute = this._autowireUtil.isAttribute(dtoType, it.getName(), "NumberToUomo");
+ if (_isAttribute) {
+ EList<String> _tags = suspect.getTags();
+ _tags.add(ILayoutingStrategy.TAG__NUMBER_TO_UOMO);
} else {
- suspect = this.createNumberField(type, it);
+ LDataType dataType = this._autowireUtil.toDataType(dtoType, it.getName());
+ if ((dataType != null)) {
+ String dataTypeName = dataType.getJvmTypeReference().getType().getIdentifier();
+ boolean _equals = dataTypeName.equals(Double.class.getCanonicalName());
+ if (_equals) {
+ suspect = this.createCustomDecimalField(type, it);
+ }
+ }
}
} else {
- boolean _isString = this._typeHelper.isString(type);
- if (_isString) {
- final Function1<AutowireUtil.Pair, Boolean> _function_3 = (AutowireUtil.Pair it_1) -> {
+ boolean _isNumberWithoutDigits = this._typeHelper.isNumberWithoutDigits(type);
+ if (_isNumberWithoutDigits) {
+ final Function1<AutowireUtil.Pair, Boolean> _function_2 = (AutowireUtil.Pair it_1) -> {
return Boolean.valueOf(it_1.key.equals(IPropertyConstants.PROPERTY_KEY__FIELD_TYPE));
};
- AutowireUtil.Pair _findFirst_1 = IterableExtensions.<AutowireUtil.Pair>findFirst(properties, _function_3);
- String _value_1 = null;
- if (_findFirst_1!=null) {
- _value_1=_findFirst_1.value;
+ AutowireUtil.Pair _findFirst = IterableExtensions.<AutowireUtil.Pair>findFirst(properties, _function_2);
+ String _value = null;
+ if (_findFirst!=null) {
+ _value=_findFirst.value;
}
- final String fieldType_1 = _value_1;
- FunctionTypingAPI functionTypingAPI = new FunctionTypingAPI();
- final String functionImagePicker = functionTypingAPI.getFunctionImagePickerTypeName();
- if (((this.isDomainKey(it) || this.isDomainDescription(it)) || ((!StringExtensions.isNullOrEmpty(fieldType_1)) && fieldType_1.equals(IPropertyConstants.PROPERTY_SUGGESTTEXT)))) {
- suspect = this.createSuggestTextField(type, it, opInfoMap);
+ final String fieldType = _value;
+ if (((fieldType != null) && IterableExtensions.<AutowireUtil.Pair>exists(properties, ((Function1<AutowireUtil.Pair, Boolean>) (AutowireUtil.Pair it_1) -> {
+ return Boolean.valueOf(fieldType.equalsIgnoreCase(IPropertyConstants.PROPERTY_SLIDER));
+ })))) {
+ suspect = this.createSlider(type, it, properties);
} else {
- final Function1<AutowireUtil.Pair, Boolean> _function_4 = (AutowireUtil.Pair it_1) -> {
- return Boolean.valueOf(it_1.key.toLowerCase().equals(IPropertyConstants.PROPERTY_BLOB));
+ suspect = this.createNumberField(type, it);
+ }
+ } else {
+ boolean _isString = this._typeHelper.isString(type);
+ if (_isString) {
+ final Function1<AutowireUtil.Pair, Boolean> _function_3 = (AutowireUtil.Pair it_1) -> {
+ return Boolean.valueOf(it_1.key.equals(IPropertyConstants.PROPERTY_KEY__FIELD_TYPE));
};
- boolean _exists = IterableExtensions.<AutowireUtil.Pair>exists(properties, _function_4);
- if (_exists) {
- suspect = this.createBlopUploadComponent(type, it);
+ AutowireUtil.Pair _findFirst_1 = IterableExtensions.<AutowireUtil.Pair>findFirst(properties, _function_3);
+ String _value_1 = null;
+ if (_findFirst_1!=null) {
+ _value_1=_findFirst_1.value;
+ }
+ final String fieldType_1 = _value_1;
+ FunctionTypingAPI functionTypingAPI = new FunctionTypingAPI();
+ final String functionImagePicker = functionTypingAPI.getFunctionImagePickerTypeName();
+ if (((this.isDomainKey(it) || this.isDomainDescription(it)) || ((!StringExtensions.isNullOrEmpty(fieldType_1)) && fieldType_1.equals(IPropertyConstants.PROPERTY_SUGGESTTEXT)))) {
+ suspect = this.createSuggestTextField(type, it, opInfoMap);
} else {
- if (((!StringExtensions.isNullOrEmpty(fieldType_1)) && fieldType_1.equals(IPropertyConstants.PROPERTY_RICH_TEXT))) {
- suspect = this.createRichTextField(type, it);
+ final Function1<AutowireUtil.Pair, Boolean> _function_4 = (AutowireUtil.Pair it_1) -> {
+ return Boolean.valueOf(it_1.key.toLowerCase().equals(IPropertyConstants.PROPERTY_BLOB));
+ };
+ boolean _exists = IterableExtensions.<AutowireUtil.Pair>exists(properties, _function_4);
+ if (_exists) {
+ suspect = this.createBlopUploadComponent(type, it);
} else {
- if (((!StringExtensions.isNullOrEmpty(fieldType_1)) && fieldType_1.equals(IPropertyConstants.PROPERTY_MASKED_TEXT))) {
- final Function1<AutowireUtil.Pair, Boolean> _function_5 = (AutowireUtil.Pair it_1) -> {
- return Boolean.valueOf(it_1.key.equals(IPropertyConstants.PROPERTY_MASK));
- };
- AutowireUtil.Pair _findFirst_2 = IterableExtensions.<AutowireUtil.Pair>findFirst(properties, _function_5);
- String _value_2 = null;
- if (_findFirst_2!=null) {
- _value_2=_findFirst_2.value;
- }
- final String mask = _value_2;
- suspect = this.createMaskedTextField(type, it, mask);
+ if (((!StringExtensions.isNullOrEmpty(fieldType_1)) && fieldType_1.equals(IPropertyConstants.PROPERTY_RICH_TEXT))) {
+ suspect = this.createRichTextField(type, it);
} else {
- if (((!StringExtensions.isNullOrEmpty(fieldType_1)) && fieldType_1.equals(IPropertyConstants.PROPERTY_PASSWORD))) {
- suspect = this.createPasswordField(type, it);
- } else {
- final Function1<AutowireUtil.Pair, Boolean> _function_6 = (AutowireUtil.Pair it_1) -> {
- return Boolean.valueOf(it_1.key.equalsIgnoreCase(IPropertyConstants.PROPERTY_TEXTAREA));
+ if (((!StringExtensions.isNullOrEmpty(fieldType_1)) && fieldType_1.equals(IPropertyConstants.PROPERTY_MASKED_TEXT))) {
+ final Function1<AutowireUtil.Pair, Boolean> _function_5 = (AutowireUtil.Pair it_1) -> {
+ return Boolean.valueOf(it_1.key.equals(IPropertyConstants.PROPERTY_MASK));
};
- boolean _exists_1 = IterableExtensions.<AutowireUtil.Pair>exists(properties, _function_6);
- if (_exists_1) {
- suspect = this.createTextAreaField(type, it);
+ AutowireUtil.Pair _findFirst_2 = IterableExtensions.<AutowireUtil.Pair>findFirst(properties, _function_5);
+ String _value_2 = null;
+ if (_findFirst_2!=null) {
+ _value_2=_findFirst_2.value;
+ }
+ final String mask = _value_2;
+ suspect = this.createMaskedTextField(type, it, mask);
+ } else {
+ if (((!StringExtensions.isNullOrEmpty(fieldType_1)) && fieldType_1.equals(IPropertyConstants.PROPERTY_PASSWORD))) {
+ suspect = this.createPasswordField(type, it);
} else {
- final Function1<AutowireUtil.Pair, Boolean> _function_7 = (AutowireUtil.Pair it_1) -> {
- return Boolean.valueOf(it_1.key.equalsIgnoreCase(IPropertyConstants.PROPERTY_ORGANIZATION));
+ final Function1<AutowireUtil.Pair, Boolean> _function_6 = (AutowireUtil.Pair it_1) -> {
+ return Boolean.valueOf(it_1.key.equalsIgnoreCase(IPropertyConstants.PROPERTY_TEXTAREA));
};
- boolean _exists_2 = IterableExtensions.<AutowireUtil.Pair>exists(properties, _function_7);
- if (_exists_2) {
- suspect = this.createOrganizationComboBox(type, it);
+ boolean _exists_1 = IterableExtensions.<AutowireUtil.Pair>exists(properties, _function_6);
+ if (_exists_1) {
+ suspect = this.createTextAreaField(type, it);
} else {
- final Function1<AutowireUtil.Pair, Boolean> _function_8 = (AutowireUtil.Pair it_1) -> {
- return Boolean.valueOf(it_1.key.equalsIgnoreCase(IPropertyConstants.PROPERTY_PERSPECTIVE));
+ final Function1<AutowireUtil.Pair, Boolean> _function_7 = (AutowireUtil.Pair it_1) -> {
+ return Boolean.valueOf(it_1.key.equalsIgnoreCase(IPropertyConstants.PROPERTY_ORGANIZATION));
};
- boolean _exists_3 = IterableExtensions.<AutowireUtil.Pair>exists(properties, _function_8);
- if (_exists_3) {
- suspect = this.createPerspectiveComboBox(type, it);
+ boolean _exists_2 = IterableExtensions.<AutowireUtil.Pair>exists(properties, _function_7);
+ if (_exists_2) {
+ suspect = this.createOrganizationComboBox(type, it);
} else {
- final Function1<AutowireUtil.Pair, Boolean> _function_9 = (AutowireUtil.Pair it_1) -> {
- return Boolean.valueOf(it_1.key.equalsIgnoreCase(IPropertyConstants.PROPERTY_PRINTSERVICE));
+ final Function1<AutowireUtil.Pair, Boolean> _function_8 = (AutowireUtil.Pair it_1) -> {
+ return Boolean.valueOf(it_1.key.equalsIgnoreCase(IPropertyConstants.PROPERTY_PERSPECTIVE));
};
- boolean _exists_4 = IterableExtensions.<AutowireUtil.Pair>exists(properties, _function_9);
- if (_exists_4) {
- suspect = this.createPrintServiceComboBox(type, it);
+ boolean _exists_3 = IterableExtensions.<AutowireUtil.Pair>exists(properties, _function_8);
+ if (_exists_3) {
+ suspect = this.createPerspectiveComboBox(type, it);
} else {
- final Function1<AutowireUtil.Pair, Boolean> _function_10 = (AutowireUtil.Pair it_1) -> {
- return Boolean.valueOf(it_1.key.equalsIgnoreCase(IPropertyConstants.PROPERTY_I18N));
+ final Function1<AutowireUtil.Pair, Boolean> _function_9 = (AutowireUtil.Pair it_1) -> {
+ return Boolean.valueOf(it_1.key.equalsIgnoreCase(IPropertyConstants.PROPERTY_PRINTSERVICE));
};
- boolean _exists_5 = IterableExtensions.<AutowireUtil.Pair>exists(properties, _function_10);
- if (_exists_5) {
- suspect = this.createI18nComboBox(type, it);
+ boolean _exists_4 = IterableExtensions.<AutowireUtil.Pair>exists(properties, _function_9);
+ if (_exists_4) {
+ suspect = this.createPrintServiceComboBox(type, it);
} else {
- final Function1<AutowireUtil.Pair, Boolean> _function_11 = (AutowireUtil.Pair it_1) -> {
- return Boolean.valueOf(it_1.key.equalsIgnoreCase(IPropertyConstants.PROPERTY_THEME));
+ final Function1<AutowireUtil.Pair, Boolean> _function_10 = (AutowireUtil.Pair it_1) -> {
+ return Boolean.valueOf(it_1.key.equalsIgnoreCase(IPropertyConstants.PROPERTY_I18N));
};
- boolean _exists_6 = IterableExtensions.<AutowireUtil.Pair>exists(properties, _function_11);
- if (_exists_6) {
- suspect = this.createThemeComboBox(type, it);
+ boolean _exists_5 = IterableExtensions.<AutowireUtil.Pair>exists(properties, _function_10);
+ if (_exists_5) {
+ suspect = this.createI18nComboBox(type, it);
} else {
- final Function1<AutowireUtil.Pair, Boolean> _function_12 = (AutowireUtil.Pair it_1) -> {
- return Boolean.valueOf(it_1.key.equalsIgnoreCase(IPropertyConstants.PROPERTY_MODEL));
+ final Function1<AutowireUtil.Pair, Boolean> _function_11 = (AutowireUtil.Pair it_1) -> {
+ return Boolean.valueOf(it_1.key.equalsIgnoreCase(IPropertyConstants.PROPERTY_THEME));
};
- boolean _exists_7 = IterableExtensions.<AutowireUtil.Pair>exists(properties, _function_12);
- if (_exists_7) {
- suspect = this.createModelComboBox(type, it);
+ boolean _exists_6 = IterableExtensions.<AutowireUtil.Pair>exists(properties, _function_11);
+ if (_exists_6) {
+ suspect = this.createThemeComboBox(type, it);
} else {
- final Function1<AutowireUtil.Pair, Boolean> _function_13 = (AutowireUtil.Pair it_1) -> {
- return Boolean.valueOf(it_1.key.equalsIgnoreCase(functionImagePicker));
+ final Function1<AutowireUtil.Pair, Boolean> _function_12 = (AutowireUtil.Pair it_1) -> {
+ return Boolean.valueOf(it_1.key.equalsIgnoreCase(IPropertyConstants.PROPERTY_MODEL));
};
- boolean _exists_8 = IterableExtensions.<AutowireUtil.Pair>exists(properties, _function_13);
- if (_exists_8) {
- suspect = this.createIconComboBox(type, it);
+ boolean _exists_7 = IterableExtensions.<AutowireUtil.Pair>exists(properties, _function_12);
+ if (_exists_7) {
+ suspect = this.createModelComboBox(type, it);
} else {
- suspect = this.createTextField(type, it);
+ final Function1<AutowireUtil.Pair, Boolean> _function_13 = (AutowireUtil.Pair it_1) -> {
+ return Boolean.valueOf(it_1.key.equalsIgnoreCase(functionImagePicker));
+ };
+ boolean _exists_8 = IterableExtensions.<AutowireUtil.Pair>exists(properties, _function_13);
+ if (_exists_8) {
+ suspect = this.createIconComboBox(type, it);
+ } else {
+ suspect = this.createTextField(type, it);
+ }
}
}
}
@@ -585,59 +543,62 @@
}
}
}
- }
- } else {
- boolean _isDate = this._typeHelper.isDate(type);
- if (_isDate) {
- suspect = this.createDateField(type, it);
} else {
- boolean _isEnum = this._typeHelper.isEnum(type);
- if (_isEnum) {
- final Function1<AutowireUtil.Pair, Boolean> _function_14 = (AutowireUtil.Pair it_1) -> {
- return Boolean.valueOf(it_1.key.toLowerCase().equals(IPropertyConstants.PROPERTY_OPTION_GROUP));
- };
- boolean _exists_9 = IterableExtensions.<AutowireUtil.Pair>exists(properties, _function_14);
- if (_exists_9) {
- suspect = this.createEnumOptionsGroup(type, it);
- } else {
- suspect = this.createEnumComboBox(type, it);
- }
+ boolean _isDate = this._typeHelper.isDate(type);
+ if (_isDate) {
+ suspect = this.createDateField(type, it);
} else {
- boolean _isByteArray = this.isByteArray(type);
- if (_isByteArray) {
- final Function1<AutowireUtil.Pair, Boolean> _function_15 = (AutowireUtil.Pair it_1) -> {
- return Boolean.valueOf(it_1.key.equals(IPropertyConstants.PROPERTY_KEY__FIELD_TYPE));
+ boolean _isEnum = this._typeHelper.isEnum(type);
+ if (_isEnum) {
+ final Function1<AutowireUtil.Pair, Boolean> _function_14 = (AutowireUtil.Pair it_1) -> {
+ return Boolean.valueOf(it_1.key.toLowerCase().equals(IPropertyConstants.PROPERTY_OPTION_GROUP));
};
- AutowireUtil.Pair _findFirst_3 = IterableExtensions.<AutowireUtil.Pair>findFirst(properties, _function_15);
- String _value_3 = null;
- if (_findFirst_3!=null) {
- _value_3=_findFirst_3.value;
- }
- final String fieldType_2 = _value_3;
- if (((!StringExtensions.isNullOrEmpty(fieldType_2)) && fieldType_2.equals(IPropertyConstants.PROPERTY_RICH_TEXT))) {
- suspect = this.createRichTextField(type, it);
+ boolean _exists_9 = IterableExtensions.<AutowireUtil.Pair>exists(properties, _function_14);
+ if (_exists_9) {
+ suspect = this.createEnumOptionsGroup(type, it);
} else {
- suspect = this.createBlopUploadComponent(type, it);
+ suspect = this.createEnumComboBox(type, it);
}
} else {
- boolean _isDomainReference = this._typeHelper.isDomainReference(it);
- if (_isDomainReference) {
- suspect = this.createBeanReferenceField(type, it);
+ boolean _isByteArray = this.isByteArray(type);
+ if (_isByteArray) {
+ final Function1<AutowireUtil.Pair, Boolean> _function_15 = (AutowireUtil.Pair it_1) -> {
+ return Boolean.valueOf(it_1.key.equals(IPropertyConstants.PROPERTY_KEY__FIELD_TYPE));
+ };
+ AutowireUtil.Pair _findFirst_3 = IterableExtensions.<AutowireUtil.Pair>findFirst(properties, _function_15);
+ String _value_3 = null;
+ if (_findFirst_3!=null) {
+ _value_3=_findFirst_3.value;
+ }
+ final String fieldType_2 = _value_3;
+ if (((!StringExtensions.isNullOrEmpty(fieldType_2)) && fieldType_2.equals(IPropertyConstants.PROPERTY_RICH_TEXT))) {
+ suspect = this.createRichTextField(type, it);
+ } else {
+ suspect = this.createBlopUploadComponent(type, it);
+ }
} else {
- if (((it.getField() != null) && this._typeHelper.isCollection(it.getField()))) {
- boolean _asGrid = it.asGrid();
- if (_asGrid) {
- suspect = this.createGrid(type, it);
- } else {
- boolean _asTable = it.asTable();
- if (_asTable) {
- suspect = this.createTableField(type, it);
- }
+ if ((this._typeHelper.isDomainReference(it) && (!it.isHidden()))) {
+ suspect = this.createBeanReferenceField(type, it);
+ boolean _isReadonly = it.isReadonly();
+ if (_isReadonly) {
+ suspect.getTags().add(ILayoutingStrategy.TAG__READONLY);
}
} else {
- boolean _isDto = this.isDto(type);
- if (_isDto) {
- suspect = this.createDtoSuspect(type, it);
+ if (((it.getField() != null) && this._typeHelper.isCollection(it.getField()))) {
+ boolean _asGrid = it.asGrid();
+ if (_asGrid) {
+ suspect = this.createGrid(type, it);
+ } else {
+ boolean _asTable = it.asTable();
+ if (_asTable) {
+ suspect = this.createTableField(type, it);
+ }
+ }
+ } else {
+ boolean _isDto = this.isDto(type);
+ if (_isDto) {
+ suspect = this.createDtoSuspect(type, it);
+ }
}
}
}
@@ -647,23 +608,53 @@
}
}
}
- }
- if (((suspect != null) && it.isGroupMember())) {
- suspect.getTags().add(ILayoutingStrategy.TAG__GROUP);
- suspect.setGroupName(it.getGroupMemberName());
- }
- if ((parentSuspect == null)) {
- this.completeSuspect(type, it, suspect, dtoType);
- } else {
- this.completeSuspect(type, it, suspect, parentSuspect, dtoType);
- }
- for (final AutowireUtil.Pair keyAndValue : properties) {
- if ((suspect != null)) {
- suspect.getProperties().put(keyAndValue.key.toLowerCase(), keyAndValue.value);
+ if (((suspect != null) && it.isGroupMember())) {
+ suspect.getTags().add(ILayoutingStrategy.TAG__GROUP);
+ suspect.setGroupName(it.getAnnotationValue(UIGroup.class, 0));
}
+ if (((suspect != null) && it.hasExtraStyle())) {
+ suspect.getTags().add(ILayoutingStrategy.TAG__EXTRASTYLE);
+ suspect.setStyleName(it.getAnnotationValue(ExtraStyle.class, 0));
+ }
+ if ((parentSuspect == null)) {
+ this.completeSuspect(type, it, suspect, dtoType);
+ } else {
+ this.completeSuspect(type, it, suspect, parentSuspect, dtoType);
+ }
+ for (final AutowireUtil.Pair keyAndValue : properties) {
+ if ((suspect != null)) {
+ suspect.getProperties().put(keyAndValue.key.toLowerCase(), keyAndValue.value);
+ }
+ }
+ };
+ IterableExtensions.<OperationExtensions.OperationInfo>filter(opInfoMap.values(), _function).forEach(_function_1);
+ boolean _xifexpression = false;
+ boolean _isSaveAndNew = this.uiLayout.isSaveAndNew();
+ if (_isSaveAndNew) {
+ boolean _xblockexpression_1 = false;
+ {
+ YTypedSuspect suspect = this.createSaveAndNew();
+ StringConcatenation _builder = new StringConcatenation();
+ String _generateId = this._autowireUtil.generateId(this.uiLayout);
+ _builder.append(_generateId);
+ _builder.append(".");
+ _builder.append(ILayoutingStrategy.TAG__SAVEANDNEW);
+ suspect.setId(_builder.toString());
+ suspect.setLabel(I18NKeyGenerator.key(ILayoutingStrategy.TAG__SAVEANDNEW));
+ suspect.setLabelI18nKey(I18NKeyGenerator.key(ILayoutingStrategy.TAG__SAVEANDNEW));
+ boolean _xifexpression_1 = false;
+ if ((parentSuspect != null)) {
+ _xifexpression_1 = parentSuspect.getChildren().add(suspect);
+ } else {
+ this.layouter.add(suspect);
+ }
+ _xblockexpression_1 = _xifexpression_1;
+ }
+ _xifexpression = _xblockexpression_1;
}
- };
- IterableExtensions.<OperationExtensions.OperationInfo>filter(opInfoMap.values(), _function).forEach(_function_1);
+ _xblockexpression = _xifexpression;
+ }
+ return Boolean.valueOf(_xblockexpression);
}
public boolean visible(final OperationExtensions.OperationInfo info) {
@@ -1094,6 +1085,18 @@
return _xblockexpression;
}
+ public YTypedSuspect createSaveAndNew() {
+ YTypedSuspect _xblockexpression = null;
+ {
+ final YTypedSuspect suspect = YECviewFactory.eINSTANCE.createYTypedSuspect();
+ EList<String> _tags = suspect.getTags();
+ _tags.add(ILayoutingStrategy.TAG__SAVEANDNEW);
+ suspect.setTypeQualifiedName(StringExtensions.toFirstUpper(ILayoutingStrategy.TAG__SAVEANDNEW));
+ _xblockexpression = suspect;
+ }
+ return _xblockexpression;
+ }
+
public YTypedSuspect createDecimalField(final JvmType type, final OperationExtensions.OperationInfo info) {
YTypedSuspect _xblockexpression = null;
{
@@ -1531,8 +1534,7 @@
} else {
String _qualifiedName = type.getQualifiedName();
String _plus = ("RichTextFields need to be bound to String or byte[]. " + _qualifiedName);
- String _plus_1 = (_plus +
- " is not a valid option.");
+ String _plus_1 = (_plus + " is not a valid option.");
throw new IllegalArgumentException(_plus_1);
}
}
@@ -1675,6 +1677,16 @@
path = propertyPath;
}
suspect.getValueBindingEndpoints().add(endpoint);
+ boolean _contains = suspect.getTags().contains(ILayoutingStrategy.TAG__SUGGEST_TEXT);
+ if (_contains) {
+ UiBindingExpression _autoWireSource_1 = this.uiLayout.getAutoWireSource();
+ final UiBindingEndpointAssignment uiModelEndpoint_1 = ((UiBindingEndpointAssignment) _autoWireSource_1);
+ YValueBindingEndpoint yModelEndpoint_1 = this.computer.createValueBindingEndpoint(uiModelEndpoint_1);
+ yModelEndpoint_1 = EcoreUtil.<YValueBindingEndpoint>copy(yModelEndpoint_1);
+ EList<String> _tags = yModelEndpoint_1.getTags();
+ _tags.add("dtoBinding");
+ suspect.getValueBindingEndpoints().add(yModelEndpoint_1);
+ }
suspect.setLabelI18nKey(path);
suspect.setLabel(propertyPath);
}
diff --git a/org.eclipse.osbp.autowireHelper/xtend-gen/org/eclipse/osbp/autowirehelper/utils/AutowireUtil.java b/org.eclipse.osbp.autowireHelper/xtend-gen/org/eclipse/osbp/autowirehelper/utils/AutowireUtil.java
index bf71f19..98f290c 100644
--- a/org.eclipse.osbp.autowireHelper/xtend-gen/org/eclipse/osbp/autowirehelper/utils/AutowireUtil.java
+++ b/org.eclipse.osbp.autowireHelper/xtend-gen/org/eclipse/osbp/autowirehelper/utils/AutowireUtil.java
@@ -64,7 +64,6 @@
import org.eclipse.xtext.common.types.JvmTypeAnnotationValue;
import org.eclipse.xtext.common.types.JvmTypeReference;
import org.eclipse.xtext.common.types.util.TypeReferences;
-import org.eclipse.xtext.naming.IQualifiedNameProvider;
import org.eclipse.xtext.xbase.lib.CollectionLiterals;
import org.eclipse.xtext.xbase.lib.Extension;
import org.eclipse.xtext.xbase.lib.Functions.Function1;
@@ -118,10 +117,6 @@
@Inject
@Extension
- private IQualifiedNameProvider _iQualifiedNameProvider;
-
- @Inject
- @Extension
private TypeHelper _typeHelper;
@Inject
@@ -145,18 +140,16 @@
String _packageName = uimodel.getPackageName();
_builder.append(_packageName);
{
- boolean _notEquals = (!Objects.equal(viewName, null));
- if (_notEquals) {
+ if ((viewName != null)) {
_builder.append(".");
_builder.append(viewName);
}
}
{
- boolean _notEquals_1 = (!Objects.equal(resolvedType, null));
- if (_notEquals_1) {
+ if ((resolvedType != null)) {
_builder.append(".");
- String _identifier = resolvedType.getIdentifier();
- _builder.append(_identifier);
+ String _simpleName = resolvedType.getSimpleName();
+ _builder.append(_simpleName);
}
}
return _builder.toString();