catch up with branch daily
Signed-off-by: Ralf Mollik <ramollik@compex-commerce.com>
diff --git a/jenkins.build.config.xml b/jenkins.build.config.xml
index 001d70d..16c87af 100644
--- a/jenkins.build.config.xml
+++ b/jenkins.build.config.xml
@@ -24,5 +24,7 @@
<jenkins.build.dependency>org.eclipse.osbp.ecview.extension.api</jenkins.build.dependency>
<jenkins.build.dependency>org.eclipse.osbp.jpa.services</jenkins.build.dependency>
<jenkins.build.dependency>org.eclipse.osbp.runtime</jenkins.build.dependency>
+ <jenkins.build.dependency>org.eclipse.osbp.xtext.datamart.common</jenkins.build.dependency>
+ <jenkins.build.dependency>org.eclipse.osbp.xtext.table.common</jenkins.build.dependency>
</jenkins.build.dependencies>
</jenkins>
diff --git a/org.eclipse.osbp.runtime.tests/META-INF/persistence.xml b/org.eclipse.osbp.runtime.tests/META-INF/persistence.xml
index cd02123..72663b2 100644
--- a/org.eclipse.osbp.runtime.tests/META-INF/persistence.xml
+++ b/org.eclipse.osbp.runtime.tests/META-INF/persistence.xml
@@ -14,19 +14,6 @@
transaction-type="RESOURCE_LOCAL">
<provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
<class>org.osbp.tests.entities.DtoTestParent</class>
- <class>org.osbp.tests.entities.DtoTestChildContainment</class>
- <class>org.osbp.tests.entities.DtoTestChildCrossRef</class>
- <class>org.osbp.tests.entities.Mcustomer</class>
- <class>org.osbp.tests.entities.CashRegister</class>
- <class>org.osbp.tests.entities.CashSlip</class>
- <class>org.osbp.tests.entities.CashPosition</class>
- <class>org.osbp.tests.entities.CashPayment</class>
- <class>org.osbp.tests.entities.CashPaymentMethod</class>
- <class>org.osbp.tests.entities.CompanyRelationType</class>
- <class>org.osbp.tests.entities.CompanyGroup</class>
- <class>org.osbp.tests.entities.Company</class>
- <class>org.osbp.tests.entities.Address</class>
- <class>org.osbp.tests.entities.Department</class>
<exclude-unlisted-classes>true</exclude-unlisted-classes>
</persistence-unit>
diff --git a/org.eclipse.osbp.runtime.tests/OSGI-INF/org.osbp.tests.dtos.service.AddressDtoService.xml b/org.eclipse.osbp.runtime.tests/OSGI-INF/org.osbp.tests.dtos.service.AddressDtoService.xml
deleted file mode 100644
index 3370ce2..0000000
--- a/org.eclipse.osbp.runtime.tests/OSGI-INF/org.osbp.tests.dtos.service.AddressDtoService.xml
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" name="org.osbp.tests.dtos.service.addressdtoservice">
- <implementation class="org.osbp.tests.dtos.service.AddressDtoService"/>
- <service>
- <provide interface="org.eclipse.osbp.runtime.common.filter.IDTOService"/>
- </service>
- <property name="dto" type="String" value="org.osbp.tests.dtos.AddressDto"/>
- <property name="service.pid" type="String" value="org.osbp.tests.dtos.service.addressdtoservice"/>
-<reference name="mapperAccess" interface="org.eclipse.osbp.dsl.dto.lib.IMapperAccess" cardinality="1..1"
- policy="dynamic" bind="bindMapperAccess" unbind="unbindMapperAccess"/>
-<reference name="filterEnhancers" interface="org.eclipse.osbp.runtime.common.filter.IFilterEnhancer" cardinality="0..n"
- policy="dynamic" bind="addFilterEnhancer" unbind="removeFilterEnhancer"/>
-<reference name="sessionManager" interface="org.eclipse.osbp.runtime.common.session.ISessionManager" cardinality="1..1"
- policy="dynamic" bind="bindSessionManager" unbind="unbindSessionManager"/>
-<reference name="validators" interface="org.eclipse.osbp.runtime.common.validation.IValidationParticipant" cardinality="0..n"
- policy="dynamic" bind="addValidationParticipant" unbind="removeValidationParticipant"/>
-</scr:component>
diff --git a/org.eclipse.osbp.runtime.tests/OSGI-INF/org.osbp.tests.dtos.service.CashPaymentDtoService.xml b/org.eclipse.osbp.runtime.tests/OSGI-INF/org.osbp.tests.dtos.service.CashPaymentDtoService.xml
deleted file mode 100644
index 578461c..0000000
--- a/org.eclipse.osbp.runtime.tests/OSGI-INF/org.osbp.tests.dtos.service.CashPaymentDtoService.xml
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" name="org.osbp.tests.dtos.service.cashpaymentdtoservice">
- <implementation class="org.osbp.tests.dtos.service.CashPaymentDtoService"/>
- <service>
- <provide interface="org.eclipse.osbp.runtime.common.filter.IDTOService"/>
- </service>
- <property name="dto" type="String" value="org.osbp.tests.dtos.CashPaymentDto"/>
- <property name="service.pid" type="String" value="org.osbp.tests.dtos.service.cashpaymentdtoservice"/>
-<reference name="mapperAccess" interface="org.eclipse.osbp.dsl.dto.lib.IMapperAccess" cardinality="1..1"
- policy="dynamic" bind="bindMapperAccess" unbind="unbindMapperAccess"/>
-<reference name="filterEnhancers" interface="org.eclipse.osbp.runtime.common.filter.IFilterEnhancer" cardinality="0..n"
- policy="dynamic" bind="addFilterEnhancer" unbind="removeFilterEnhancer"/>
-<reference name="sessionManager" interface="org.eclipse.osbp.runtime.common.session.ISessionManager" cardinality="1..1"
- policy="dynamic" bind="bindSessionManager" unbind="unbindSessionManager"/>
-<reference name="validators" interface="org.eclipse.osbp.runtime.common.validation.IValidationParticipant" cardinality="0..n"
- policy="dynamic" bind="addValidationParticipant" unbind="removeValidationParticipant"/>
-</scr:component>
diff --git a/org.eclipse.osbp.runtime.tests/OSGI-INF/org.osbp.tests.dtos.service.CashPaymentMethodDtoService.xml b/org.eclipse.osbp.runtime.tests/OSGI-INF/org.osbp.tests.dtos.service.CashPaymentMethodDtoService.xml
deleted file mode 100644
index bf7a3a1..0000000
--- a/org.eclipse.osbp.runtime.tests/OSGI-INF/org.osbp.tests.dtos.service.CashPaymentMethodDtoService.xml
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" name="org.osbp.tests.dtos.service.cashpaymentmethoddtoservice">
- <implementation class="org.osbp.tests.dtos.service.CashPaymentMethodDtoService"/>
- <service>
- <provide interface="org.eclipse.osbp.runtime.common.filter.IDTOService"/>
- </service>
- <property name="dto" type="String" value="org.osbp.tests.dtos.CashPaymentMethodDto"/>
- <property name="service.pid" type="String" value="org.osbp.tests.dtos.service.cashpaymentmethoddtoservice"/>
-<reference name="mapperAccess" interface="org.eclipse.osbp.dsl.dto.lib.IMapperAccess" cardinality="1..1"
- policy="dynamic" bind="bindMapperAccess" unbind="unbindMapperAccess"/>
-<reference name="filterEnhancers" interface="org.eclipse.osbp.runtime.common.filter.IFilterEnhancer" cardinality="0..n"
- policy="dynamic" bind="addFilterEnhancer" unbind="removeFilterEnhancer"/>
-<reference name="sessionManager" interface="org.eclipse.osbp.runtime.common.session.ISessionManager" cardinality="1..1"
- policy="dynamic" bind="bindSessionManager" unbind="unbindSessionManager"/>
-<reference name="validators" interface="org.eclipse.osbp.runtime.common.validation.IValidationParticipant" cardinality="0..n"
- policy="dynamic" bind="addValidationParticipant" unbind="removeValidationParticipant"/>
-</scr:component>
diff --git a/org.eclipse.osbp.runtime.tests/OSGI-INF/org.osbp.tests.dtos.service.CashPositionDtoService.xml b/org.eclipse.osbp.runtime.tests/OSGI-INF/org.osbp.tests.dtos.service.CashPositionDtoService.xml
deleted file mode 100644
index 8ef5126..0000000
--- a/org.eclipse.osbp.runtime.tests/OSGI-INF/org.osbp.tests.dtos.service.CashPositionDtoService.xml
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" name="org.osbp.tests.dtos.service.cashpositiondtoservice">
- <implementation class="org.osbp.tests.dtos.service.CashPositionDtoService"/>
- <service>
- <provide interface="org.eclipse.osbp.runtime.common.filter.IDTOService"/>
- </service>
- <property name="dto" type="String" value="org.osbp.tests.dtos.CashPositionDto"/>
- <property name="service.pid" type="String" value="org.osbp.tests.dtos.service.cashpositiondtoservice"/>
-<reference name="mapperAccess" interface="org.eclipse.osbp.dsl.dto.lib.IMapperAccess" cardinality="1..1"
- policy="dynamic" bind="bindMapperAccess" unbind="unbindMapperAccess"/>
-<reference name="filterEnhancers" interface="org.eclipse.osbp.runtime.common.filter.IFilterEnhancer" cardinality="0..n"
- policy="dynamic" bind="addFilterEnhancer" unbind="removeFilterEnhancer"/>
-<reference name="sessionManager" interface="org.eclipse.osbp.runtime.common.session.ISessionManager" cardinality="1..1"
- policy="dynamic" bind="bindSessionManager" unbind="unbindSessionManager"/>
-<reference name="validators" interface="org.eclipse.osbp.runtime.common.validation.IValidationParticipant" cardinality="0..n"
- policy="dynamic" bind="addValidationParticipant" unbind="removeValidationParticipant"/>
-</scr:component>
diff --git a/org.eclipse.osbp.runtime.tests/OSGI-INF/org.osbp.tests.dtos.service.CashRegisterDtoService.xml b/org.eclipse.osbp.runtime.tests/OSGI-INF/org.osbp.tests.dtos.service.CashRegisterDtoService.xml
deleted file mode 100644
index 76b3479..0000000
--- a/org.eclipse.osbp.runtime.tests/OSGI-INF/org.osbp.tests.dtos.service.CashRegisterDtoService.xml
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" name="org.osbp.tests.dtos.service.cashregisterdtoservice">
- <implementation class="org.osbp.tests.dtos.service.CashRegisterDtoService"/>
- <service>
- <provide interface="org.eclipse.osbp.runtime.common.filter.IDTOService"/>
- </service>
- <property name="dto" type="String" value="org.osbp.tests.dtos.CashRegisterDto"/>
- <property name="service.pid" type="String" value="org.osbp.tests.dtos.service.cashregisterdtoservice"/>
-<reference name="mapperAccess" interface="org.eclipse.osbp.dsl.dto.lib.IMapperAccess" cardinality="1..1"
- policy="dynamic" bind="bindMapperAccess" unbind="unbindMapperAccess"/>
-<reference name="filterEnhancers" interface="org.eclipse.osbp.runtime.common.filter.IFilterEnhancer" cardinality="0..n"
- policy="dynamic" bind="addFilterEnhancer" unbind="removeFilterEnhancer"/>
-<reference name="sessionManager" interface="org.eclipse.osbp.runtime.common.session.ISessionManager" cardinality="1..1"
- policy="dynamic" bind="bindSessionManager" unbind="unbindSessionManager"/>
-<reference name="validators" interface="org.eclipse.osbp.runtime.common.validation.IValidationParticipant" cardinality="0..n"
- policy="dynamic" bind="addValidationParticipant" unbind="removeValidationParticipant"/>
-</scr:component>
diff --git a/org.eclipse.osbp.runtime.tests/OSGI-INF/org.osbp.tests.dtos.service.CashSlipDtoService.xml b/org.eclipse.osbp.runtime.tests/OSGI-INF/org.osbp.tests.dtos.service.CashSlipDtoService.xml
deleted file mode 100644
index 2eb8842..0000000
--- a/org.eclipse.osbp.runtime.tests/OSGI-INF/org.osbp.tests.dtos.service.CashSlipDtoService.xml
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" name="org.osbp.tests.dtos.service.cashslipdtoservice">
- <implementation class="org.osbp.tests.dtos.service.CashSlipDtoService"/>
- <service>
- <provide interface="org.eclipse.osbp.runtime.common.filter.IDTOService"/>
- </service>
- <property name="dto" type="String" value="org.osbp.tests.dtos.CashSlipDto"/>
- <property name="service.pid" type="String" value="org.osbp.tests.dtos.service.cashslipdtoservice"/>
-<reference name="mapperAccess" interface="org.eclipse.osbp.dsl.dto.lib.IMapperAccess" cardinality="1..1"
- policy="dynamic" bind="bindMapperAccess" unbind="unbindMapperAccess"/>
-<reference name="filterEnhancers" interface="org.eclipse.osbp.runtime.common.filter.IFilterEnhancer" cardinality="0..n"
- policy="dynamic" bind="addFilterEnhancer" unbind="removeFilterEnhancer"/>
-<reference name="sessionManager" interface="org.eclipse.osbp.runtime.common.session.ISessionManager" cardinality="1..1"
- policy="dynamic" bind="bindSessionManager" unbind="unbindSessionManager"/>
-<reference name="validators" interface="org.eclipse.osbp.runtime.common.validation.IValidationParticipant" cardinality="0..n"
- policy="dynamic" bind="addValidationParticipant" unbind="removeValidationParticipant"/>
-</scr:component>
diff --git a/org.eclipse.osbp.runtime.tests/OSGI-INF/org.osbp.tests.dtos.service.CompanyDtoService.xml b/org.eclipse.osbp.runtime.tests/OSGI-INF/org.osbp.tests.dtos.service.CompanyDtoService.xml
deleted file mode 100644
index 65fa42c..0000000
--- a/org.eclipse.osbp.runtime.tests/OSGI-INF/org.osbp.tests.dtos.service.CompanyDtoService.xml
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" name="org.osbp.tests.dtos.service.companydtoservice">
- <implementation class="org.osbp.tests.dtos.service.CompanyDtoService"/>
- <service>
- <provide interface="org.eclipse.osbp.runtime.common.filter.IDTOService"/>
- </service>
- <property name="dto" type="String" value="org.osbp.tests.dtos.CompanyDto"/>
- <property name="service.pid" type="String" value="org.osbp.tests.dtos.service.companydtoservice"/>
-<reference name="mapperAccess" interface="org.eclipse.osbp.dsl.dto.lib.IMapperAccess" cardinality="1..1"
- policy="dynamic" bind="bindMapperAccess" unbind="unbindMapperAccess"/>
-<reference name="filterEnhancers" interface="org.eclipse.osbp.runtime.common.filter.IFilterEnhancer" cardinality="0..n"
- policy="dynamic" bind="addFilterEnhancer" unbind="removeFilterEnhancer"/>
-<reference name="sessionManager" interface="org.eclipse.osbp.runtime.common.session.ISessionManager" cardinality="1..1"
- policy="dynamic" bind="bindSessionManager" unbind="unbindSessionManager"/>
-<reference name="validators" interface="org.eclipse.osbp.runtime.common.validation.IValidationParticipant" cardinality="0..n"
- policy="dynamic" bind="addValidationParticipant" unbind="removeValidationParticipant"/>
-</scr:component>
diff --git a/org.eclipse.osbp.runtime.tests/OSGI-INF/org.osbp.tests.dtos.service.CompanyGroupDtoService.xml b/org.eclipse.osbp.runtime.tests/OSGI-INF/org.osbp.tests.dtos.service.CompanyGroupDtoService.xml
deleted file mode 100644
index bf271c2..0000000
--- a/org.eclipse.osbp.runtime.tests/OSGI-INF/org.osbp.tests.dtos.service.CompanyGroupDtoService.xml
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" name="org.osbp.tests.dtos.service.companygroupdtoservice">
- <implementation class="org.osbp.tests.dtos.service.CompanyGroupDtoService"/>
- <service>
- <provide interface="org.eclipse.osbp.runtime.common.filter.IDTOService"/>
- </service>
- <property name="dto" type="String" value="org.osbp.tests.dtos.CompanyGroupDto"/>
- <property name="service.pid" type="String" value="org.osbp.tests.dtos.service.companygroupdtoservice"/>
-<reference name="mapperAccess" interface="org.eclipse.osbp.dsl.dto.lib.IMapperAccess" cardinality="1..1"
- policy="dynamic" bind="bindMapperAccess" unbind="unbindMapperAccess"/>
-<reference name="filterEnhancers" interface="org.eclipse.osbp.runtime.common.filter.IFilterEnhancer" cardinality="0..n"
- policy="dynamic" bind="addFilterEnhancer" unbind="removeFilterEnhancer"/>
-<reference name="sessionManager" interface="org.eclipse.osbp.runtime.common.session.ISessionManager" cardinality="1..1"
- policy="dynamic" bind="bindSessionManager" unbind="unbindSessionManager"/>
-<reference name="validators" interface="org.eclipse.osbp.runtime.common.validation.IValidationParticipant" cardinality="0..n"
- policy="dynamic" bind="addValidationParticipant" unbind="removeValidationParticipant"/>
-</scr:component>
diff --git a/org.eclipse.osbp.runtime.tests/OSGI-INF/org.osbp.tests.dtos.service.CompanyRelationTypeDtoService.xml b/org.eclipse.osbp.runtime.tests/OSGI-INF/org.osbp.tests.dtos.service.CompanyRelationTypeDtoService.xml
deleted file mode 100644
index be83807..0000000
--- a/org.eclipse.osbp.runtime.tests/OSGI-INF/org.osbp.tests.dtos.service.CompanyRelationTypeDtoService.xml
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" name="org.osbp.tests.dtos.service.companyrelationtypedtoservice">
- <implementation class="org.osbp.tests.dtos.service.CompanyRelationTypeDtoService"/>
- <service>
- <provide interface="org.eclipse.osbp.runtime.common.filter.IDTOService"/>
- </service>
- <property name="dto" type="String" value="org.osbp.tests.dtos.CompanyRelationTypeDto"/>
- <property name="service.pid" type="String" value="org.osbp.tests.dtos.service.companyrelationtypedtoservice"/>
-<reference name="mapperAccess" interface="org.eclipse.osbp.dsl.dto.lib.IMapperAccess" cardinality="1..1"
- policy="dynamic" bind="bindMapperAccess" unbind="unbindMapperAccess"/>
-<reference name="filterEnhancers" interface="org.eclipse.osbp.runtime.common.filter.IFilterEnhancer" cardinality="0..n"
- policy="dynamic" bind="addFilterEnhancer" unbind="removeFilterEnhancer"/>
-<reference name="sessionManager" interface="org.eclipse.osbp.runtime.common.session.ISessionManager" cardinality="1..1"
- policy="dynamic" bind="bindSessionManager" unbind="unbindSessionManager"/>
-<reference name="validators" interface="org.eclipse.osbp.runtime.common.validation.IValidationParticipant" cardinality="0..n"
- policy="dynamic" bind="addValidationParticipant" unbind="removeValidationParticipant"/>
-</scr:component>
diff --git a/org.eclipse.osbp.runtime.tests/OSGI-INF/org.osbp.tests.dtos.service.DepartmentDtoService.xml b/org.eclipse.osbp.runtime.tests/OSGI-INF/org.osbp.tests.dtos.service.DepartmentDtoService.xml
deleted file mode 100644
index 0c13f80..0000000
--- a/org.eclipse.osbp.runtime.tests/OSGI-INF/org.osbp.tests.dtos.service.DepartmentDtoService.xml
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" name="org.osbp.tests.dtos.service.departmentdtoservice">
- <implementation class="org.osbp.tests.dtos.service.DepartmentDtoService"/>
- <service>
- <provide interface="org.eclipse.osbp.runtime.common.filter.IDTOService"/>
- </service>
- <property name="dto" type="String" value="org.osbp.tests.dtos.DepartmentDto"/>
- <property name="service.pid" type="String" value="org.osbp.tests.dtos.service.departmentdtoservice"/>
-<reference name="mapperAccess" interface="org.eclipse.osbp.dsl.dto.lib.IMapperAccess" cardinality="1..1"
- policy="dynamic" bind="bindMapperAccess" unbind="unbindMapperAccess"/>
-<reference name="filterEnhancers" interface="org.eclipse.osbp.runtime.common.filter.IFilterEnhancer" cardinality="0..n"
- policy="dynamic" bind="addFilterEnhancer" unbind="removeFilterEnhancer"/>
-<reference name="sessionManager" interface="org.eclipse.osbp.runtime.common.session.ISessionManager" cardinality="1..1"
- policy="dynamic" bind="bindSessionManager" unbind="unbindSessionManager"/>
-<reference name="validators" interface="org.eclipse.osbp.runtime.common.validation.IValidationParticipant" cardinality="0..n"
- policy="dynamic" bind="addValidationParticipant" unbind="removeValidationParticipant"/>
-</scr:component>
diff --git a/org.eclipse.osbp.runtime.tests/OSGI-INF/org.osbp.tests.dtos.service.DtoTestChildContainmentDtoService.xml b/org.eclipse.osbp.runtime.tests/OSGI-INF/org.osbp.tests.dtos.service.DtoTestChildContainmentDtoService.xml
deleted file mode 100644
index 1ea529a..0000000
--- a/org.eclipse.osbp.runtime.tests/OSGI-INF/org.osbp.tests.dtos.service.DtoTestChildContainmentDtoService.xml
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" name="org.osbp.tests.dtos.service.dtotestchildcontainmentdtoservice">
- <implementation class="org.osbp.tests.dtos.service.DtoTestChildContainmentDtoService"/>
- <service>
- <provide interface="org.eclipse.osbp.runtime.common.filter.IDTOService"/>
- </service>
- <property name="dto" type="String" value="org.osbp.tests.dtos.DtoTestChildContainmentDto"/>
- <property name="service.pid" type="String" value="org.osbp.tests.dtos.service.dtotestchildcontainmentdtoservice"/>
-<reference name="mapperAccess" interface="org.eclipse.osbp.dsl.dto.lib.IMapperAccess" cardinality="1..1"
- policy="dynamic" bind="bindMapperAccess" unbind="unbindMapperAccess"/>
-<reference name="filterEnhancers" interface="org.eclipse.osbp.runtime.common.filter.IFilterEnhancer" cardinality="0..n"
- policy="dynamic" bind="addFilterEnhancer" unbind="removeFilterEnhancer"/>
-<reference name="sessionManager" interface="org.eclipse.osbp.runtime.common.session.ISessionManager" cardinality="1..1"
- policy="dynamic" bind="bindSessionManager" unbind="unbindSessionManager"/>
-<reference name="validators" interface="org.eclipse.osbp.runtime.common.validation.IValidationParticipant" cardinality="0..n"
- policy="dynamic" bind="addValidationParticipant" unbind="removeValidationParticipant"/>
-</scr:component>
diff --git a/org.eclipse.osbp.runtime.tests/OSGI-INF/org.osbp.tests.dtos.service.DtoTestChildCrossRefDtoService.xml b/org.eclipse.osbp.runtime.tests/OSGI-INF/org.osbp.tests.dtos.service.DtoTestChildCrossRefDtoService.xml
deleted file mode 100644
index 09c64b9..0000000
--- a/org.eclipse.osbp.runtime.tests/OSGI-INF/org.osbp.tests.dtos.service.DtoTestChildCrossRefDtoService.xml
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" name="org.osbp.tests.dtos.service.dtotestchildcrossrefdtoservice">
- <implementation class="org.osbp.tests.dtos.service.DtoTestChildCrossRefDtoService"/>
- <service>
- <provide interface="org.eclipse.osbp.runtime.common.filter.IDTOService"/>
- </service>
- <property name="dto" type="String" value="org.osbp.tests.dtos.DtoTestChildCrossRefDto"/>
- <property name="service.pid" type="String" value="org.osbp.tests.dtos.service.dtotestchildcrossrefdtoservice"/>
-<reference name="mapperAccess" interface="org.eclipse.osbp.dsl.dto.lib.IMapperAccess" cardinality="1..1"
- policy="dynamic" bind="bindMapperAccess" unbind="unbindMapperAccess"/>
-<reference name="filterEnhancers" interface="org.eclipse.osbp.runtime.common.filter.IFilterEnhancer" cardinality="0..n"
- policy="dynamic" bind="addFilterEnhancer" unbind="removeFilterEnhancer"/>
-<reference name="sessionManager" interface="org.eclipse.osbp.runtime.common.session.ISessionManager" cardinality="1..1"
- policy="dynamic" bind="bindSessionManager" unbind="unbindSessionManager"/>
-<reference name="validators" interface="org.eclipse.osbp.runtime.common.validation.IValidationParticipant" cardinality="0..n"
- policy="dynamic" bind="addValidationParticipant" unbind="removeValidationParticipant"/>
-</scr:component>
diff --git a/org.eclipse.osbp.runtime.tests/OSGI-INF/org.osbp.tests.dtos.service.McustomerDtoService.xml b/org.eclipse.osbp.runtime.tests/OSGI-INF/org.osbp.tests.dtos.service.McustomerDtoService.xml
deleted file mode 100644
index b18ef86..0000000
--- a/org.eclipse.osbp.runtime.tests/OSGI-INF/org.osbp.tests.dtos.service.McustomerDtoService.xml
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" name="org.osbp.tests.dtos.service.mcustomerdtoservice">
- <implementation class="org.osbp.tests.dtos.service.McustomerDtoService"/>
- <service>
- <provide interface="org.eclipse.osbp.runtime.common.filter.IDTOService"/>
- </service>
- <property name="dto" type="String" value="org.osbp.tests.dtos.McustomerDto"/>
- <property name="service.pid" type="String" value="org.osbp.tests.dtos.service.mcustomerdtoservice"/>
-<reference name="mapperAccess" interface="org.eclipse.osbp.dsl.dto.lib.IMapperAccess" cardinality="1..1"
- policy="dynamic" bind="bindMapperAccess" unbind="unbindMapperAccess"/>
-<reference name="filterEnhancers" interface="org.eclipse.osbp.runtime.common.filter.IFilterEnhancer" cardinality="0..n"
- policy="dynamic" bind="addFilterEnhancer" unbind="removeFilterEnhancer"/>
-<reference name="sessionManager" interface="org.eclipse.osbp.runtime.common.session.ISessionManager" cardinality="1..1"
- policy="dynamic" bind="bindSessionManager" unbind="unbindSessionManager"/>
-<reference name="validators" interface="org.eclipse.osbp.runtime.common.validation.IValidationParticipant" cardinality="0..n"
- policy="dynamic" bind="addValidationParticipant" unbind="removeValidationParticipant"/>
-</scr:component>
diff --git a/org.eclipse.osbp.runtime.tests/models/mysmartshop.dto b/org.eclipse.osbp.runtime.tests/models/mysmartshop.dto
index f5cfd45..d400f0f 100644
--- a/org.eclipse.osbp.runtime.tests/models/mysmartshop.dto
+++ b/org.eclipse.osbp.runtime.tests/models/mysmartshop.dto
@@ -31,157 +31,5 @@
autoDto DtoTestParentDto extends BaseUUIDDto wraps DtoTestParent {
inheritVar string
- inheritRef containmentChilds mapto DtoTestChildContainmentDto
- inheritRef crossRefChilds mapto DtoTestChildCrossRefDto
- inheritRef crossRefChild mapto DtoTestChildCrossRefDto
- inheritVar beanx mapto DtoTestBeanDto
- }
-
- autoDto DtoTestChildContainmentDto extends BaseUUIDDto wraps DtoTestChildContainment {
-
- inheritRef container mapto DtoTestParentDto
- }
-
- autoDto DtoTestChildCrossRefDto extends BaseUUIDDto wraps DtoTestChildCrossRef {
-
- inheritRef container mapto DtoTestParentDto
- }
-
- autoDto DtoTestBeanDto wraps DtoTestBean {
-
- inheritVar foo
- inheritRef crossRefChild mapto DtoTestChildCrossRefDto
- }
-
- autoDto McustomerDto extends BaseIDDto wraps Mcustomer {
-
- inheritVar account_num
- inheritVar lname
- inheritVar fname
- inheritVar mi
- inheritVar address1
- inheritVar address2
- inheritVar address3
- inheritVar address4
- inheritVar city
- inheritVar state_province
- inheritVar postal_code
- inheritVar country
- inheritVar phone1
- inheritVar phone2
- inheritVar birthdate
- inheritVar marital_status
- inheritVar yearly_income
- inheritVar gender
- inheritVar total_children
- inheritVar num_children_at_home
- inheritVar education
- inheritVar date_accnt_opened
- inheritVar member_card
- inheritVar occupation
- inheritVar houseowner
- inheritVar num_cars_owned
- inheritVar fullname
- inheritVar test
- inheritRef slips mapto CashSlipDto
- inheritVar foo
- }
-
- autoDto CashRegisterDto extends BaseUUIDDto wraps CashRegister {
-
- inheritVar num
- inheritVar ip
- inheritVar location
- inheritVar currentDay
- inheritRef slips mapto CashSlipDto
- }
-
- autoDto CashSlipDto extends BaseUUIDDto wraps CashSlip {
-
- inheritVar currentDay
- inheritVar now
- inheritVar cashier
- inheritVar total
- inheritVar serial
- inheritVar payed
- inheritRef positions mapto CashPositionDto
- inheritRef customer mapto McustomerDto
- inheritRef register mapto CashRegisterDto
- inheritRef payments mapto CashPaymentDto
- }
-
- autoDto CashPositionDto extends BaseUUIDDto wraps CashPosition {
-
- inheritVar now
- inheritVar quantity
- inheritVar price
- inheritVar amount
- inheritRef slip mapto CashSlipDto
- }
-
- autoDto CashPaymentDto extends BaseUUIDDto wraps CashPayment {
-
- inheritVar now
- inheritVar payed
- inheritRef slip mapto CashSlipDto
- inheritRef methodOfPayment mapto CashPaymentMethodDto
- }
-
- autoDto CashPaymentMethodDto extends BaseUUIDDto wraps CashPaymentMethod {
-
- inheritVar num
- inheritVar name
- inheritVar credit
- inheritVar imageName
- inheritVar lowerLimit
- inheritRef payments mapto CashPaymentDto
- }
-
- autoDto CompanyRelationTypeDto extends BaseUUIDDto wraps CompanyRelationType {
-
- inheritVar name
- inheritVar description
- }
-
- autoDto CompanyGroupDto extends BaseUUIDDto wraps CompanyGroup {
-
- inheritVar name
- inheritVar description
- inheritRef main_company mapto CompanyDto
- inheritRef companies mapto CompanyDto
- }
-
- autoDto CompanyDto extends BaseUUIDDto wraps Company {
-
- inheritRef company_group mapto CompanyGroupDto
- inheritVar name
- inheritVar description
- inheritRef relation_type mapto CompanyRelationTypeDto
- inheritRef address mapto AddressDto
- inheritRef departments mapto DepartmentDto
- }
-
- autoDto AddressDto extends BaseUUIDDto wraps Address {
-
- inheritRef company mapto CompanyDto
- inheritRef department mapto DepartmentDto
- inheritVar address1
- inheritVar address2
- inheritVar city
- inheritVar state_province
- inheritVar postal_code
- inheritVar country
- inheritVar email
- inheritVar landline
- inheritVar mobile
- }
-
- autoDto DepartmentDto extends BaseUUIDDto wraps Department {
-
- inheritRef company mapto CompanyDto
- inheritVar name
- inheritVar description
- inheritRef address mapto AddressDto
- inheritVar default_yearly_income
}
}
\ No newline at end of file
diff --git a/org.eclipse.osbp.runtime.tests/models/mysmartshop.service b/org.eclipse.osbp.runtime.tests/models/mysmartshop.service
index e9c8661..636aab0 100644
--- a/org.eclipse.osbp.runtime.tests/models/mysmartshop.service
+++ b/org.eclipse.osbp.runtime.tests/models/mysmartshop.service
@@ -26,56 +26,4 @@
dtoservice DtoTestParentDtoService provides DtoTestParentDto {
mutable persistenceUnit businessdata
}
-
- dtoservice DtoTestChildContainmentDtoService provides DtoTestChildContainmentDto {
- mutable persistenceUnit businessdata
- }
-
- dtoservice DtoTestChildCrossRefDtoService provides DtoTestChildCrossRefDto {
- mutable persistenceUnit businessdata
- }
-
- dtoservice McustomerDtoService provides McustomerDto {
- mutable persistenceUnit businessdata
- }
-
- dtoservice CashRegisterDtoService provides CashRegisterDto {
- mutable persistenceUnit businessdata
- }
-
- dtoservice CashSlipDtoService provides CashSlipDto {
- mutable persistenceUnit businessdata
- }
-
- dtoservice CashPositionDtoService provides CashPositionDto {
- mutable persistenceUnit businessdata
- }
-
- dtoservice CashPaymentDtoService provides CashPaymentDto {
- mutable persistenceUnit businessdata
- }
-
- dtoservice CashPaymentMethodDtoService provides CashPaymentMethodDto {
- mutable persistenceUnit businessdata
- }
-
- dtoservice CompanyRelationTypeDtoService provides CompanyRelationTypeDto {
- mutable persistenceUnit businessdata
- }
-
- dtoservice CompanyGroupDtoService provides CompanyGroupDto {
- mutable persistenceUnit businessdata
- }
-
- dtoservice CompanyDtoService provides CompanyDto {
- mutable persistenceUnit businessdata
- }
-
- dtoservice AddressDtoService provides AddressDto {
- mutable persistenceUnit businessdata
- }
-
- dtoservice DepartmentDtoService provides DepartmentDto {
- mutable persistenceUnit businessdata
- }
}
\ No newline at end of file
diff --git a/org.eclipse.osbp.runtime.tests/src-gen/org/osbp/tests/dtos/DtoTestParentDto.java b/org.eclipse.osbp.runtime.tests/src-gen/org/osbp/tests/dtos/DtoTestParentDto.java
index 211e538..c35e2db 100644
--- a/org.eclipse.osbp.runtime.tests/src-gen/org/osbp/tests/dtos/DtoTestParentDto.java
+++ b/org.eclipse.osbp.runtime.tests/src-gen/org/osbp/tests/dtos/DtoTestParentDto.java
@@ -2,38 +2,14 @@
import java.beans.PropertyChangeListener;
import java.io.Serializable;
-import java.util.Collections;
-import java.util.List;
-import javax.validation.Valid;
import org.eclipse.osbp.dsl.common.datatypes.IDto;
import org.eclipse.osbp.runtime.common.annotations.Dispose;
-import org.eclipse.osbp.runtime.common.annotations.DomainReference;
-import org.eclipse.osbp.runtime.common.annotations.FilterDepth;
import org.osbp.tests.dtos.BaseUUIDDto;
-import org.osbp.tests.dtos.DtoTestBeanDto;
-import org.osbp.tests.dtos.DtoTestChildContainmentDto;
-import org.osbp.tests.dtos.DtoTestChildCrossRefDto;
@SuppressWarnings("all")
public class DtoTestParentDto extends BaseUUIDDto implements IDto, Serializable, PropertyChangeListener {
private String string;
- @DomainReference
- @Valid
- @FilterDepth(depth = 0)
- private List<DtoTestChildContainmentDto> containmentChilds;
-
- @DomainReference
- @FilterDepth(depth = 0)
- private List<DtoTestChildCrossRefDto> crossRefChilds;
-
- @DomainReference
- @FilterDepth(depth = 0)
- private DtoTestChildCrossRefDto crossRefChild;
-
- @Valid
- private DtoTestBeanDto beanx;
-
public DtoTestParentDto() {
installLazyCollections();
}
@@ -44,14 +20,6 @@
*/
protected void installLazyCollections() {
super.installLazyCollections();
- containmentChilds = new org.eclipse.osbp.dsl.dto.lib.OppositeContainmentDtoList<>(
- org.eclipse.osbp.dsl.dto.lib.MappingContext.getCurrent(),
- DtoTestChildContainmentDto.class, this, "container.id",
- (java.util.function.Supplier<Object> & Serializable) () -> this.getId(), this);
- crossRefChilds = new org.eclipse.osbp.dsl.dto.lib.OppositeDtoList<>(
- org.eclipse.osbp.dsl.dto.lib.MappingContext.getCurrent(),
- DtoTestChildCrossRefDto.class, "container.id",
- (java.util.function.Supplier<Object> & Serializable) () -> this.getId(), this);
}
/**
@@ -76,20 +44,7 @@
if (isDisposed()) {
return;
}
- try {
- // Dispose all the composition references.
- if (this.containmentChilds != null) {
- for (DtoTestChildContainmentDto dtoTestChildContainmentDto : this.containmentChilds) {
- dtoTestChildContainmentDto.dispose();
- }
- this.containmentChilds = null;
- }
-
- }
- finally {
- super.dispose();
- }
-
+ super.dispose();
}
/**
@@ -110,286 +65,11 @@
firePropertyChange("string", this.string, this.string = string );
}
- /**
- * Returns an unmodifiable list of containmentChilds.
- */
- public List<DtoTestChildContainmentDto> getContainmentChilds() {
- return Collections.unmodifiableList(internalGetContainmentChilds());
- }
-
- /**
- * Returns the list of <code>DtoTestChildContainmentDto</code>s thereby lazy initializing it. For internal use only!
- *
- * @return list - the resulting list
- *
- */
- public List<DtoTestChildContainmentDto> internalGetContainmentChilds() {
- if (this.containmentChilds == null) {
- this.containmentChilds = new java.util.ArrayList<DtoTestChildContainmentDto>();
- }
- return this.containmentChilds;
- }
-
- /**
- * Adds the given dtoTestChildContainmentDto to this object. <p>
- * Since the reference is a composition reference, the opposite reference <code>DtoTestChildContainmentDto#container</code> of the <code>dtoTestChildContainmentDto</code> will be handled automatically and no further coding is required to keep them in sync.<p>
- * See {@link DtoTestChildContainmentDto#setContainer(DtoTestChildContainmentDto)}.
- *
- * @param dtoTestChildContainmentDto - the property
- * @throws RuntimeException if instance is <code>disposed</code>
- *
- */
- public void addToContainmentChilds(final DtoTestChildContainmentDto dtoTestChildContainmentDto) {
- checkDisposed();
-
- dtoTestChildContainmentDto.setContainer(this);
- }
-
- /**
- * Removes the given dtoTestChildContainmentDto from this object. <p>
- *
- * @param dtoTestChildContainmentDto - the property
- * @throws RuntimeException if instance is <code>disposed</code>
- *
- */
- public void removeFromContainmentChilds(final DtoTestChildContainmentDto dtoTestChildContainmentDto) {
- checkDisposed();
-
- dtoTestChildContainmentDto.setContainer(null);
- }
-
- /**
- * For internal use only!
- */
- public void internalAddToContainmentChilds(final DtoTestChildContainmentDto dtoTestChildContainmentDto) {
-
- if(!org.eclipse.osbp.dsl.dto.lib.MappingContext.isMappingMode()) {
- List<DtoTestChildContainmentDto> oldList = null;
- if(internalGetContainmentChilds() instanceof org.eclipse.osbp.dsl.dto.lib.AbstractOppositeDtoList) {
- oldList = ((org.eclipse.osbp.dsl.dto.lib.AbstractOppositeDtoList) internalGetContainmentChilds()).copy();
- } else {
- oldList = new java.util.ArrayList<>(internalGetContainmentChilds());
- }
- internalGetContainmentChilds().add(dtoTestChildContainmentDto);
- firePropertyChange("containmentChilds", oldList, internalGetContainmentChilds());
- }
- }
-
- /**
- * For internal use only!
- */
- public void internalRemoveFromContainmentChilds(final DtoTestChildContainmentDto dtoTestChildContainmentDto) {
- if(!org.eclipse.osbp.dsl.dto.lib.MappingContext.isMappingMode()) {
- List<DtoTestChildContainmentDto> oldList = null;
- if(internalGetContainmentChilds() instanceof org.eclipse.osbp.dsl.dto.lib.AbstractOppositeDtoList) {
- oldList = ((org.eclipse.osbp.dsl.dto.lib.AbstractOppositeDtoList) internalGetContainmentChilds()).copy();
- } else {
- oldList = new java.util.ArrayList<>(internalGetContainmentChilds());
- }
- internalGetContainmentChilds().remove(dtoTestChildContainmentDto);
- firePropertyChange("containmentChilds", oldList, internalGetContainmentChilds());
- }else{
- // in mapping mode, we do NOT resolve any collection
- internalGetContainmentChilds().remove(dtoTestChildContainmentDto);
- }
- }
-
- /**
- * Sets the <code>containmentChilds</code> property to this instance.
- * Since the reference has an opposite reference, the opposite <code>DtoTestChildContainmentDto#
- * container</code> of the <code>containmentChilds</code> will be handled automatically and no
- * further coding is required to keep them in sync.<p>
- * See {@link DtoTestChildContainmentDto#setContainer(DtoTestChildContainmentDto)
- *
- * @param containmentChilds - the property
- * @throws RuntimeException if instance is <code>disposed</code>
- *
- */
- public void setContainmentChilds(final List<DtoTestChildContainmentDto> containmentChilds) {
- checkDisposed();
- for (DtoTestChildContainmentDto dto : internalGetContainmentChilds().toArray(new DtoTestChildContainmentDto[this.containmentChilds.size()])) {
- removeFromContainmentChilds(dto);
- }
-
- if(containmentChilds == null) {
- return;
- }
-
- for (DtoTestChildContainmentDto dto : containmentChilds) {
- addToContainmentChilds(dto);
- }
- }
-
- /**
- * Returns an unmodifiable list of crossRefChilds.
- */
- public List<DtoTestChildCrossRefDto> getCrossRefChilds() {
- return Collections.unmodifiableList(internalGetCrossRefChilds());
- }
-
- /**
- * Returns the list of <code>DtoTestChildCrossRefDto</code>s thereby lazy initializing it. For internal use only!
- *
- * @return list - the resulting list
- *
- */
- public List<DtoTestChildCrossRefDto> internalGetCrossRefChilds() {
- if (this.crossRefChilds == null) {
- this.crossRefChilds = new java.util.ArrayList<DtoTestChildCrossRefDto>();
- }
- return this.crossRefChilds;
- }
-
- /**
- * Adds the given dtoTestChildCrossRefDto to this object. <p>
- * Since the reference is a composition reference, the opposite reference <code>DtoTestChildCrossRefDto#container</code> of the <code>dtoTestChildCrossRefDto</code> will be handled automatically and no further coding is required to keep them in sync.<p>
- * See {@link DtoTestChildCrossRefDto#setContainer(DtoTestChildCrossRefDto)}.
- *
- * @param dtoTestChildCrossRefDto - the property
- * @throws RuntimeException if instance is <code>disposed</code>
- *
- */
- public void addToCrossRefChilds(final DtoTestChildCrossRefDto dtoTestChildCrossRefDto) {
- checkDisposed();
-
- dtoTestChildCrossRefDto.setContainer(this);
- }
-
- /**
- * Removes the given dtoTestChildCrossRefDto from this object. <p>
- *
- * @param dtoTestChildCrossRefDto - the property
- * @throws RuntimeException if instance is <code>disposed</code>
- *
- */
- public void removeFromCrossRefChilds(final DtoTestChildCrossRefDto dtoTestChildCrossRefDto) {
- checkDisposed();
-
- dtoTestChildCrossRefDto.setContainer(null);
- }
-
- /**
- * For internal use only!
- */
- public void internalAddToCrossRefChilds(final DtoTestChildCrossRefDto dtoTestChildCrossRefDto) {
-
- if(!org.eclipse.osbp.dsl.dto.lib.MappingContext.isMappingMode()) {
- List<DtoTestChildCrossRefDto> oldList = null;
- if(internalGetCrossRefChilds() instanceof org.eclipse.osbp.dsl.dto.lib.AbstractOppositeDtoList) {
- oldList = ((org.eclipse.osbp.dsl.dto.lib.AbstractOppositeDtoList) internalGetCrossRefChilds()).copy();
- } else {
- oldList = new java.util.ArrayList<>(internalGetCrossRefChilds());
- }
- internalGetCrossRefChilds().add(dtoTestChildCrossRefDto);
- firePropertyChange("crossRefChilds", oldList, internalGetCrossRefChilds());
- }
- }
-
- /**
- * For internal use only!
- */
- public void internalRemoveFromCrossRefChilds(final DtoTestChildCrossRefDto dtoTestChildCrossRefDto) {
- if(!org.eclipse.osbp.dsl.dto.lib.MappingContext.isMappingMode()) {
- List<DtoTestChildCrossRefDto> oldList = null;
- if(internalGetCrossRefChilds() instanceof org.eclipse.osbp.dsl.dto.lib.AbstractOppositeDtoList) {
- oldList = ((org.eclipse.osbp.dsl.dto.lib.AbstractOppositeDtoList) internalGetCrossRefChilds()).copy();
- } else {
- oldList = new java.util.ArrayList<>(internalGetCrossRefChilds());
- }
- internalGetCrossRefChilds().remove(dtoTestChildCrossRefDto);
- firePropertyChange("crossRefChilds", oldList, internalGetCrossRefChilds());
- }else{
- // in mapping mode, we do NOT resolve any collection
- internalGetCrossRefChilds().remove(dtoTestChildCrossRefDto);
- }
- }
-
- /**
- * Sets the <code>crossRefChilds</code> property to this instance.
- * Since the reference has an opposite reference, the opposite <code>DtoTestChildCrossRefDto#
- * container</code> of the <code>crossRefChilds</code> will be handled automatically and no
- * further coding is required to keep them in sync.<p>
- * See {@link DtoTestChildCrossRefDto#setContainer(DtoTestChildCrossRefDto)
- *
- * @param crossRefChilds - the property
- * @throws RuntimeException if instance is <code>disposed</code>
- *
- */
- public void setCrossRefChilds(final List<DtoTestChildCrossRefDto> crossRefChilds) {
- checkDisposed();
- for (DtoTestChildCrossRefDto dto : internalGetCrossRefChilds().toArray(new DtoTestChildCrossRefDto[this.crossRefChilds.size()])) {
- removeFromCrossRefChilds(dto);
- }
-
- if(crossRefChilds == null) {
- return;
- }
-
- for (DtoTestChildCrossRefDto dto : crossRefChilds) {
- addToCrossRefChilds(dto);
- }
- }
-
- /**
- * Returns the crossRefChild property or <code>null</code> if not present.
- */
- public DtoTestChildCrossRefDto getCrossRefChild() {
- return this.crossRefChild;
- }
-
- /**
- * Sets the <code>crossRefChild</code> property to this instance.
- *
- * @param crossRefChild - the property
- * @throws RuntimeException if instance is <code>disposed</code>
- *
- */
- public void setCrossRefChild(final DtoTestChildCrossRefDto crossRefChild) {
- checkDisposed();
- firePropertyChange("crossRefChild", this.crossRefChild, this.crossRefChild = crossRefChild);
- }
-
- /**
- * Returns the beanx property.
- */
- public DtoTestBeanDto getBeanx() {
- if(this.beanx== null){
- this.beanx = new DtoTestBeanDto();
- }
- return this.beanx;
- }
-
- /**
- * Sets the <code>beanx</code> property to this instance.
- *
- * @param beanx - the property
- * @throws RuntimeException if instance is <code>disposed</code>
- *
- */
- public void setBeanx(final DtoTestBeanDto beanx) {
- // ensure that embedded beans will notify their parent about changes
- // so their dirty state can be handled properly
- if (this.beanx != null) {
- this.beanx.removePropertyChangeListener(this);
- }
-
- firePropertyChange("beanx", this.beanx, this.beanx = beanx );
-
- if (this.beanx != null) {
- this.beanx.addPropertyChangeListener(this);
- }
- }
-
public void propertyChange(final java.beans.PropertyChangeEvent event) {
Object source = event.getSource();
// forward the event from embeddable beans to all listeners. So the parent of the embeddable
// bean will become notified and its dirty state can be handled properly
-
-
- if(source == beanx){
- firePropertyChange("beanx" + "_" + event.getPropertyName(), event.getOldValue(), event.getNewValue());
- } else
{
super.propertyChange(event);
}
diff --git a/org.eclipse.osbp.runtime.tests/src-gen/org/osbp/tests/dtos/mapper/DtoTestParentDtoMapper.java b/org.eclipse.osbp.runtime.tests/src-gen/org/osbp/tests/dtos/mapper/DtoTestParentDtoMapper.java
index ea92a50..85decd6 100644
--- a/org.eclipse.osbp.runtime.tests/src-gen/org/osbp/tests/dtos/mapper/DtoTestParentDtoMapper.java
+++ b/org.eclipse.osbp.runtime.tests/src-gen/org/osbp/tests/dtos/mapper/DtoTestParentDtoMapper.java
@@ -1,15 +1,8 @@
package org.osbp.tests.dtos.mapper;
-import java.util.List;
import org.eclipse.osbp.dsl.dto.lib.MappingContext;
-import org.osbp.tests.dtos.DtoTestBeanDto;
-import org.osbp.tests.dtos.DtoTestChildContainmentDto;
-import org.osbp.tests.dtos.DtoTestChildCrossRefDto;
import org.osbp.tests.dtos.DtoTestParentDto;
import org.osbp.tests.dtos.mapper.BaseUUIDDtoMapper;
-import org.osbp.tests.entities.DtoTestBean;
-import org.osbp.tests.entities.DtoTestChildContainment;
-import org.osbp.tests.entities.DtoTestChildCrossRef;
import org.osbp.tests.entities.DtoTestParent;
/**
@@ -49,8 +42,6 @@
super.mapToDTO(dto, entity, context);
dto.setString(toDto_string(entity, context));
- dto.setCrossRefChild(toDto_crossRefChild(entity, context));
- dto.setBeanx(toDto_beanx(entity, context));
}
/**
@@ -71,10 +62,6 @@
super.mapToEntity(dto, entity, context);
entity.setString(toEntity_string(dto, entity, context));
- toEntity_containmentChilds(dto, entity, context);
- toEntity_crossRefChilds(dto, entity, context);
- entity.setCrossRefChild(toEntity_crossRefChild(dto, entity, context));
- entity.setBeanx(toEntity_beanx(dto, entity, context));
}
/**
@@ -102,216 +89,6 @@
return in.getString();
}
- /**
- * Maps the property containmentChilds from the given entity to the dto.
- *
- * @param in - The source entity
- * @param context - The context to get information about depth,...
- * @return A list of mapped dtos
- *
- */
- protected List<DtoTestChildContainmentDto> toDto_containmentChilds(final DtoTestParent in, final MappingContext context) {
- // nothing to do here. Mapping is done by OppositeLists
- return null;
- }
-
- /**
- * Maps the property containmentChilds from the given dto to the entity.
- *
- * @param in - The source dto
- * @param parentEntity - The parent entity
- * @param context - The context to get information about depth,...
- * @return A list of mapped entities
- *
- */
- protected List<DtoTestChildContainment> toEntity_containmentChilds(final DtoTestParentDto in, final DtoTestParent parentEntity, final MappingContext context) {
- org.eclipse.osbp.dsl.dto.lib.IMapper<DtoTestChildContainmentDto, DtoTestChildContainment> mapper = getToEntityMapper(DtoTestChildContainmentDto.class, DtoTestChildContainment.class);
- if(mapper == null) {
- throw new IllegalStateException("Mapper must not be null!");
- }
-
- org.eclipse.osbp.dsl.dto.lib.IEntityMappingList<DtoTestChildContainmentDto> childsList =
- (org.eclipse.osbp.dsl.dto.lib.IEntityMappingList<DtoTestChildContainmentDto>) in.internalGetContainmentChilds();
-
- // if entities are being added, then they are passed to
- // #addToContainerChilds of the parent entity. So the container ref is setup
- // properly!
- // if entities are being removed, then they are passed to the
- // #internalRemoveFromChilds method of the parent entity. So they are
- // removed directly from the list of entities.
- childsList.mapToEntity(mapper,
- parentEntity::addToContainmentChilds,
- parentEntity::internalRemoveFromContainmentChilds);
- return null;
- }
-
- /**
- * Maps the property crossRefChilds from the given entity to the dto.
- *
- * @param in - The source entity
- * @param context - The context to get information about depth,...
- * @return A list of mapped dtos
- *
- */
- protected List<DtoTestChildCrossRefDto> toDto_crossRefChilds(final DtoTestParent in, final MappingContext context) {
- // nothing to do here. Mapping is done by OppositeLists
- return null;
- }
-
- /**
- * Maps the property crossRefChilds from the given dto to the entity.
- *
- * @param in - The source dto
- * @param parentEntity - The parent entity
- * @param context - The context to get information about depth,...
- * @return A list of mapped entities
- *
- */
- protected List<DtoTestChildCrossRef> toEntity_crossRefChilds(final DtoTestParentDto in, final DtoTestParent parentEntity, final MappingContext context) {
- org.eclipse.osbp.dsl.dto.lib.IMapper<DtoTestChildCrossRefDto, DtoTestChildCrossRef> mapper = getToEntityMapper(DtoTestChildCrossRefDto.class, DtoTestChildCrossRef.class);
- if(mapper == null) {
- throw new IllegalStateException("Mapper must not be null!");
- }
-
- org.eclipse.osbp.dsl.dto.lib.IEntityMappingList<DtoTestChildCrossRefDto> childsList =
- (org.eclipse.osbp.dsl.dto.lib.IEntityMappingList<DtoTestChildCrossRefDto>) in.internalGetCrossRefChilds();
-
- // if entities are being added, then they are passed to
- // #addToContainerChilds of the parent entity. So the container ref is setup
- // properly!
- // if entities are being removed, then they are passed to the
- // #internalRemoveFromChilds method of the parent entity. So they are
- // removed directly from the list of entities.
- childsList.mapToEntity(mapper,
- parentEntity::addToCrossRefChilds,
- parentEntity::internalRemoveFromCrossRefChilds);
- return null;
- }
-
- /**
- * Maps the property crossRefChild from the given entity to the dto.
- *
- * @param in - The source entity
- * @param context - The context to get information about depth,...
- * @return the mapped dto
- *
- */
- protected DtoTestChildCrossRefDto toDto_crossRefChild(final DtoTestParent in, final MappingContext context) {
- if(in.getCrossRefChild() != null) {
- // find a mapper that knows how to map the concrete input type.
- org.eclipse.osbp.dsl.dto.lib.IMapper<DtoTestChildCrossRefDto, DtoTestChildCrossRef> mapper = (org.eclipse.osbp.dsl.dto.lib.IMapper<DtoTestChildCrossRefDto, DtoTestChildCrossRef>) getToDtoMapper(DtoTestChildCrossRefDto.class, in.getCrossRefChild().getClass());
- if(mapper == null) {
- throw new IllegalStateException("Mapper must not be null!");
- }
- DtoTestChildCrossRefDto dto = null;
- dto = context.get(mapper.createDtoHash(in.getCrossRefChild()));
- if(dto != null) {
- if(context.isRefresh()){
- mapper.mapToDTO(dto, in.getCrossRefChild(), context);
- }
- return dto;
- }
-
- context.increaseLevel();
- dto = mapper.createDto();
- mapper.mapToDTO(dto, in.getCrossRefChild(), context);
- context.decreaseLevel();
- return dto;
- } else {
- return null;
- }
- }
-
- /**
- * Maps the property crossRefChild from the given dto to the entity.
- *
- * @param in - The source dto
- * @param parentEntity - The parent entity
- * @param context - The context to get information about depth,...
- * @return the mapped entity
- *
- */
- protected DtoTestChildCrossRef toEntity_crossRefChild(final DtoTestParentDto in, final DtoTestParent parentEntity, final MappingContext context) {
- if(in.getCrossRefChild() != null) {
- // find a mapper that knows how to map the concrete input type.
- org.eclipse.osbp.dsl.dto.lib.IMapper<DtoTestChildCrossRefDto, DtoTestChildCrossRef> mapper = (org.eclipse.osbp.dsl.dto.lib.IMapper<DtoTestChildCrossRefDto, DtoTestChildCrossRef>) getToEntityMapper(in.getCrossRefChild().getClass(), DtoTestChildCrossRef.class);
- if(mapper == null) {
- throw new IllegalStateException("Mapper must not be null!");
- }
-
- DtoTestChildCrossRef entity = null;
- entity = context.get(mapper.createEntityHash(in.getCrossRefChild()));
- if(entity != null) {
- return entity;
- } else {
- entity = (DtoTestChildCrossRef) context
- .findEntityByEntityManager(DtoTestChildCrossRef.class, in.getCrossRefChild().getId());
- if (entity != null) {
- context.register(mapper.createEntityHash(in.getCrossRefChild()), entity);
- return entity;
- }
- }
-
- entity = mapper.createEntity();
- mapper.mapToEntity(in.getCrossRefChild(), entity, context);
- return entity;
- } else {
- return null;
- }
- }
-
- /**
- * Maps the property beanx from the given entity to dto property.
- *
- * @param in - The source entity
- * @param context - The context to get information about depth,...
- * @return the mapped value
- *
- */
- protected DtoTestBeanDto toDto_beanx(final DtoTestParent in, final MappingContext context) {
- if(in.getBeanx() != null) {
- // find a mapper that knows how to map the concrete input type.
- org.eclipse.osbp.dsl.dto.lib.IMapper<DtoTestBeanDto, DtoTestBean> mapper = (org.eclipse.osbp.dsl.dto.lib.IMapper<DtoTestBeanDto, DtoTestBean>) getToDtoMapper(DtoTestBeanDto.class, in.getBeanx().getClass());
- if(mapper == null) {
- throw new IllegalStateException("Mapper must not be null!");
- }
-
- DtoTestBeanDto dto = null;
- context.increaseLevel();
- dto = mapper.createDto();
- mapper.mapToDTO(dto, in.getBeanx(), context);
- context.decreaseLevel();
- return dto;
- } else {
- return null;
- }
- }
-
- /**
- * Maps the property beanx from the given entity to dto property.
- *
- * @param in - The source entity
- * @param parentEntity - The parentEntity
- * @param context - The context to get information about depth,...
- * @return the mapped value
- *
- */
- protected DtoTestBean toEntity_beanx(final DtoTestParentDto in, final DtoTestParent parentEntity, final MappingContext context) {
- if(in.getBeanx() != null) {
- // find a mapper that knows how to map the concrete input type.
- org.eclipse.osbp.dsl.dto.lib.IMapper<DtoTestBeanDto, DtoTestBean> mapper = (org.eclipse.osbp.dsl.dto.lib.IMapper<DtoTestBeanDto, DtoTestBean>) getToEntityMapper(in.getBeanx().getClass(), DtoTestBean.class);
- if(mapper == null) {
- throw new IllegalStateException("Mapper must not be null!");
- }
-
- DtoTestBean entity = mapper.createEntity();
- mapper.mapToEntity(in.getBeanx(), entity, context);
- return entity;
- } else {
- return null;
- }
- }
-
public String createDtoHash(final Object in) {
return org.eclipse.osbp.runtime.common.hash.HashUtil.createObjectWithIdHash(DtoTestParentDto.class, in);
}
diff --git a/org.eclipse.osbp.runtime.tests/src-gen/org/osbp/tests/dtos/service/AddressDtoService.java b/org.eclipse.osbp.runtime.tests/src-gen/org/osbp/tests/dtos/service/AddressDtoService.java
deleted file mode 100644
index e7210b3..0000000
--- a/org.eclipse.osbp.runtime.tests/src-gen/org/osbp/tests/dtos/service/AddressDtoService.java
+++ /dev/null
@@ -1,25 +0,0 @@
-package org.osbp.tests.dtos.service;
-
-import org.eclipse.osbp.dsl.dto.lib.services.impl.AbstractDTOServiceWithMutablePersistence;
-import org.osbp.tests.dtos.AddressDto;
-import org.osbp.tests.entities.Address;
-
-@SuppressWarnings("all")
-public class AddressDtoService extends AbstractDTOServiceWithMutablePersistence<AddressDto, Address> {
- public AddressDtoService() {
- // set the default persistence ID
- setPersistenceId("businessdata");
- }
-
- public Class<AddressDto> getDtoClass() {
- return AddressDto.class;
- }
-
- public Class<Address> getEntityClass() {
- return Address.class;
- }
-
- public Object getId(final AddressDto dto) {
- return dto.getId();
- }
-}
diff --git a/org.eclipse.osbp.runtime.tests/src-gen/org/osbp/tests/dtos/service/CashPaymentDtoService.java b/org.eclipse.osbp.runtime.tests/src-gen/org/osbp/tests/dtos/service/CashPaymentDtoService.java
deleted file mode 100644
index adc9495..0000000
--- a/org.eclipse.osbp.runtime.tests/src-gen/org/osbp/tests/dtos/service/CashPaymentDtoService.java
+++ /dev/null
@@ -1,25 +0,0 @@
-package org.osbp.tests.dtos.service;
-
-import org.eclipse.osbp.dsl.dto.lib.services.impl.AbstractDTOServiceWithMutablePersistence;
-import org.osbp.tests.dtos.CashPaymentDto;
-import org.osbp.tests.entities.CashPayment;
-
-@SuppressWarnings("all")
-public class CashPaymentDtoService extends AbstractDTOServiceWithMutablePersistence<CashPaymentDto, CashPayment> {
- public CashPaymentDtoService() {
- // set the default persistence ID
- setPersistenceId("businessdata");
- }
-
- public Class<CashPaymentDto> getDtoClass() {
- return CashPaymentDto.class;
- }
-
- public Class<CashPayment> getEntityClass() {
- return CashPayment.class;
- }
-
- public Object getId(final CashPaymentDto dto) {
- return dto.getId();
- }
-}
diff --git a/org.eclipse.osbp.runtime.tests/src-gen/org/osbp/tests/dtos/service/CashPaymentMethodDtoService.java b/org.eclipse.osbp.runtime.tests/src-gen/org/osbp/tests/dtos/service/CashPaymentMethodDtoService.java
deleted file mode 100644
index 3b92091..0000000
--- a/org.eclipse.osbp.runtime.tests/src-gen/org/osbp/tests/dtos/service/CashPaymentMethodDtoService.java
+++ /dev/null
@@ -1,25 +0,0 @@
-package org.osbp.tests.dtos.service;
-
-import org.eclipse.osbp.dsl.dto.lib.services.impl.AbstractDTOServiceWithMutablePersistence;
-import org.osbp.tests.dtos.CashPaymentMethodDto;
-import org.osbp.tests.entities.CashPaymentMethod;
-
-@SuppressWarnings("all")
-public class CashPaymentMethodDtoService extends AbstractDTOServiceWithMutablePersistence<CashPaymentMethodDto, CashPaymentMethod> {
- public CashPaymentMethodDtoService() {
- // set the default persistence ID
- setPersistenceId("businessdata");
- }
-
- public Class<CashPaymentMethodDto> getDtoClass() {
- return CashPaymentMethodDto.class;
- }
-
- public Class<CashPaymentMethod> getEntityClass() {
- return CashPaymentMethod.class;
- }
-
- public Object getId(final CashPaymentMethodDto dto) {
- return dto.getId();
- }
-}
diff --git a/org.eclipse.osbp.runtime.tests/src-gen/org/osbp/tests/dtos/service/CashPositionDtoService.java b/org.eclipse.osbp.runtime.tests/src-gen/org/osbp/tests/dtos/service/CashPositionDtoService.java
deleted file mode 100644
index 5823dac..0000000
--- a/org.eclipse.osbp.runtime.tests/src-gen/org/osbp/tests/dtos/service/CashPositionDtoService.java
+++ /dev/null
@@ -1,25 +0,0 @@
-package org.osbp.tests.dtos.service;
-
-import org.eclipse.osbp.dsl.dto.lib.services.impl.AbstractDTOServiceWithMutablePersistence;
-import org.osbp.tests.dtos.CashPositionDto;
-import org.osbp.tests.entities.CashPosition;
-
-@SuppressWarnings("all")
-public class CashPositionDtoService extends AbstractDTOServiceWithMutablePersistence<CashPositionDto, CashPosition> {
- public CashPositionDtoService() {
- // set the default persistence ID
- setPersistenceId("businessdata");
- }
-
- public Class<CashPositionDto> getDtoClass() {
- return CashPositionDto.class;
- }
-
- public Class<CashPosition> getEntityClass() {
- return CashPosition.class;
- }
-
- public Object getId(final CashPositionDto dto) {
- return dto.getId();
- }
-}
diff --git a/org.eclipse.osbp.runtime.tests/src-gen/org/osbp/tests/dtos/service/CashRegisterDtoService.java b/org.eclipse.osbp.runtime.tests/src-gen/org/osbp/tests/dtos/service/CashRegisterDtoService.java
deleted file mode 100644
index 4c1190c..0000000
--- a/org.eclipse.osbp.runtime.tests/src-gen/org/osbp/tests/dtos/service/CashRegisterDtoService.java
+++ /dev/null
@@ -1,25 +0,0 @@
-package org.osbp.tests.dtos.service;
-
-import org.eclipse.osbp.dsl.dto.lib.services.impl.AbstractDTOServiceWithMutablePersistence;
-import org.osbp.tests.dtos.CashRegisterDto;
-import org.osbp.tests.entities.CashRegister;
-
-@SuppressWarnings("all")
-public class CashRegisterDtoService extends AbstractDTOServiceWithMutablePersistence<CashRegisterDto, CashRegister> {
- public CashRegisterDtoService() {
- // set the default persistence ID
- setPersistenceId("businessdata");
- }
-
- public Class<CashRegisterDto> getDtoClass() {
- return CashRegisterDto.class;
- }
-
- public Class<CashRegister> getEntityClass() {
- return CashRegister.class;
- }
-
- public Object getId(final CashRegisterDto dto) {
- return dto.getId();
- }
-}
diff --git a/org.eclipse.osbp.runtime.tests/src-gen/org/osbp/tests/dtos/service/CashSlipDtoService.java b/org.eclipse.osbp.runtime.tests/src-gen/org/osbp/tests/dtos/service/CashSlipDtoService.java
deleted file mode 100644
index 7c4be31..0000000
--- a/org.eclipse.osbp.runtime.tests/src-gen/org/osbp/tests/dtos/service/CashSlipDtoService.java
+++ /dev/null
@@ -1,25 +0,0 @@
-package org.osbp.tests.dtos.service;
-
-import org.eclipse.osbp.dsl.dto.lib.services.impl.AbstractDTOServiceWithMutablePersistence;
-import org.osbp.tests.dtos.CashSlipDto;
-import org.osbp.tests.entities.CashSlip;
-
-@SuppressWarnings("all")
-public class CashSlipDtoService extends AbstractDTOServiceWithMutablePersistence<CashSlipDto, CashSlip> {
- public CashSlipDtoService() {
- // set the default persistence ID
- setPersistenceId("businessdata");
- }
-
- public Class<CashSlipDto> getDtoClass() {
- return CashSlipDto.class;
- }
-
- public Class<CashSlip> getEntityClass() {
- return CashSlip.class;
- }
-
- public Object getId(final CashSlipDto dto) {
- return dto.getId();
- }
-}
diff --git a/org.eclipse.osbp.runtime.tests/src-gen/org/osbp/tests/dtos/service/CompanyDtoService.java b/org.eclipse.osbp.runtime.tests/src-gen/org/osbp/tests/dtos/service/CompanyDtoService.java
deleted file mode 100644
index 18adac8..0000000
--- a/org.eclipse.osbp.runtime.tests/src-gen/org/osbp/tests/dtos/service/CompanyDtoService.java
+++ /dev/null
@@ -1,25 +0,0 @@
-package org.osbp.tests.dtos.service;
-
-import org.eclipse.osbp.dsl.dto.lib.services.impl.AbstractDTOServiceWithMutablePersistence;
-import org.osbp.tests.dtos.CompanyDto;
-import org.osbp.tests.entities.Company;
-
-@SuppressWarnings("all")
-public class CompanyDtoService extends AbstractDTOServiceWithMutablePersistence<CompanyDto, Company> {
- public CompanyDtoService() {
- // set the default persistence ID
- setPersistenceId("businessdata");
- }
-
- public Class<CompanyDto> getDtoClass() {
- return CompanyDto.class;
- }
-
- public Class<Company> getEntityClass() {
- return Company.class;
- }
-
- public Object getId(final CompanyDto dto) {
- return dto.getId();
- }
-}
diff --git a/org.eclipse.osbp.runtime.tests/src-gen/org/osbp/tests/dtos/service/CompanyGroupDtoService.java b/org.eclipse.osbp.runtime.tests/src-gen/org/osbp/tests/dtos/service/CompanyGroupDtoService.java
deleted file mode 100644
index b55609c..0000000
--- a/org.eclipse.osbp.runtime.tests/src-gen/org/osbp/tests/dtos/service/CompanyGroupDtoService.java
+++ /dev/null
@@ -1,25 +0,0 @@
-package org.osbp.tests.dtos.service;
-
-import org.eclipse.osbp.dsl.dto.lib.services.impl.AbstractDTOServiceWithMutablePersistence;
-import org.osbp.tests.dtos.CompanyGroupDto;
-import org.osbp.tests.entities.CompanyGroup;
-
-@SuppressWarnings("all")
-public class CompanyGroupDtoService extends AbstractDTOServiceWithMutablePersistence<CompanyGroupDto, CompanyGroup> {
- public CompanyGroupDtoService() {
- // set the default persistence ID
- setPersistenceId("businessdata");
- }
-
- public Class<CompanyGroupDto> getDtoClass() {
- return CompanyGroupDto.class;
- }
-
- public Class<CompanyGroup> getEntityClass() {
- return CompanyGroup.class;
- }
-
- public Object getId(final CompanyGroupDto dto) {
- return dto.getId();
- }
-}
diff --git a/org.eclipse.osbp.runtime.tests/src-gen/org/osbp/tests/dtos/service/CompanyRelationTypeDtoService.java b/org.eclipse.osbp.runtime.tests/src-gen/org/osbp/tests/dtos/service/CompanyRelationTypeDtoService.java
deleted file mode 100644
index 925fa35..0000000
--- a/org.eclipse.osbp.runtime.tests/src-gen/org/osbp/tests/dtos/service/CompanyRelationTypeDtoService.java
+++ /dev/null
@@ -1,25 +0,0 @@
-package org.osbp.tests.dtos.service;
-
-import org.eclipse.osbp.dsl.dto.lib.services.impl.AbstractDTOServiceWithMutablePersistence;
-import org.osbp.tests.dtos.CompanyRelationTypeDto;
-import org.osbp.tests.entities.CompanyRelationType;
-
-@SuppressWarnings("all")
-public class CompanyRelationTypeDtoService extends AbstractDTOServiceWithMutablePersistence<CompanyRelationTypeDto, CompanyRelationType> {
- public CompanyRelationTypeDtoService() {
- // set the default persistence ID
- setPersistenceId("businessdata");
- }
-
- public Class<CompanyRelationTypeDto> getDtoClass() {
- return CompanyRelationTypeDto.class;
- }
-
- public Class<CompanyRelationType> getEntityClass() {
- return CompanyRelationType.class;
- }
-
- public Object getId(final CompanyRelationTypeDto dto) {
- return dto.getId();
- }
-}
diff --git a/org.eclipse.osbp.runtime.tests/src-gen/org/osbp/tests/dtos/service/DepartmentDtoService.java b/org.eclipse.osbp.runtime.tests/src-gen/org/osbp/tests/dtos/service/DepartmentDtoService.java
deleted file mode 100644
index 057ee60..0000000
--- a/org.eclipse.osbp.runtime.tests/src-gen/org/osbp/tests/dtos/service/DepartmentDtoService.java
+++ /dev/null
@@ -1,25 +0,0 @@
-package org.osbp.tests.dtos.service;
-
-import org.eclipse.osbp.dsl.dto.lib.services.impl.AbstractDTOServiceWithMutablePersistence;
-import org.osbp.tests.dtos.DepartmentDto;
-import org.osbp.tests.entities.Department;
-
-@SuppressWarnings("all")
-public class DepartmentDtoService extends AbstractDTOServiceWithMutablePersistence<DepartmentDto, Department> {
- public DepartmentDtoService() {
- // set the default persistence ID
- setPersistenceId("businessdata");
- }
-
- public Class<DepartmentDto> getDtoClass() {
- return DepartmentDto.class;
- }
-
- public Class<Department> getEntityClass() {
- return Department.class;
- }
-
- public Object getId(final DepartmentDto dto) {
- return dto.getId();
- }
-}
diff --git a/org.eclipse.osbp.runtime.tests/src-gen/org/osbp/tests/dtos/service/DtoTestChildContainmentDtoService.java b/org.eclipse.osbp.runtime.tests/src-gen/org/osbp/tests/dtos/service/DtoTestChildContainmentDtoService.java
deleted file mode 100644
index 247b242..0000000
--- a/org.eclipse.osbp.runtime.tests/src-gen/org/osbp/tests/dtos/service/DtoTestChildContainmentDtoService.java
+++ /dev/null
@@ -1,25 +0,0 @@
-package org.osbp.tests.dtos.service;
-
-import org.eclipse.osbp.dsl.dto.lib.services.impl.AbstractDTOServiceWithMutablePersistence;
-import org.osbp.tests.dtos.DtoTestChildContainmentDto;
-import org.osbp.tests.entities.DtoTestChildContainment;
-
-@SuppressWarnings("all")
-public class DtoTestChildContainmentDtoService extends AbstractDTOServiceWithMutablePersistence<DtoTestChildContainmentDto, DtoTestChildContainment> {
- public DtoTestChildContainmentDtoService() {
- // set the default persistence ID
- setPersistenceId("businessdata");
- }
-
- public Class<DtoTestChildContainmentDto> getDtoClass() {
- return DtoTestChildContainmentDto.class;
- }
-
- public Class<DtoTestChildContainment> getEntityClass() {
- return DtoTestChildContainment.class;
- }
-
- public Object getId(final DtoTestChildContainmentDto dto) {
- return dto.getId();
- }
-}
diff --git a/org.eclipse.osbp.runtime.tests/src-gen/org/osbp/tests/dtos/service/DtoTestChildCrossRefDtoService.java b/org.eclipse.osbp.runtime.tests/src-gen/org/osbp/tests/dtos/service/DtoTestChildCrossRefDtoService.java
deleted file mode 100644
index deaaa95..0000000
--- a/org.eclipse.osbp.runtime.tests/src-gen/org/osbp/tests/dtos/service/DtoTestChildCrossRefDtoService.java
+++ /dev/null
@@ -1,25 +0,0 @@
-package org.osbp.tests.dtos.service;
-
-import org.eclipse.osbp.dsl.dto.lib.services.impl.AbstractDTOServiceWithMutablePersistence;
-import org.osbp.tests.dtos.DtoTestChildCrossRefDto;
-import org.osbp.tests.entities.DtoTestChildCrossRef;
-
-@SuppressWarnings("all")
-public class DtoTestChildCrossRefDtoService extends AbstractDTOServiceWithMutablePersistence<DtoTestChildCrossRefDto, DtoTestChildCrossRef> {
- public DtoTestChildCrossRefDtoService() {
- // set the default persistence ID
- setPersistenceId("businessdata");
- }
-
- public Class<DtoTestChildCrossRefDto> getDtoClass() {
- return DtoTestChildCrossRefDto.class;
- }
-
- public Class<DtoTestChildCrossRef> getEntityClass() {
- return DtoTestChildCrossRef.class;
- }
-
- public Object getId(final DtoTestChildCrossRefDto dto) {
- return dto.getId();
- }
-}
diff --git a/org.eclipse.osbp.runtime.tests/src-gen/org/osbp/tests/dtos/service/McustomerDtoService.java b/org.eclipse.osbp.runtime.tests/src-gen/org/osbp/tests/dtos/service/McustomerDtoService.java
deleted file mode 100644
index f0801b1..0000000
--- a/org.eclipse.osbp.runtime.tests/src-gen/org/osbp/tests/dtos/service/McustomerDtoService.java
+++ /dev/null
@@ -1,25 +0,0 @@
-package org.osbp.tests.dtos.service;
-
-import org.eclipse.osbp.dsl.dto.lib.services.impl.AbstractDTOServiceWithMutablePersistence;
-import org.osbp.tests.dtos.McustomerDto;
-import org.osbp.tests.entities.Mcustomer;
-
-@SuppressWarnings("all")
-public class McustomerDtoService extends AbstractDTOServiceWithMutablePersistence<McustomerDto, Mcustomer> {
- public McustomerDtoService() {
- // set the default persistence ID
- setPersistenceId("businessdata");
- }
-
- public Class<McustomerDto> getDtoClass() {
- return McustomerDto.class;
- }
-
- public Class<Mcustomer> getEntityClass() {
- return Mcustomer.class;
- }
-
- public Object getId(final McustomerDto dto) {
- return dto.getId();
- }
-}
diff --git a/org.eclipse.osbp.runtime.web.atmosphere.fragment/META-INF/MANIFEST.MF b/org.eclipse.osbp.runtime.web.atmosphere.fragment/META-INF/MANIFEST.MF
index 004967f..21a2eb2 100644
--- a/org.eclipse.osbp.runtime.web.atmosphere.fragment/META-INF/MANIFEST.MF
+++ b/org.eclipse.osbp.runtime.web.atmosphere.fragment/META-INF/MANIFEST.MF
@@ -6,9 +6,9 @@
Bundle-Vendor: Eclipse OSBP
Fragment-Host: com.vaadin.external.atmosphere.runtime;bundle-version="2.2.9.vaadin2"
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
-Require-Bundle: org.eclipse.jetty.websocket.api;bundle-version="9.4.1",
+Require-Bundle: org.eclipse.jetty.websocket.api;bundle-version="[9.2.25,9.5.0)",
javax.servlet;bundle-version="[3.1.0,3.2.0)",
- org.eclipse.jetty.server;bundle-version="9.4.1",
- org.eclipse.jetty.websocket.common;bundle-version="9.4.1",
- org.eclipse.jetty.websocket.server;bundle-version="9.4.1",
- org.eclipse.jetty.websocket.servlet;bundle-version="9.4.1"
+ org.eclipse.jetty.server;bundle-version="[9.2.25,9.5.0)",
+ org.eclipse.jetty.websocket.common;bundle-version="[9.2.25,9.5.0)",
+ org.eclipse.jetty.websocket.server;bundle-version="[9.2.25,9.5.0)",
+ org.eclipse.jetty.websocket.servlet;bundle-version="[9.2.25,9.5.0)"
diff --git a/org.eclipse.osbp.runtime.web.common/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.osbp.runtime.web.common/.settings/org.eclipse.jdt.core.prefs
index c537b63..0c68a61 100644
--- a/org.eclipse.osbp.runtime.web.common/.settings/org.eclipse.jdt.core.prefs
+++ b/org.eclipse.osbp.runtime.web.common/.settings/org.eclipse.jdt.core.prefs
@@ -1,7 +1,7 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
-org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
+org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.6
+org.eclipse.jdt.core.compiler.source=1.8
diff --git a/org.eclipse.osbp.runtime.web.ecview.presentation.vaadin/META-INF/MANIFEST.MF b/org.eclipse.osbp.runtime.web.ecview.presentation.vaadin/META-INF/MANIFEST.MF
index 10652aa..d0d7ad7 100644
--- a/org.eclipse.osbp.runtime.web.ecview.presentation.vaadin/META-INF/MANIFEST.MF
+++ b/org.eclipse.osbp.runtime.web.ecview.presentation.vaadin/META-INF/MANIFEST.MF
@@ -36,8 +36,13 @@
org.eclipse.osbp.dsl.dto.xtext;bundle-version="0.9.0",
org.eclipse.osbp.blob;bundle-version="0.9.0",
org.eclipse.osbp.vaadin.addons.kanban;bundle-version="0.9.0",
- org.eclipse.e4.core.contexts;bundle-version="1.5.1"
-Import-Package: org.eclipse.osbp.ecview.extension.api;version="0.9.0",
+ org.eclipse.e4.core.contexts;bundle-version="1.5.1",
+ javax.persistence;bundle-version="2.1.0",
+ javax.validation.api;bundle-version="1.1.0"
+Import-Package: org.eclipse.e4.ui.model.application.ui.advanced,
+ org.eclipse.osbp.ecview.extension.api;version="0.9.0",
+ org.eclipse.osbp.xtext.datamart.common.olap;version="0.9.0",
+ org.eclipse.osbp.xtext.table.common;version="0.9.0",
org.osgi.framework;version="1.7.0",
org.osgi.service.component.annotations;version="1.2.0",
org.slf4j;version="1.6.4"
diff --git a/org.eclipse.osbp.runtime.web.ecview.presentation.vaadin/src/org/eclipse/osbp/runtime/web/ecview/presentation/vaadin/common/AbstractFieldWidgetPresenter.java b/org.eclipse.osbp.runtime.web.ecview.presentation.vaadin/src/org/eclipse/osbp/runtime/web/ecview/presentation/vaadin/common/AbstractFieldWidgetPresenter.java
index 3e754b5..a999bca 100644
--- a/org.eclipse.osbp.runtime.web.ecview.presentation.vaadin/src/org/eclipse/osbp/runtime/web/ecview/presentation/vaadin/common/AbstractFieldWidgetPresenter.java
+++ b/org.eclipse.osbp.runtime.web.ecview.presentation.vaadin/src/org/eclipse/osbp/runtime/web/ecview/presentation/vaadin/common/AbstractFieldWidgetPresenter.java
@@ -24,21 +24,18 @@
import org.eclipse.osbp.ecview.core.common.validation.IFieldValidationManager;
import org.eclipse.osbp.ecview.core.common.validation.IValidator;
import org.eclipse.osbp.runtime.common.validation.IStatus;
-import org.eclipse.osbp.runtime.designer.api.IWidgetDesignConfigurator;
import org.eclipse.osbp.runtime.designer.api.IDesignerService.DesignEvent;
import org.eclipse.osbp.runtime.designer.api.IDesignerService.EventType;
import org.eclipse.osbp.runtime.designer.api.IDesignerService.IDesignListener;
+import org.eclipse.osbp.runtime.designer.api.IWidgetDesignConfigurator;
import org.eclipse.osbp.runtime.web.ecview.presentation.vaadin.internal.ValidatorAdapter;
import org.eclipse.osbp.runtime.web.ecview.presentation.vaadin.validator.ExternalStatusAwareValidator;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import com.vaadin.client.Focusable;
import com.vaadin.data.Validator;
import com.vaadin.data.util.converter.Converter;
import com.vaadin.server.ErrorMessage;
-import com.vaadin.server.VaadinSession;
-import com.vaadin.ui.AbstractComponent;
import com.vaadin.ui.AbstractField;
import com.vaadin.ui.Component;
import com.vaadin.ui.Field;
@@ -50,20 +47,18 @@
* @param <A>
* the generic type
*/
-public abstract class AbstractFieldWidgetPresenter<A extends Component> extends
- AbstractVaadinWidgetPresenter<A> implements IFieldPresentation<A>,
- IDesignListener {
+public abstract class AbstractFieldWidgetPresenter<A extends Component> extends AbstractVaadinWidgetPresenter<A>
+ implements IFieldPresentation<A>, IDesignListener {
/** The Constant LOGGER. */
- private static final Logger LOGGER = LoggerFactory
- .getLogger(AbstractFieldWidgetPresenter.class);
+ private static final Logger LOGGER = LoggerFactory.getLogger(AbstractFieldWidgetPresenter.class);
/** The validators. */
private Map<IValidator, ValidatorAdapter> validators;
-
+
/** The external status validator. */
private ExternalStatusAwareValidator externalStatusValidator;
-
+
/** The converter. */
private Converter<?, ?> converter;
@@ -81,8 +76,11 @@
super(editpart);
}
- /* (non-Javadoc)
- * @see org.eclipse.osbp.ecview.core.common.presentation.IFieldPresentation#addValidator(org.eclipse.osbp.ecview.core.common.validation.IValidator)
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osbp.ecview.core.common.presentation.IFieldPresentation#
+ * addValidator(org.eclipse.osbp.ecview.core.common.validation.IValidator)
*/
@Override
public void addValidator(IValidator validator) {
@@ -97,8 +95,13 @@
doUpdateValidator(new Event(Event.ADD, validators.get(validator)));
}
- /* (non-Javadoc)
- * @see org.eclipse.osbp.ecview.core.common.presentation.IFieldPresentation#removeValidator(org.eclipse.osbp.ecview.core.common.validation.IValidator)
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osbp.ecview.core.common.presentation.IFieldPresentation#
+ * removeValidator(org.eclipse.osbp.ecview.core.common.validation.
+ * IValidator)
*/
@Override
public void removeValidator(IValidator validator) {
@@ -112,8 +115,11 @@
}
}
- /* (non-Javadoc)
- * @see org.eclipse.osbp.ecview.core.common.presentation.IFieldPresentation#setConverter(java.lang.Object)
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osbp.ecview.core.common.presentation.IFieldPresentation#
+ * setConverter(java.lang.Object)
*/
@Override
public void setConverter(Object object) {
@@ -152,8 +158,11 @@
return null;
}
- /* (non-Javadoc)
- * @see org.eclipse.osbp.runtime.web.ecview.presentation.vaadin.common.AbstractVaadinWidgetPresenter#getCastedModel()
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osbp.runtime.web.ecview.presentation.vaadin.common.
+ * AbstractVaadinWidgetPresenter#getCastedModel()
*/
protected YField getCastedModel() {
return (YField) getModel();
@@ -179,9 +188,8 @@
* @return the validators
*/
public Map<IValidator, ValidatorAdapter> getValidators() {
- return validators != null ? java.util.Collections
- .unmodifiableMap(validators) : Collections
- .<IValidator, ValidatorAdapter> emptyMap();
+ return validators != null ? java.util.Collections.unmodifiableMap(validators)
+ : Collections.<IValidator, ValidatorAdapter>emptyMap();
}
/**
@@ -246,15 +254,18 @@
*/
protected abstract Field<?> doGetField();
- /* (non-Javadoc)
- * @see org.eclipse.osbp.runtime.web.ecview.presentation.vaadin.common.AbstractVaadinWidgetPresenter#notify(org.eclipse.osbp.runtime.designer.api.IDesignerService.DesignEvent)
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osbp.runtime.web.ecview.presentation.vaadin.common.
+ * AbstractVaadinWidgetPresenter#notify(org.eclipse.osbp.runtime.designer.
+ * api.IDesignerService.DesignEvent)
*/
@Override
public void notify(DesignEvent event) {
super.notify(event);
- IWidgetDesignConfigurator service = getViewContext().getService(
- IWidgetDesignConfigurator.class.getName());
+ IWidgetDesignConfigurator service = getViewContext().getService(IWidgetDesignConfigurator.class.getName());
if (service != null) {
if (event.getType() == EventType.ENABLED) {
service.configure(getWidget(), getCastedModel(), true);
@@ -282,12 +293,15 @@
casted.setConverter(getConverter());
}
}
-
+
super.initialize(field, getCastedModel());
}
- /* (non-Javadoc)
- * @see org.eclipse.osbp.ecview.core.common.presentation.IFieldPresentation#addExternalStatus(org.eclipse.osbp.runtime.common.validation.IStatus)
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osbp.ecview.core.common.presentation.IFieldPresentation#
+ * addExternalStatus(org.eclipse.osbp.runtime.common.validation.IStatus)
*/
@Override
public void addExternalStatus(IStatus status) {
@@ -303,8 +317,11 @@
}
}
- /* (non-Javadoc)
- * @see org.eclipse.osbp.ecview.core.common.presentation.IFieldPresentation#removeExternalStatus(org.eclipse.osbp.runtime.common.validation.IStatus)
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osbp.ecview.core.common.presentation.IFieldPresentation#
+ * removeExternalStatus(org.eclipse.osbp.runtime.common.validation.IStatus)
*/
@Override
public void removeExternalStatus(IStatus status) {
@@ -317,8 +334,11 @@
}
}
- /* (non-Javadoc)
- * @see org.eclipse.osbp.ecview.core.common.presentation.IFieldPresentation#resetExternalStatus()
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osbp.ecview.core.common.presentation.IFieldPresentation#
+ * resetExternalStatus()
*/
@Override
public void resetExternalStatus() {
@@ -340,8 +360,7 @@
protected void reportValidationError(ErrorMessage message) {
// error message is only used as a fallback for later
- IFieldValidationManager service = getViewContext().getService(
- IFieldValidationManager.class.getName());
+ IFieldValidationManager service = getViewContext().getService(IFieldValidationManager.class.getName());
if (service != null) {
List<IStatus> statuses = new ArrayList<IStatus>();
if (validators != null) {
@@ -349,15 +368,18 @@
statuses.addAll(validator.getCurrentStatus());
}
}
- if(externalStatusValidator != null) {
+ if (externalStatusValidator != null) {
statuses.addAll(externalStatusValidator.getCurrentStatus());
}
service.registerResult(getModel(), statuses);
}
}
- /* (non-Javadoc)
- * @see org.eclipse.osbp.runtime.web.ecview.presentation.vaadin.common.AbstractVaadinWidgetPresenter#internalDispose()
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osbp.runtime.web.ecview.presentation.vaadin.common.
+ * AbstractVaadinWidgetPresenter#internalDispose()
*/
@Override
protected void internalDispose() {
diff --git a/org.eclipse.osbp.runtime.web.ecview.presentation.vaadin/src/org/eclipse/osbp/runtime/web/ecview/presentation/vaadin/common/AbstractVaadinWidgetPresenter.java b/org.eclipse.osbp.runtime.web.ecview.presentation.vaadin/src/org/eclipse/osbp/runtime/web/ecview/presentation/vaadin/common/AbstractVaadinWidgetPresenter.java
index 89870dd..8ce6c15 100644
--- a/org.eclipse.osbp.runtime.web.ecview.presentation.vaadin/src/org/eclipse/osbp/runtime/web/ecview/presentation/vaadin/common/AbstractVaadinWidgetPresenter.java
+++ b/org.eclipse.osbp.runtime.web.ecview.presentation.vaadin/src/org/eclipse/osbp/runtime/web/ecview/presentation/vaadin/common/AbstractVaadinWidgetPresenter.java
@@ -38,6 +38,7 @@
import org.eclipse.osbp.ecview.core.common.context.IViewContext;
import org.eclipse.osbp.ecview.core.common.editpart.IEmbeddableEditpart;
import org.eclipse.osbp.ecview.core.common.editpart.datatypes.IDatatypeEditpart.DatatypeChangeEvent;
+import org.eclipse.osbp.ecview.core.common.model.binding.YBindingEndpoint;
import org.eclipse.osbp.ecview.core.common.model.core.CoreModelFactory;
import org.eclipse.osbp.ecview.core.common.model.core.CoreModelPackage;
import org.eclipse.osbp.ecview.core.common.model.core.YBlurNotifier;
@@ -98,7 +99,6 @@
import fi.jasoft.dragdroplayouts.client.ui.LayoutDragMode;
-// TODO: Auto-generated Javadoc
/**
* An abstract implementation of the {@link IWidgetPresentation}.
*
@@ -137,7 +137,7 @@
private IBindingManager bindingManger;
/** The bindings. */
- private Set<Binding> bindings = new HashSet<Binding>();
+ private Set<Binding> bindings = new HashSet<>();
/** The visibility options applier. */
private VisibilityOptionsApplier visibilityOptionsApplier;
@@ -148,6 +148,8 @@
private Component component;
+ private Set<YBindingEndpoint> autoBindindEndpoints = new HashSet<>();
+
/**
* Instantiates a new abstract vaadin widget presenter.
*
@@ -335,7 +337,9 @@
if (service != null) {
service.initialize(component, model);
}
-
+ if(model instanceof YEmbeddable) {
+ component.setReadOnly(((YEmbeddable)model).isReadonly());
+ }
if (this instanceof IDesignListener) {
IDesignerService designService = getDesignService();
if (designService != null) {
@@ -403,9 +407,6 @@
if (yEmbeddable instanceof YEditable) {
registerBinding(createBindingsEditable((YEditable) yEmbeddable, widget));
}
-
- // createBindingsCaption(yEmbeddable, widget);
-
}
/**
@@ -522,11 +523,11 @@
* @return Binding - the created binding
*/
protected Binding createBindingsEnabled(YEnable yEnable, AbstractComponent abstractComponent) {
- IBindingManager bindingManger = getViewContext()
+ IBindingManager manger = getViewContext()
.getService(org.eclipse.osbp.ecview.core.common.binding.IECViewBindingManager.class.getName());
// bind enabled
- return bindingManger.bindEnabled(yEnable, abstractComponent);
+ return manger.bindEnabled(yEnable, abstractComponent);
}
/**
@@ -761,7 +762,7 @@
ECViewUpdateValueStrategy modelToTarget = new ECViewUpdateValueStrategy(
ECViewUpdateValueStrategy.POLICY_UPDATE);
modelToTarget.setBeforeSetValidator(new IValidator() {
- @SuppressWarnings({ "unchecked", "rawtypes" })
+ @SuppressWarnings({ "unchecked"})
@Override
public IStatus validate(Object value) {
if (value == null) {
@@ -838,6 +839,7 @@
* the type contained in the selection result
* @return Binding - the created binding
*/
+ @SuppressWarnings("unchecked")
protected Binding createBindingsMultiSelection(EObject model, EStructuralFeature modelFeature,
final AbstractSelect field, Class<?> collectionType) {
IBindingManager bindingManager = getViewContext()
@@ -892,6 +894,7 @@
* the update strategy
* @return Binding - the created binding
*/
+ @SuppressWarnings("unchecked")
protected Binding createBindingsContainerContents(EObject model, EStructuralFeature modelFeature,
Container.ItemSetChangeNotifier field, Class<?> collectionType, UpdateListStrategy targetToModel,
UpdateListStrategy modelToTarget) {
@@ -906,6 +909,7 @@
return null;
}
+ @SuppressWarnings("unchecked")
protected Binding createBindingsContainerContents(EObject model, EStructuralFeature modelFeature,
Container.ItemSetChangeNotifier field, Class<?> collectionType, boolean containerReadonly) {
IBindingManager bindingManager = getViewContext()
@@ -1210,6 +1214,8 @@
registerAtLocaleChangedService();
+ doAutoBind();
+
return result;
}
@@ -1275,9 +1281,34 @@
labelAdapter = null;
}
+ doAutoUnbind();
+
doUnrender();
}
+ protected void doAutoUnbind() {
+ for (YBindingEndpoint ep : autoBindindEndpoints) {
+ ep.setActive(false);
+ }
+ }
+
+ protected void doAutoBind() {
+ for (YBindingEndpoint ep : autoBindindEndpoints) {
+ ep.setActive(true);
+ }
+ }
+
+ protected void addAutoBindingEndpoint(YBindingEndpoint ep) {
+ if (!autoBindindEndpoints.contains(ep)) {
+ ep.setActive(false);
+ autoBindindEndpoints.add(ep);
+ }
+ }
+
+ protected void removeAutoBindingEndpoint(YBindingEndpoint ep) {
+ autoBindindEndpoints.remove(ep);
+ }
+
/**
* Needs to be implemented by subclasses to unrender the widget.
*/
diff --git a/org.eclipse.osbp.runtime.web.ecview.presentation.vaadin/src/org/eclipse/osbp/runtime/web/ecview/presentation/vaadin/common/BrowserComponent.java b/org.eclipse.osbp.runtime.web.ecview.presentation.vaadin/src/org/eclipse/osbp/runtime/web/ecview/presentation/vaadin/common/BrowserComponent.java
new file mode 100644
index 0000000..3142040
--- /dev/null
+++ b/org.eclipse.osbp.runtime.web.ecview.presentation.vaadin/src/org/eclipse/osbp/runtime/web/ecview/presentation/vaadin/common/BrowserComponent.java
@@ -0,0 +1,112 @@
+package org.eclipse.osbp.runtime.web.ecview.presentation.vaadin.common;
+
+import java.util.Locale;
+import java.util.function.Consumer;
+
+import javax.annotation.PreDestroy;
+
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.common.notify.impl.AdapterImpl;
+import org.eclipse.osbp.ecview.core.common.context.ContextException;
+import org.eclipse.osbp.ecview.core.common.context.IViewContext;
+import org.eclipse.osbp.ecview.core.common.model.core.CoreModelFactory;
+import org.eclipse.osbp.ecview.core.common.model.core.YAlignment;
+import org.eclipse.osbp.ecview.core.common.model.core.YView;
+import org.eclipse.osbp.ecview.core.extension.model.extension.ExtensionModelFactory;
+import org.eclipse.osbp.ecview.core.extension.model.extension.ExtensionModelPackage;
+import org.eclipse.osbp.ecview.core.extension.model.extension.YBrowser;
+import org.eclipse.osbp.ecview.core.extension.model.extension.YKanban;
+import org.eclipse.osbp.ecview.core.extension.model.extension.YKanbanEvent;
+import org.eclipse.osbp.ecview.core.extension.model.extension.YVerticalLayout;
+import org.eclipse.osbp.ecview.core.extension.model.extension.YVerticalLayoutCellStyle;
+import org.eclipse.osbp.runtime.web.ecview.presentation.vaadin.VaadinRenderer;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import com.vaadin.ui.CustomComponent;
+import com.vaadin.ui.VerticalLayout;
+
+@SuppressWarnings("serial")
+public class BrowserComponent extends CustomComponent {
+
+ private static final Logger LOGGER = LoggerFactory.getLogger(BrowserComponent.class);
+
+// private final Class<?> type;
+// private final String dialogId;
+ private final String url;
+
+ private IViewContext viewContext;
+ private YBrowser yBrowser;
+
+ public BrowserComponent(String url) {
+// public BrowserComponent(Class<?> type, String dialogId, String cardId) {
+// this.type = type;
+// this.dialogId = dialogId;
+ this.url = url;
+ }
+
+ public void init(Locale locale) {
+ VerticalLayout content = new VerticalLayout();
+ content.setSizeFull();
+ content.setMargin(true);
+ content.setSpacing(true);
+ setCompositionRoot(content);
+
+ VerticalLayout renderTarget = new VerticalLayout();
+ renderTarget.setSizeFull();
+
+ content.addComponent(renderTarget);
+ content.setExpandRatio(renderTarget, 1.0f);
+
+ YView yView = createViewModel();
+
+ VaadinRenderer renderer = new VaadinRenderer();
+ try {
+ viewContext = renderer.render(renderTarget, yView, null);
+ } catch (ContextException e1) {
+ LOGGER.error("{}", e1);
+ }
+ viewContext.setLocale(locale);
+ }
+
+ private YView createViewModel() {
+
+ CoreModelFactory coreModelFactory = CoreModelFactory.eINSTANCE;
+ ExtensionModelFactory modelFactory = ExtensionModelFactory.eINSTANCE;
+
+ YView view = coreModelFactory.createYView();
+ view.setMargin(false);
+
+ YVerticalLayout content = modelFactory.createYVerticalLayout();
+ view.setContent(content);
+
+ content.setMargin(false);
+ content.setSpacing(false);
+
+ yBrowser = modelFactory.createYBrowser();
+
+ yBrowser.setValue(url);
+
+ content.getElements().add(yBrowser);
+ YVerticalLayoutCellStyle cellStyle = content.addCellStyle(yBrowser);
+ cellStyle.setAlignment(YAlignment.FILL_FILL);
+
+// yBrowser.setType(type);
+// yBrowser.setTypeQualifiedName(type.getCanonicalName());
+
+ return view;
+ }
+
+ @PreDestroy
+ public void dispose() {
+ if (viewContext != null) {
+ viewContext.dispose();
+ viewContext = null;
+ }
+ }
+
+ public IViewContext getViewContext() {
+ return viewContext;
+ }
+
+}
diff --git a/org.eclipse.osbp.runtime.web.ecview.presentation.vaadin/src/org/eclipse/osbp/runtime/web/ecview/presentation/vaadin/common/FilteringComponentEmbeddable.java b/org.eclipse.osbp.runtime.web.ecview.presentation.vaadin/src/org/eclipse/osbp/runtime/web/ecview/presentation/vaadin/common/FilteringComponentEmbeddable.java
index 28852bc..ba38887 100644
--- a/org.eclipse.osbp.runtime.web.ecview.presentation.vaadin/src/org/eclipse/osbp/runtime/web/ecview/presentation/vaadin/common/FilteringComponentEmbeddable.java
+++ b/org.eclipse.osbp.runtime.web.ecview.presentation.vaadin/src/org/eclipse/osbp/runtime/web/ecview/presentation/vaadin/common/FilteringComponentEmbeddable.java
@@ -89,6 +89,7 @@
}
public void init(Locale locale) {
+ setLocale(locale);
VerticalLayout content = new VerticalLayout();
content.setMargin(true);
content.setSpacing(true);
@@ -108,7 +109,6 @@
LOGGER.error("{}", e1);
}
viewContext.setLocale(locale);
-
// create the bean slot eager
AbstractSlot slot = (AbstractSlot) viewContext.createBeanSlot(yFilteringComp.getSelectionBeanSlotName(), type);
slot.addPropertyChangeListener(e -> {
diff --git a/org.eclipse.osbp.runtime.web.ecview.presentation.vaadin/src/org/eclipse/osbp/runtime/web/ecview/presentation/vaadin/internal/BeanReferenceFieldPresentation.java b/org.eclipse.osbp.runtime.web.ecview.presentation.vaadin/src/org/eclipse/osbp/runtime/web/ecview/presentation/vaadin/internal/BeanReferenceFieldPresentation.java
index 2afde27..d49d41b 100644
--- a/org.eclipse.osbp.runtime.web.ecview.presentation.vaadin/src/org/eclipse/osbp/runtime/web/ecview/presentation/vaadin/internal/BeanReferenceFieldPresentation.java
+++ b/org.eclipse.osbp.runtime.web.ecview.presentation.vaadin/src/org/eclipse/osbp/runtime/web/ecview/presentation/vaadin/internal/BeanReferenceFieldPresentation.java
@@ -13,6 +13,7 @@
package org.eclipse.osbp.runtime.web.ecview.presentation.vaadin.internal;
import java.util.Locale;
+import java.util.Map;
import org.eclipse.core.databinding.observable.IObservable;
import org.eclipse.core.databinding.observable.value.IObservableValue;
@@ -20,17 +21,21 @@
import org.eclipse.emf.ecore.util.EcoreUtil;
import org.eclipse.osbp.ecview.core.common.beans.InMemoryBeanProvider;
import org.eclipse.osbp.ecview.core.common.context.ContextException;
+import org.eclipse.osbp.ecview.core.common.context.IDialogViewContextCallback;
+import org.eclipse.osbp.ecview.core.common.context.IDtoServiceCallback;
import org.eclipse.osbp.ecview.core.common.context.IViewContext;
import org.eclipse.osbp.ecview.core.common.editpart.IElementEditpart;
import org.eclipse.osbp.ecview.core.common.model.core.CoreModelFactory;
import org.eclipse.osbp.ecview.core.common.model.core.YAlignment;
+import org.eclipse.osbp.ecview.core.common.model.core.YEmbeddable;
import org.eclipse.osbp.ecview.core.common.model.core.YEmbeddableBindingEndpoint;
import org.eclipse.osbp.ecview.core.common.model.core.YEmbeddableValueEndpoint;
import org.eclipse.osbp.ecview.core.common.model.core.YView;
+import org.eclipse.osbp.ecview.core.common.notification.AbstractReloadRequestService;
+import org.eclipse.osbp.ecview.core.common.notification.IReloadRequestService;
import org.eclipse.osbp.ecview.core.extension.model.extension.ExtensionModelFactory;
import org.eclipse.osbp.ecview.core.extension.model.extension.ExtensionModelPackage;
import org.eclipse.osbp.ecview.core.extension.model.extension.YBeanReferenceField;
-import org.eclipse.osbp.ecview.core.extension.model.extension.YFilteringComponent;
import org.eclipse.osbp.ecview.core.extension.model.extension.YVerticalLayout;
import org.eclipse.osbp.ecview.core.extension.model.extension.YVerticalLayoutCellStyle;
import org.eclipse.osbp.ecview.core.ui.core.editparts.extension.IBeanReferenceFieldEditpart;
@@ -44,10 +49,14 @@
import org.eclipse.osbp.runtime.web.vaadin.common.data.StatefulInMemoryBeanSearchService;
import org.eclipse.osbp.runtime.web.vaadin.common.services.filter.AnnotationToVaadinFilterConverter;
import org.eclipse.osbp.runtime.web.vaadin.components.fields.BeanReferenceField;
+import org.eclipse.osbp.ui.api.metadata.IDSLMetadataService;
+import org.eclipse.osbp.ui.api.user.IUser;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.vaadin.data.Container.Filter;
+import com.vaadin.server.ClientConnector.DetachEvent;
+import com.vaadin.server.ClientConnector.DetachListener;
import com.vaadin.server.ErrorMessage;
import com.vaadin.server.Resource;
import com.vaadin.ui.Alignment;
@@ -55,11 +64,11 @@
import com.vaadin.ui.Component;
import com.vaadin.ui.ComponentContainer;
import com.vaadin.ui.Field;
+import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.UI;
import com.vaadin.ui.VerticalLayout;
import com.vaadin.ui.Window;
-// TODO: Auto-generated Javadoc
/**
* This presenter is responsible to render a text field on the given layout.
*/
@@ -74,8 +83,14 @@
/** The field. */
private CustomField<Object> field;
+ private DialogHandleImpl filterHandle;
+
private DialogHandleImpl dialogHandle;
+ private IDSLMetadataService dslMetadataService;
+
+ private IUser user;
+
/**
* Constructor.
*
@@ -99,6 +114,9 @@
IBeanSearchService<?> service = getSearchService(searchServiceFactory);
ISharedStateContext sharedState = getViewContext().getService(ISharedStateContext.class.getName());
+ dslMetadataService = getViewContext().getService(IDSLMetadataService.class.getName());
+ user = getViewContext().getService(IUser.class.getName());
+
field = new CustomField(getEditpart().getId(), "", modelAccess.yField.getType(), service, createFilter(),
sharedState);
@@ -129,11 +147,17 @@
}
if (modelAccess.yField.getFilteringComponent() != null) {
- dialogHandle = new DialogHandleImpl();
- field.setDialogHandle(dialogHandle);
- field.setUseDialog(true);
+ filterHandle = new DialogHandleImpl();
+ field.setFilterHandle(filterHandle);
+ field.setFilterDialog(true);
}
+ if (modelAccess.yField.getDialogComponent() != null) {
+ dialogHandle = new DialogHandleImpl();
+ field.setDialogHandle(dialogHandle);
+ field.setDialog(true);
+ }
+
applyCaptions();
initializeField(field);
@@ -265,6 +289,7 @@
*
* @return the i observable value
*/
+ @SuppressWarnings("rawtypes")
protected IObservableValue internalGetValueEndpoint() {
// return the observable value for text
return EMFObservables.observeValue(castEObject(getModel()),
@@ -334,6 +359,7 @@
}
field = null;
+ filterHandle = null;
dialogHandle = null;
}
}
@@ -489,21 +515,27 @@
}
}
- class DialogHandleImpl implements BeanReferenceField.DialogHandle {
+ @SuppressWarnings("serial")
+ class DialogHandleImpl implements BeanReferenceField.DialogHandle, DetachListener {
CoreModelFactory coreModelFactory = CoreModelFactory.eINSTANCE;
ExtensionModelFactory modelFactory = ExtensionModelFactory.eINSTANCE;
private IViewContext dialogViewContext;
+ private Window window;
+ private IReloadRequestService reloadRequestService = new AbstractReloadRequestService() {
+ @Override
+ public void requestReload(YEmbeddable component, Object newDto) {
+ dialogViewContext.setBean(getBeanSlotName(dialogViewContext.getRenderingParams()), newDto); }
+ };
+
+ @SuppressWarnings("unchecked")
@Override
public void open() {
- YView yView = getViewModel();
-
- Window window = new Window();
- window.setWidth("1350px");
- window.setHeight("750px");
+ window = new Window();
window.setClosable(true);
window.setModal(true);
+ window.addDetachListener(this);
VerticalLayout content = new VerticalLayout();
content.setMargin(true);
content.setSpacing(true);
@@ -516,39 +548,66 @@
renderTarget.setSizeFull();
content.addComponent(renderTarget);
content.setExpandRatio(renderTarget, 1.0f);
-
UI ui = BeanReferenceFieldPresentation.this.field.getUI();
ui.addWindow(window);
VaadinRenderer renderer = new VaadinRenderer();
- try {
- dialogViewContext = renderer.render(renderTarget, yView, null);
- } catch (ContextException e1) {
- e1.printStackTrace();
+ if(modelAccess.yField.getDialogComponent() != null && modelAccess.yField.getDialogComponent().getViewContextCallback() != null) {
+ reloadRequestService.setMode(true);
+ Class<?> dtoType = modelAccess.yField.getDialogComponent().getType();
+ IDialogViewContextCallback callback = (IDialogViewContextCallback) modelAccess.yField.getDialogComponent().getViewContextCallback();
+ dialogViewContext = callback.getDialogViewContext(dtoType);
+ ((Map<String,Object>)dialogViewContext.getRenderingParams().get(IViewContext.PARAM_SERVICES)).put(IReloadRequestService.class.getName(), reloadRequestService);
+
+ if(!dialogViewContext.isRendered()) {
+ try {
+ renderer.render(dialogViewContext, renderTarget, dialogViewContext.getRenderingParams());
+ } catch (ContextException e) {
+ LOGGER.error("{}", e);
+ }
+ }
+ HorizontalLayout buttonArea = new HorizontalLayout();
+ content.addComponent(buttonArea);
+ content.setComponentAlignment(buttonArea, Alignment.BOTTOM_RIGHT);
+ Button add = new Button(dslMetadataService.translate(user.getLocale().toLanguageTag(), "update"), e -> {
+ IDtoServiceCallback updateCallback = (IDtoServiceCallback)modelAccess.yField.getDialogComponent().getUpdateCallback();
+ if(updateCallback != null) {
+ updateCallback.persist(dialogViewContext);
+ }
+ close();
+ });
+ buttonArea.addComponent(add);
+ Button cancel = new Button(dslMetadataService.translate(user.getLocale().toLanguageTag(), "cancel"), e -> {
+ close();
+ });
+ buttonArea.addComponent(cancel);
+ } else if(modelAccess.yField.getFilteringComponent() != null) {
+ YView yView = getViewModel();
+ try {
+ dialogViewContext = renderer.render(renderTarget, yView, null);
+ } catch (ContextException e) {
+ LOGGER.error("{}", e);
+ }
+
+ Button accept = new Button(dslMetadataService.translate(user.getLocale().toLanguageTag(), "accept"), e -> {
+ close();
+ if(modelAccess.yField.getFilteringComponent() != null) {
+ field.setValue(dialogViewContext.getBean(modelAccess.yField.getFilteringComponent().getSelectionBeanSlotName()));
+ }
+ });
+ content.addComponent(accept);
+ content.setComponentAlignment(accept, Alignment.BOTTOM_RIGHT);
+ dialogViewContext.setLocale(user.getLocale());
}
-
- Button accept = new Button("accept", e -> {
- window.close();
- Object selection = dialogViewContext
- .getBean(modelAccess.yField.getFilteringComponent().getSelectionBeanSlotName());
- field.setValue(selection);
- });
- content.addComponent(accept);
- content.setComponentAlignment(accept, Alignment.BOTTOM_RIGHT);
-
window.center();
-
- dialogViewContext.setLocale(getLocale());
-
}
protected YView getViewModel() {
YView yView = coreModelFactory.createYView();
YVerticalLayout yContent = modelFactory.createYVerticalLayout();
yView.setContent(yContent);
-
- YFilteringComponent comp = EcoreUtil.copy(modelAccess.yField.getFilteringComponent());
- yContent.getElements().add(comp);
+ YEmbeddable comp = null;
+ yContent.getElements().add(EcoreUtil.copy(modelAccess.yField.getFilteringComponent()));
YVerticalLayoutCellStyle cellStyle = yContent.addCellStyle(comp);
cellStyle.setAlignment(YAlignment.FILL_FILL);
return yView;
@@ -556,10 +615,20 @@
@Override
public void close() {
- if (dialogViewContext != null) {
+ window.close();
+ window.removeDetachListener(this);
+ }
+
+ @Override
+ public void detach(DetachEvent event) {
+ if(dialogViewContext != null && !dialogViewContext.isDisposed()) {
dialogViewContext.dispose();
+ dialogViewContext = null;
}
}
- }
+ protected String getBeanSlotName(Map<String, Object> properties) {
+ return (String) properties.get(IViewContext.PROP_SLOT);
+ }
+ }
}
diff --git a/org.eclipse.osbp.runtime.web.ecview.presentation.vaadin/src/org/eclipse/osbp/runtime/web/ecview/presentation/vaadin/internal/BrowserPresentation.java b/org.eclipse.osbp.runtime.web.ecview.presentation.vaadin/src/org/eclipse/osbp/runtime/web/ecview/presentation/vaadin/internal/BrowserPresentation.java
index ef8d312..98776cc 100644
--- a/org.eclipse.osbp.runtime.web.ecview.presentation.vaadin/src/org/eclipse/osbp/runtime/web/ecview/presentation/vaadin/internal/BrowserPresentation.java
+++ b/org.eclipse.osbp.runtime.web.ecview.presentation.vaadin/src/org/eclipse/osbp/runtime/web/ecview/presentation/vaadin/internal/BrowserPresentation.java
@@ -83,6 +83,7 @@
if (browser == null) {
browser = new BrowserFrame();
+ browser.setSizeFull();
browser.addStyleName(CSS_CLASS_CONTROL);
browser.setImmediate(true);
setupComponent(browser, getCastedModel());
diff --git a/org.eclipse.osbp.runtime.web.ecview.presentation.vaadin/src/org/eclipse/osbp/runtime/web/ecview/presentation/vaadin/internal/ButtonPresentation.java b/org.eclipse.osbp.runtime.web.ecview.presentation.vaadin/src/org/eclipse/osbp/runtime/web/ecview/presentation/vaadin/internal/ButtonPresentation.java
index c3886e6..bdebf34 100644
--- a/org.eclipse.osbp.runtime.web.ecview.presentation.vaadin/src/org/eclipse/osbp/runtime/web/ecview/presentation/vaadin/internal/ButtonPresentation.java
+++ b/org.eclipse.osbp.runtime.web.ecview.presentation.vaadin/src/org/eclipse/osbp/runtime/web/ecview/presentation/vaadin/internal/ButtonPresentation.java
@@ -36,7 +36,7 @@
private final ModelAccess modelAccess;
/** The button. */
- private Button button;
+ private FocusLosingButton button;
/**
* Constructor.
@@ -56,7 +56,7 @@
public Component doCreateWidget(Object parent) {
if (button == null) {
- button = new Button();
+ button = new FocusLosingButton();
button.addStyleName(CSS_CLASS_CONTROL);
button.setImmediate(true);
setupComponent(button, getCastedModel());
diff --git a/org.eclipse.osbp.runtime.web.ecview.presentation.vaadin/src/org/eclipse/osbp/runtime/web/ecview/presentation/vaadin/internal/CheckBoxPresentation.java b/org.eclipse.osbp.runtime.web.ecview.presentation.vaadin/src/org/eclipse/osbp/runtime/web/ecview/presentation/vaadin/internal/CheckBoxPresentation.java
index b3cc3b0..9b25b56 100644
--- a/org.eclipse.osbp.runtime.web.ecview.presentation.vaadin/src/org/eclipse/osbp/runtime/web/ecview/presentation/vaadin/internal/CheckBoxPresentation.java
+++ b/org.eclipse.osbp.runtime.web.ecview.presentation.vaadin/src/org/eclipse/osbp/runtime/web/ecview/presentation/vaadin/internal/CheckBoxPresentation.java
@@ -17,7 +17,6 @@
import org.eclipse.core.databinding.observable.IObservable;
import org.eclipse.core.databinding.observable.value.IObservableValue;
import org.eclipse.emf.databinding.EMFObservables;
-import org.eclipse.emf.ecore.EEnumLiteral;
import org.eclipse.osbp.ecview.core.common.editpart.IElementEditpart;
import org.eclipse.osbp.ecview.core.common.model.core.YEmbeddableBindingEndpoint;
import org.eclipse.osbp.ecview.core.common.model.core.YEmbeddableValueEndpoint;
@@ -71,9 +70,9 @@
checkBox = new CustomCheckboxField();
checkBox.addStyleName(CSS_CLASS_CONTROL);
checkBox.setImmediate(true);
- setupComponent(checkBox, getCastedModel());
+ setupComponent(checkBox.box, getCastedModel());
- associateWidget(checkBox, modelAccess.yField);
+ associateWidget(checkBox.box, modelAccess.yField);
if (modelAccess.isCssIdValid()) {
checkBox.setId(modelAccess.getCssID());
} else {
@@ -194,7 +193,9 @@
/*
* (non-Javadoc)
*
- * @see
+ * @see
+ *
+ * +
* org.eclipse.osbp.ecview.core.common.presentation.IWidgetPresentation#
* isRendered()
*/
@@ -319,7 +320,7 @@
@SuppressWarnings("serial")
private class CustomCheckboxField extends CustomField<Boolean> {
- private CheckBox checkBox;
+ private CheckBox box = new CheckBox();
private ObjectProperty<Boolean> property;
public Class<Boolean> getType() {
@@ -329,19 +330,23 @@
@Override
protected Component initContent() {
- checkBox = new CheckBox();
HorizontalLayout layout = new HorizontalLayout();
- layout.addComponent(checkBox);
+ layout.addComponent(box);
property = new ObjectProperty<Boolean>(null, Boolean.class);
- checkBox.setPropertyDataSource(property);
+ box.setPropertyDataSource(property);
property.addValueChangeListener(e -> {
super.setValue((Boolean) e.getProperty().getValue());
+ box.focus();
});
-
+
+ setFocusDelegate(box);
+
return layout;
}
+
+
@Override
protected void setInternalValue(Boolean newValue) {
diff --git a/org.eclipse.osbp.runtime.web.ecview.presentation.vaadin/src/org/eclipse/osbp/runtime/web/ecview/presentation/vaadin/internal/DateTimePresentation.java b/org.eclipse.osbp.runtime.web.ecview.presentation.vaadin/src/org/eclipse/osbp/runtime/web/ecview/presentation/vaadin/internal/DateTimePresentation.java
index c9c6f6f..74ad2e5 100644
--- a/org.eclipse.osbp.runtime.web.ecview.presentation.vaadin/src/org/eclipse/osbp/runtime/web/ecview/presentation/vaadin/internal/DateTimePresentation.java
+++ b/org.eclipse.osbp.runtime.web.ecview.presentation.vaadin/src/org/eclipse/osbp/runtime/web/ecview/presentation/vaadin/internal/DateTimePresentation.java
@@ -58,7 +58,7 @@
private final ModelAccess modelAccess;
/** The date field. */
- private CustomField dateField;
+ private TypedCustomField dateField;
/** The binding_value to ui. */
private Binding binding_valueToUI;
@@ -86,7 +86,7 @@
@Override
public Component doCreateWidget(Object parent) {
if (dateField == null) {
- dateField = new CustomField();
+ dateField = new TypedCustomField();
dateField.initField();
dateField.addStyleName(CSS_CLASS_CONTROL);
dateField.setImmediate(true);
@@ -244,7 +244,7 @@
* @param customfield
* the field
*/
- protected void createBindings(YDateTime yField, CustomField customfield) {
+ protected void createBindings(YDateTime yField, TypedCustomField customfield) {
// create the model binding from widget to ECView-model
binding_valueToUI = createBindingsValue(castEObject(getModel()),
ExtensionModelPackage.Literals.YDATE_TIME__VALUE, customfield.field, null, null);
@@ -408,9 +408,8 @@
* The Class CustomField.
*/
@SuppressWarnings("serial")
- private class CustomField extends com.vaadin.ui.CustomField<Date> {
+ private class TypedCustomField extends com.vaadin.ui.CustomField<Date> {
private DateField field;
- private Button resetDate;
private ObjectProperty<Date> property;
private boolean showISOWeekNumber;
@@ -418,22 +417,24 @@
protected Component initContent() {
field.setShowISOWeekNumbers(showISOWeekNumber);
property.addValueChangeListener(e -> {
- super.setValue((Date) e.getProperty().getValue());
+ super.setValue((Date) e.getProperty().getValue(), false, true);
});
- resetDate = new Button();
+ Button resetDate = new Button();
resetDate.setIcon(FontAwesome.CALENDAR_CHECK_O);
resetDate.addClickListener(e -> {
property.setValue(new Date(System.currentTimeMillis()));
super.focus();
});
- setFocusDelegate(field);
-
- resetDate.setVisible(field.isVisible());
- resetDate.setEnabled(field.isEnabled());
- if(field.isReadOnly()){
+ this.setReadOnly(field.isReadOnly());
+ this.setEnabled(field.isEnabled());
+ this.setVisible(field.isVisible());
+
+ if(field.isReadOnly() || !field.isEnabled()){
resetDate.setVisible(false);
- }
+ }
+
+ setFocusDelegate(field);
HorizontalLayout layout = new HorizontalLayout(field, resetDate);
layout.setStyleName(ValoTheme.LAYOUT_COMPONENT_GROUP);
@@ -491,6 +492,22 @@
reportValidationError(message);
return message;
}
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see com.vaadin.ui.AbstractField#setConvertedValue(java.lang.Object)
+ */
+ @Override
+ public void setConvertedValue(Object value) {
+ boolean oldReadonly = isReadOnly();
+ try {
+ setReadOnly(false);
+ super.setConvertedValue(value);
+ } finally {
+ setReadOnly(oldReadonly);
+ }
+ }
}
/**
diff --git a/org.eclipse.osbp.runtime.web.ecview.presentation.vaadin/src/org/eclipse/osbp/runtime/web/ecview/presentation/vaadin/internal/DecimalFieldPresentation.java b/org.eclipse.osbp.runtime.web.ecview.presentation.vaadin/src/org/eclipse/osbp/runtime/web/ecview/presentation/vaadin/internal/DecimalFieldPresentation.java
index cca4cd3..bbaf4b4 100644
--- a/org.eclipse.osbp.runtime.web.ecview.presentation.vaadin/src/org/eclipse/osbp/runtime/web/ecview/presentation/vaadin/internal/DecimalFieldPresentation.java
+++ b/org.eclipse.osbp.runtime.web.ecview.presentation.vaadin/src/org/eclipse/osbp/runtime/web/ecview/presentation/vaadin/internal/DecimalFieldPresentation.java
@@ -38,8 +38,6 @@
import org.eclipse.osbp.runtime.web.vaadin.components.fields.DecimalField;
import org.eclipse.osbp.runtime.web.vaadin.databinding.VaadinObservables;
-import com.vaadin.data.Property;
-import com.vaadin.data.Property.ValueChangeEvent;
import com.vaadin.data.util.ObjectProperty;
import com.vaadin.data.util.converter.Converter;
import com.vaadin.server.ErrorMessage;
@@ -48,7 +46,6 @@
import com.vaadin.ui.ComponentContainer;
import com.vaadin.ui.Field;
-// TODO: Auto-generated Javadoc
/**
* This presenter is responsible to render a text area on the given layout.
*/
@@ -80,7 +77,6 @@
/**
* {@inheritDoc}
*/
- @SuppressWarnings({ "serial" })
@Override
public Component doCreateWidget(Object parent) {
if (decimalField == null) {
@@ -103,7 +99,6 @@
if (modelAccess.isCssClassValid()) {
decimalField.addStyleName(modelAccess.getCssClass());
}
-
applyCaptions();
doApplyDatatype(modelAccess.yField.getDatatype());
diff --git a/org.eclipse.osbp.runtime.web.ecview.presentation.vaadin/src/org/eclipse/osbp/runtime/web/ecview/presentation/vaadin/internal/FilteringComponentPresentation.java b/org.eclipse.osbp.runtime.web.ecview.presentation.vaadin/src/org/eclipse/osbp/runtime/web/ecview/presentation/vaadin/internal/FilteringComponentPresentation.java
index fba4eb0..660b125 100644
--- a/org.eclipse.osbp.runtime.web.ecview.presentation.vaadin/src/org/eclipse/osbp/runtime/web/ecview/presentation/vaadin/internal/FilteringComponentPresentation.java
+++ b/org.eclipse.osbp.runtime.web.ecview.presentation.vaadin/src/org/eclipse/osbp/runtime/web/ecview/presentation/vaadin/internal/FilteringComponentPresentation.java
@@ -30,6 +30,7 @@
import org.eclipse.osbp.runtime.common.util.BeanUtils;
import org.eclipse.osbp.runtime.designer.api.IDesignerService.DesignEvent;
import org.eclipse.osbp.runtime.web.ecview.presentation.vaadin.common.AbstractEmbeddedWidgetPresenter;
+import org.eclipse.osbp.runtime.web.ecview.presentation.vaadin.internal.util.Util;
import org.eclipse.osbp.runtime.web.vaadin.components.fields.filter2.FilteringComponent;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
diff --git a/org.eclipse.osbp.runtime.web.ecview.presentation.vaadin/src/org/eclipse/osbp/runtime/web/ecview/presentation/vaadin/internal/FocusLosingButton.java b/org.eclipse.osbp.runtime.web.ecview.presentation.vaadin/src/org/eclipse/osbp/runtime/web/ecview/presentation/vaadin/internal/FocusLosingButton.java
new file mode 100644
index 0000000..bdd9e0d
--- /dev/null
+++ b/org.eclipse.osbp.runtime.web.ecview.presentation.vaadin/src/org/eclipse/osbp/runtime/web/ecview/presentation/vaadin/internal/FocusLosingButton.java
@@ -0,0 +1,29 @@
+package org.eclipse.osbp.runtime.web.ecview.presentation.vaadin.internal;
+
+import com.vaadin.ui.Button;
+import com.vaadin.ui.Component;
+
+public class FocusLosingButton extends Button implements Button.ClickListener {
+ /**
+ *
+ */
+ private static final long serialVersionUID = -1946875741448360772L;
+
+ public FocusLosingButton() {
+ super();
+ addClickListener(this);
+ }
+
+ @Override
+ public void buttonClick(ClickEvent event) {
+ Component parent = this.getParent();
+ while (parent != null) {
+ if(parent instanceof Component.Focusable) {
+ ((Component.Focusable) parent).focus();
+ break;
+ } else {
+ parent = parent.getParent();
+ }
+ }
+ }
+}
diff --git a/org.eclipse.osbp.runtime.web.ecview.presentation.vaadin/src/org/eclipse/osbp/runtime/web/ecview/presentation/vaadin/internal/NumericFieldPresentation.java b/org.eclipse.osbp.runtime.web.ecview.presentation.vaadin/src/org/eclipse/osbp/runtime/web/ecview/presentation/vaadin/internal/NumericFieldPresentation.java
index 7ef9a7d..3ee447e 100644
--- a/org.eclipse.osbp.runtime.web.ecview.presentation.vaadin/src/org/eclipse/osbp/runtime/web/ecview/presentation/vaadin/internal/NumericFieldPresentation.java
+++ b/org.eclipse.osbp.runtime.web.ecview.presentation.vaadin/src/org/eclipse/osbp/runtime/web/ecview/presentation/vaadin/internal/NumericFieldPresentation.java
@@ -451,5 +451,21 @@
public void clear() {
setValue("0");
}
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see com.vaadin.ui.AbstractField#setConvertedValue(java.lang.Object)
+ */
+ @Override
+ public void setConvertedValue(Object value) {
+ boolean oldReadonly = isReadOnly();
+ try {
+ setReadOnly(false);
+ super.setConvertedValue(value);
+ } finally {
+ setReadOnly(oldReadonly);
+ }
+ }
}
}
diff --git a/org.eclipse.osbp.runtime.web.ecview.presentation.vaadin/src/org/eclipse/osbp/runtime/web/ecview/presentation/vaadin/internal/NumericSearchFieldPresentation.java b/org.eclipse.osbp.runtime.web.ecview.presentation.vaadin/src/org/eclipse/osbp/runtime/web/ecview/presentation/vaadin/internal/NumericSearchFieldPresentation.java
index a6b2e39..d364237 100644
--- a/org.eclipse.osbp.runtime.web.ecview.presentation.vaadin/src/org/eclipse/osbp/runtime/web/ecview/presentation/vaadin/internal/NumericSearchFieldPresentation.java
+++ b/org.eclipse.osbp.runtime.web.ecview.presentation.vaadin/src/org/eclipse/osbp/runtime/web/ecview/presentation/vaadin/internal/NumericSearchFieldPresentation.java
@@ -85,7 +85,7 @@
IECViewBindingManager.class.getName());
field = new NumericSearchField(getEditpart().getId(),
modelAccess.yField.getPropertyPath(),
- modelAccess.yField.getType(), bm.getDatabindingContext());
+ (Class<? extends Number>) modelAccess.yField.getType(), bm.getDatabindingContext());
field.addStyleName(CSS_CLASS_CONTROL);
field.addStyleName(IConstants.CSS_CLASS_SEARCHFIELD);
diff --git a/org.eclipse.osbp.runtime.web.ecview.presentation.vaadin/src/org/eclipse/osbp/runtime/web/ecview/presentation/vaadin/internal/PasswordFieldPresentation.java b/org.eclipse.osbp.runtime.web.ecview.presentation.vaadin/src/org/eclipse/osbp/runtime/web/ecview/presentation/vaadin/internal/PasswordFieldPresentation.java
index 4f55c56..2348d6a 100644
--- a/org.eclipse.osbp.runtime.web.ecview.presentation.vaadin/src/org/eclipse/osbp/runtime/web/ecview/presentation/vaadin/internal/PasswordFieldPresentation.java
+++ b/org.eclipse.osbp.runtime.web.ecview.presentation.vaadin/src/org/eclipse/osbp/runtime/web/ecview/presentation/vaadin/internal/PasswordFieldPresentation.java
@@ -343,5 +343,21 @@
reportValidationError(message);
return message;
}
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see com.vaadin.ui.AbstractField#setConvertedValue(java.lang.Object)
+ */
+ @Override
+ public void setConvertedValue(Object value) {
+ boolean oldReadonly = isReadOnly();
+ try {
+ setReadOnly(false);
+ super.setConvertedValue(value);
+ } finally {
+ setReadOnly(oldReadonly);
+ }
+ }
}
}
diff --git a/org.eclipse.osbp.runtime.web.ecview.presentation.vaadin/src/org/eclipse/osbp/runtime/web/ecview/presentation/vaadin/internal/SliderPresentation.java b/org.eclipse.osbp.runtime.web.ecview.presentation.vaadin/src/org/eclipse/osbp/runtime/web/ecview/presentation/vaadin/internal/SliderPresentation.java
index 7939141..9cdd3ad 100644
--- a/org.eclipse.osbp.runtime.web.ecview.presentation.vaadin/src/org/eclipse/osbp/runtime/web/ecview/presentation/vaadin/internal/SliderPresentation.java
+++ b/org.eclipse.osbp.runtime.web.ecview.presentation.vaadin/src/org/eclipse/osbp/runtime/web/ecview/presentation/vaadin/internal/SliderPresentation.java
@@ -389,5 +389,21 @@
reportValidationError(message);
return message;
}
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see com.vaadin.ui.AbstractField#setConvertedValue(java.lang.Object)
+ */
+ @Override
+ public void setConvertedValue(Object value) {
+ boolean oldReadonly = isReadOnly();
+ try {
+ setReadOnly(false);
+ super.setConvertedValue(value);
+ } finally {
+ setReadOnly(oldReadonly);
+ }
+ }
}
}
diff --git a/org.eclipse.osbp.runtime.web.ecview.presentation.vaadin/src/org/eclipse/osbp/runtime/web/ecview/presentation/vaadin/internal/TabPresentation.java b/org.eclipse.osbp.runtime.web.ecview.presentation.vaadin/src/org/eclipse/osbp/runtime/web/ecview/presentation/vaadin/internal/TabPresentation.java
index 9a30020..aeae179 100644
--- a/org.eclipse.osbp.runtime.web.ecview.presentation.vaadin/src/org/eclipse/osbp/runtime/web/ecview/presentation/vaadin/internal/TabPresentation.java
+++ b/org.eclipse.osbp.runtime.web.ecview.presentation.vaadin/src/org/eclipse/osbp/runtime/web/ecview/presentation/vaadin/internal/TabPresentation.java
@@ -19,6 +19,7 @@
import org.eclipse.osbp.ecview.core.common.editpart.emf.ElementEditpart;
import org.eclipse.osbp.ecview.core.common.presentation.IWidgetPresentation;
import org.eclipse.osbp.ecview.core.extension.model.extension.YTab;
+import org.eclipse.osbp.ecview.core.extension.model.extension.YTabSheet;
import org.eclipse.osbp.ecview.core.ui.core.editparts.extension.ITabEditpart;
import org.eclipse.osbp.ecview.core.ui.core.editparts.extension.presentation.ITabPresentation;
import org.eclipse.osbp.runtime.common.i18n.II18nService;
@@ -27,19 +28,22 @@
import com.vaadin.ui.Alignment;
import com.vaadin.ui.Component;
import com.vaadin.ui.ComponentContainer;
+import com.vaadin.ui.Grid;
+import com.vaadin.ui.Table;
import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.TabSheet;
import com.vaadin.ui.TabSheet.Tab;
+import com.vaadin.ui.VerticalLayout;
/**
* This presenter is responsible to render a tab sheet on the given layout.
*/
-public class TabPresentation extends AbstractTabPresenter<Component> implements
- ITabPresentation<Component> {
+public class TabPresentation extends AbstractTabPresenter<Component> implements ITabPresentation<Component> {
private Tab tab;
private ModelAccess modelAccess;
private HorizontalLayout tabContent;
+ private int tabIndex;
/**
* The constructor.
@@ -58,8 +62,10 @@
TabSheet tabSheet = (TabSheet) parent;
YTab yTab = (YTab) getModel();
- IEmbeddableEditpart childEditpart = ElementEditpart.getEditpart(
- getViewContext(), yTab.getEmbeddable());
+ IEmbeddableEditpart childEditpart = ElementEditpart.getEditpart(getViewContext(), yTab.getEmbeddable());
+
+ YTabSheet yTabSheet = (YTabSheet) yTab.eContainer();
+ tabIndex = yTabSheet.getTabs().indexOf(yTab);
tabContent = new HorizontalLayout();
tabContent.setSizeFull();
@@ -67,30 +73,59 @@
tab = tabSheet.addTab(tabContent, "content missing");
return tabContent;
}
- IWidgetPresentation<Component> childPresentation = childEditpart
- .getPresentation();
-
- Component childContent = childPresentation.createWidget(tabContent);
- childContent.setSizeFull();
- tabContent.addComponent(childContent);
- tabContent.setExpandRatio(childContent, 1.0f);
- tabContent.setComponentAlignment(childContent, Alignment.TOP_LEFT);
tab = tabSheet.addTab(tabContent);
+ if (tabIndex == 0) {
+ renderContent();
+ } else {
+ tabSheet.addSelectedTabChangeListener(e -> {
+ IEmbeddableEditpart editpart = ElementEditpart.getEditpart(getViewContext(), yTab.getEmbeddable());
+ if (tabSheet.getSelectedTab() == tabContent) {
+ if (!editpart.isRendered()) {
+ renderContent();
+ }
+ } else {
+ if (tabIndex != 0) {
+ IWidgetPresentation<Component> childPresentation = editpart.getPresentation();
+ if (childPresentation.isRendered()) {
+ tabContent.removeComponent(childPresentation.getWidget());
+ childPresentation.unrender();
+ }
+ }
+ }
+ });
+ }
+
if (modelAccess.isCssIdValid()) {
tab.setId(modelAccess.getCssID());
} else {
tab.setId(getEditpart().getId());
}
-
registerAtLocaleChangedService();
-
applyCaptions();
}
return tab.getComponent();
}
+ private void renderContent() {
+ YTab yTab = (YTab) getModel();
+ IEmbeddableEditpart childEditpart = ElementEditpart.getEditpart(getViewContext(), yTab.getEmbeddable());
+ IWidgetPresentation<Component> childPresentation = childEditpart.getPresentation();
+ Component childContent = childPresentation.createWidget(tabContent);
+ childContent.setSizeFull();
+ tabContent.addComponent(childContent);
+ tabContent.setExpandRatio(childContent, 1.0f);
+ tabContent.setComponentAlignment(childContent, Alignment.TOP_LEFT);
+ // workaround for wrong grid width calculation from vaadin
+ if(childContent instanceof VerticalLayout && ((VerticalLayout)childContent).getComponentCount() > 0) {
+ if(((VerticalLayout)childContent).getComponent(0) instanceof Grid || ((VerticalLayout)childContent).getComponent(0) instanceof Table) {
+ tabContent.setWidth("1000px");
+ tabContent.setHeight("600px");
+ }
+ }
+ }
+
@Override
protected void doUpdateLocale(Locale locale) {
// update the captions
@@ -103,8 +138,7 @@
protected void applyCaptions() {
II18nService service = getI18nService();
if (service != null && modelAccess.isLabelI18nKeyValid()) {
- tab.setCaption(service.getValue(modelAccess.getLabelI18nKey(),
- getLocale()));
+ tab.setCaption(service.getValue(modelAccess.getLabelI18nKey(), getLocale()));
} else {
if (modelAccess.isLabelValid()) {
tab.setCaption(modelAccess.getLabel());
@@ -141,11 +175,9 @@
unregisterFromLocaleChangedService();
YTab yTab = (YTab) getModel();
- IEmbeddableEditpart editpart = ElementEditpart.getEditpart(
- getViewContext(), yTab.getEmbeddable());
+ IEmbeddableEditpart editpart = ElementEditpart.getEditpart(getViewContext(), yTab.getEmbeddable());
- IWidgetPresentation<Component> childPresentation = editpart
- .getPresentation();
+ IWidgetPresentation<Component> childPresentation = editpart.getPresentation();
childPresentation.unrender();
tab = null;
@@ -187,8 +219,7 @@
* @return
*/
public boolean isLabelValid() {
- return yTab.getDatadescription() != null
- && yTab.getDatadescription().getLabel() != null;
+ return yTab.getDatadescription() != null && yTab.getDatadescription().getLabel() != null;
}
/**
@@ -206,8 +237,7 @@
* @return
*/
public boolean isLabelI18nKeyValid() {
- return yTab.getDatadescription() != null
- && yTab.getDatadescription().getLabelI18nKey() != null;
+ return yTab.getDatadescription() != null && yTab.getDatadescription().getLabelI18nKey() != null;
}
/**
diff --git a/org.eclipse.osbp.runtime.web.ecview.presentation.vaadin/src/org/eclipse/osbp/runtime/web/ecview/presentation/vaadin/internal/TabSheetPresentation.java b/org.eclipse.osbp.runtime.web.ecview.presentation.vaadin/src/org/eclipse/osbp/runtime/web/ecview/presentation/vaadin/internal/TabSheetPresentation.java
index 14f172f..03b9e28 100644
--- a/org.eclipse.osbp.runtime.web.ecview.presentation.vaadin/src/org/eclipse/osbp/runtime/web/ecview/presentation/vaadin/internal/TabSheetPresentation.java
+++ b/org.eclipse.osbp.runtime.web.ecview.presentation.vaadin/src/org/eclipse/osbp/runtime/web/ecview/presentation/vaadin/internal/TabSheetPresentation.java
@@ -31,7 +31,6 @@
import fi.jasoft.dragdroplayouts.DDTabSheet;
-// TODO: Auto-generated Javadoc
/**
* This presenter is responsible to render a tab sheet on the given layout.
*/
diff --git a/org.eclipse.osbp.runtime.web.ecview.presentation.vaadin/src/org/eclipse/osbp/runtime/web/ecview/presentation/vaadin/internal/TablePresentation.java b/org.eclipse.osbp.runtime.web.ecview.presentation.vaadin/src/org/eclipse/osbp/runtime/web/ecview/presentation/vaadin/internal/TablePresentation.java
index a5dd8db..b925b67 100644
--- a/org.eclipse.osbp.runtime.web.ecview.presentation.vaadin/src/org/eclipse/osbp/runtime/web/ecview/presentation/vaadin/internal/TablePresentation.java
+++ b/org.eclipse.osbp.runtime.web.ecview.presentation.vaadin/src/org/eclipse/osbp/runtime/web/ecview/presentation/vaadin/internal/TablePresentation.java
@@ -17,6 +17,7 @@
import java.util.HashSet;
import java.util.List;
import java.util.Locale;
+import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import java.util.Timer;
@@ -27,6 +28,7 @@
import org.eclipse.core.databinding.observable.IObservable;
import org.eclipse.core.databinding.observable.list.IObservableList;
import org.eclipse.core.databinding.observable.value.IObservableValue;
+import org.eclipse.e4.ui.model.application.ui.advanced.MPerspective;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.notify.impl.AdapterImpl;
import org.eclipse.emf.databinding.EMFProperties;
@@ -37,6 +39,7 @@
import org.eclipse.osbp.ecview.core.common.editpart.emf.ElementEditpart;
import org.eclipse.osbp.ecview.core.common.filter.IFilterablePresentation;
import org.eclipse.osbp.ecview.core.common.filter.IRefreshRowsPresentation;
+import org.eclipse.osbp.ecview.core.common.model.binding.YBindingEndpoint;
import org.eclipse.osbp.ecview.core.common.model.core.YEmbeddableBindingEndpoint;
import org.eclipse.osbp.ecview.core.common.model.core.YEmbeddableCollectionEndpoint;
import org.eclipse.osbp.ecview.core.common.model.core.YEmbeddableMultiSelectionEndpoint;
@@ -52,7 +55,6 @@
import org.eclipse.osbp.ecview.core.extension.model.extension.YSortColumn;
import org.eclipse.osbp.ecview.core.extension.model.extension.YTable;
import org.eclipse.osbp.ecview.core.ui.core.editparts.extension.ITableEditpart;
-import org.eclipse.osbp.ecview.extension.api.ILayoutingStrategy;
import org.eclipse.osbp.runtime.common.annotations.DtoUtils;
import org.eclipse.osbp.runtime.common.annotations.PropertiesUtil;
import org.eclipse.osbp.runtime.common.event.EventDispatcherEvent;
@@ -77,6 +79,8 @@
import org.eclipse.osbp.runtime.web.vaadin.common.resource.IResourceProvider;
import org.eclipse.osbp.ui.api.customfields.IBlobService;
import org.eclipse.osbp.ui.api.user.IUser;
+import org.eclipse.osbp.xtext.datamart.common.olap.DerivedMember;
+import org.eclipse.osbp.xtext.table.common.CellSetIndexedContainer;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -90,14 +94,10 @@
import com.vaadin.data.util.ObjectProperty;
import com.vaadin.data.util.converter.Converter;
import com.vaadin.data.util.converter.ConverterUtil;
-import com.vaadin.server.ClientConnector;
-import com.vaadin.server.ClientConnector.AttachEvent;
-import com.vaadin.server.ClientConnector.DetachEvent;
import com.vaadin.server.ErrorMessage;
import com.vaadin.server.Resource;
import com.vaadin.server.ThemeResource;
import com.vaadin.ui.AbstractSelect.ItemCaptionMode;
-import com.vaadin.ui.Grid.Column;
import com.vaadin.ui.CheckBox;
import com.vaadin.ui.Component;
import com.vaadin.ui.ComponentContainer;
@@ -115,8 +115,7 @@
*/
@SuppressWarnings({ "restriction", "serial" })
public class TablePresentation extends AbstractFieldWidgetPresenter<Component>
- implements IFilterablePresentation, IRefreshRowsPresentation, ClientConnector.DetachListener,
- ClientConnector.AttachListener, IEventDispatcher.Receiver {
+ implements IFilterablePresentation, IRefreshRowsPresentation, IEventDispatcher.Receiver {
private final static Logger log = LoggerFactory.getLogger("eventdispatcher");
@@ -149,6 +148,8 @@
private final String COLUMNS_KEY = "columns";
+ private String topic;
+
/**
* Constructor.
*
@@ -174,48 +175,51 @@
table.setMultiSelect(modelAccess.yField.getSelectionType() == YSelectionType.MULTI);
table.setSelectable(true);
table.setColumnReorderingAllowed(true);
+ if(modelAccess.yField.getPageLength() > 0) {
+ table.setPageLength(modelAccess.yField.getPageLength());
+ }
setupComponent(table, getCastedModel());
-
+ Class<?> bean = modelAccess.yField.getType();
+ if (bean != null) {
+ eventDispatcher = getViewContext().getService(IEventDispatcher.class.getName());
+ log.debug("tablepresentation eventdispatcher:{}", eventDispatcher);
+ blobService = getViewContext().getService(IBlobService.class.getName());
+ topic = NamingConventionsUtil.toFqnEntityName(bean.getName());
+ log.debug("tablepresentation eventdispatcher topic:{}", topic);
+ }
table.addValueChangeListener(new ValueChangeListener() {
@Override
public void valueChange(com.vaadin.data.Property.ValueChangeEvent event) {
- Class<?> bean = modelAccess.yField.getType();
- if (bean != null) {
- eventDispatcher = getViewContext().getService(IEventDispatcher.class.getName());
- log.debug("tablepresentation eventdispatcher:{}", eventDispatcher);
- blobService = getViewContext().getService(IBlobService.class.getName());
- String topic = NamingConventionsUtil.toFqnEntityName(bean.getName()) + "."
- + DtoUtils.getIdField(bean).getName();
- log.debug("tablepresentation eventdispatcher topic:{}", topic);
- EventDispatcherEvent evnt = new EventDispatcherEvent(EventDispatcherCommand.SELECT, topic,
- toString());
- Object value = table.getValue();
- log.debug("tablepresentation eventdispatcher value:{}", value);
- if (value != null) {
- if (table.getContainerDataSource() instanceof DeepResolvingBeanItemContainer) {
- DeepResolvingBeanItemContainer container = (DeepResolvingBeanItemContainer) table
- .getContainerDataSource();
- log.debug("tablepresentation eventdispatcher DeepResolvingBeanItemContainer:{}",
- container);
- DeepResolvingBeanItem<?> item = container.getItem(value);
- if (item != null) {
- log.debug(
- "tablepresentation eventdispatcher DeepResolvingBeanItemContainer id is:{}",
- DtoUtils.getIdValue(item.getBean()));
- evnt.addItem(EventDispatcherDataTag.ID, DtoUtils.getIdValue(item.getBean()));
- eventDispatcher.sendEvent(evnt);
- } else {
- log.debug(
- "tablepresentation eventdispatcher DeepResolvingBeanItemContainer item is null");
- }
+ MPerspective perspective = getViewContext().getService(MPerspective.class.getName());
+ EventDispatcherEvent evnt = new EventDispatcherEvent(perspective, EventDispatcherCommand.SELECT, topic + "."
+ + DtoUtils.getIdField(bean).getName(),
+ toString());
+ Object value = table.getValue();
+ log.debug("tablepresentation eventdispatcher value:{}", value);
+ if (value != null) {
+ if (table.getContainerDataSource() instanceof DeepResolvingBeanItemContainer) {
+ DeepResolvingBeanItemContainer container = (DeepResolvingBeanItemContainer) table
+ .getContainerDataSource();
+ log.debug("tablepresentation eventdispatcher DeepResolvingBeanItemContainer:{}",
+ container);
+ DeepResolvingBeanItem<?> item = container.getItem(value);
+ if (item != null) {
+ log.debug(
+ "tablepresentation eventdispatcher DeepResolvingBeanItemContainer id is:{}",
+ DtoUtils.getIdValue(item.getBean()));
+ evnt.addItem(EventDispatcherDataTag.ID, DtoUtils.getIdValue(item.getBean()));
+ eventDispatcher.sendEvent(evnt);
} else {
log.debug(
- "tablepresentation eventdispatcher container is no DeepResolvingBeanItemContainer");
+ "tablepresentation eventdispatcher DeepResolvingBeanItemContainer item is null");
}
} else {
- evnt.addItem(EventDispatcherDataTag.ID, null);
- eventDispatcher.sendEvent(evnt);
+ log.debug(
+ "tablepresentation eventdispatcher container is no DeepResolvingBeanItemContainer");
}
+ } else {
+ evnt.addItem(EventDispatcherDataTag.ID, null);
+ eventDispatcher.sendEvent(evnt);
}
}
});
@@ -359,7 +363,6 @@
table.addStyleName(modelAccess.getCssClass());
}
-
// DO NOT MOVE THE FOLLOWING CODE LINES!
// The setting of the column widths from the persisted user
// properties only works after the call of "applyCaptions()"
@@ -380,15 +383,40 @@
} else {
table.setColumnCollapsed(propertyId, false);
}
- Object[] visibleColumns = user.getColumnUtil()
- .getVisibleColumns(this.getClass().getCanonicalName() + "." + "columns");
- if (visibleColumns != null) {
- table.setVisibleColumns(visibleColumns);
+ if (table.getContainerDataSource() instanceof CellSetIndexedContainer){
+ Map<Object, Integer> visibleColumnsMap = user.getColumnUtil().getVisibleColumns(this.getClass().getCanonicalName() + ".columns");
+ if (visibleColumnsMap != null){
+ boolean unmodifiedVisibleColumns = true;
+ for (Object visibleColumnKey : visibleColumnsMap.keySet()) {
+ CellSetIndexedContainer container = (CellSetIndexedContainer) table.getContainerDataSource();
+ // creates a hash code by the column position members
+ int membersHash = 0;
+ if (container != null) {
+ List<DerivedMember> members = container.getColumnPosition(visibleColumnKey).getMembers();
+ for (DerivedMember member : members) {
+ membersHash += (member.getUniqueName() != null) ? member.getUniqueName().hashCode() : member.hashCode();
+ }
+ }
+ if (membersHash != visibleColumnsMap.get(visibleColumnKey)) {
+ unmodifiedVisibleColumns = false;
+ break;
+ }
+ }
+ if (unmodifiedVisibleColumns) {
+ try {
+ Object[] visibleColumns = visibleColumnsMap.values().toArray();
+ table.setVisibleColumns(visibleColumns );
+ } catch (IllegalArgumentException e) {
+ // this occurs if a saved column is no longer existing due to model changes
+ }
+ }
+ }
}
}
}
initializeField(table);
+ eventDispatcher.addEventReceiver(this);
}
return table;
}
@@ -409,7 +437,7 @@
/**
* Applies the column setting to the table.
*/
- @SuppressWarnings({ "serial", "unchecked" })
+ @SuppressWarnings("unchecked")
protected void applyColumns() {
Class<?> type = modelAccess.yField.getType();
@@ -519,9 +547,7 @@
// apply the converters
//
- for (
-
- YColumn yColumn : modelAccess.yField.getColumns()) {
+ for (YColumn yColumn : modelAccess.yField.getColumns()) {
if (yColumn.getConverter() == null) {
// try to derive the converter from the datatype property at
// field level
@@ -552,9 +578,6 @@
applySortOrder();
applyCellStyles();
-
- // apply the dirty flag
- // applyDirtyFlag(type);
}
@SuppressWarnings("serial")
@@ -574,42 +597,6 @@
});
}
- // protected void applyDirtyFlag(Class<?> type) {
- // final String dirtyProperty = getDirtyProperty(type);
- // // if a dirty property is available, we use it
- // if (dirtyProperty != null) {
- // table.setCellStyleGenerator(new Table.CellStyleGenerator() {
- // private static final long serialVersionUID = -2462674164411654020L;
- // @Override
- // public String getStyle(Table source, Object itemId,
- // Object propertyId) {
- // if (propertyId == null) {
- // return null;
- // }
- // if (propertyId.equals(dirtyProperty)) {
- // try {
- // boolean dirty = DtoUtils.invokeDirtyGetter(itemId);
- // return dirty ? "dirty" : null;
- // } catch (IllegalAccessException e) {
- // }
- // } else {
- // Class<?> propertyType = source.getContainerDataSource()
- // .getType(propertyId);
- // if (Number.class.isAssignableFrom(propertyType)) {
- // return "v-align-right";
- // }
- // }
- // }
- // table.setCellStyleGenerator(new Table.CellStyleGenerator() {
- // @Override
- // public String getStyle(Table source, Object itemId,
- // Object propertyId) {
- // if (propertyId == null) {
- // return null;
- // }
- // });
- // }
-
protected void applySortOrder() {
if (!modelAccess.yField.getSortOrder().isEmpty()
&& table.getContainerDataSource() instanceof Container.Sortable) {
@@ -810,6 +797,7 @@
}
if (bindableValue instanceof YEmbeddableCollectionEndpoint) {
+ addAutoBindingEndpoint((YBindingEndpoint) bindableValue);
return internalGetCollectionEndpoint();
} else if (bindableValue instanceof YEmbeddableSelectionEndpoint) {
return internalGetSelectionEndpoint((YEmbeddableSelectionEndpoint) bindableValue);
@@ -914,7 +902,6 @@
@Override
public void doUnrender() {
if (table != null) {
-
// unbind all active bindings
unbind();
@@ -925,7 +912,7 @@
// remove assocations
unassociateWidget(table);
-
+ eventDispatcher.removeEventReceiver(this);
table = null;
}
}
@@ -1235,27 +1222,25 @@
public void receiveEvent(EventDispatcherEvent event) {
switch (event.getCommand()) {
case REFRESH:
- // if(!event.getSender().equals("net.osbee.sample.foodmart.tables.CashRegister"))
- // {
- // if(event.getTopic().equals("net.osbee.sample.foodmart.entities.CashRegister")){
- refreshRows();
- // }
- // }
+ case SAVE:
+ if(event.getTopic().equals(topic)) {
+ refreshRows();
+ }
break;
- case SELECT:
+ case DELETE:
+ // we have to remove the item manually
+ if(event.getTopic().equals(topic)) {
+ for(Object item:table.getItemIds()) {
+ if(event.getData().get(EventDispatcherDataTag.ID).equals(DtoUtils.getIdValue(item))) {
+ table.removeItem(item);
+ refreshRows();
+ break;
+ }
+ }
+ }
break;
default:
break;
}
}
-
- @Override
- public void attach(AttachEvent event) {
- eventDispatcher.addEventReceiver(this);
- }
-
- @Override
- public void detach(DetachEvent event) {
- eventDispatcher.removeEventReceiver(this);
- }
}
\ No newline at end of file
diff --git a/org.eclipse.osbp.runtime.web.ecview.presentation.vaadin/src/org/eclipse/osbp/runtime/web/ecview/presentation/vaadin/internal/TextAreaPresentation.java b/org.eclipse.osbp.runtime.web.ecview.presentation.vaadin/src/org/eclipse/osbp/runtime/web/ecview/presentation/vaadin/internal/TextAreaPresentation.java
index f4b456d..5c03f11 100644
--- a/org.eclipse.osbp.runtime.web.ecview.presentation.vaadin/src/org/eclipse/osbp/runtime/web/ecview/presentation/vaadin/internal/TextAreaPresentation.java
+++ b/org.eclipse.osbp.runtime.web.ecview.presentation.vaadin/src/org/eclipse/osbp/runtime/web/ecview/presentation/vaadin/internal/TextAreaPresentation.java
@@ -33,7 +33,6 @@
import com.vaadin.ui.Field;
import com.vaadin.ui.TextArea;
-// TODO: Auto-generated Javadoc
/**
* This presenter is responsible to render a text area on the given layout.
*/
@@ -329,5 +328,21 @@
reportValidationError(message);
return message;
}
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see com.vaadin.ui.AbstractField#setConvertedValue(java.lang.Object)
+ */
+ @Override
+ public void setConvertedValue(Object value) {
+ boolean oldReadonly = isReadOnly();
+ try {
+ setReadOnly(false);
+ super.setConvertedValue(value);
+ } finally {
+ setReadOnly(oldReadonly);
+ }
+ }
}
}
diff --git a/org.eclipse.osbp.runtime.web.ecview.presentation.vaadin/src/org/eclipse/osbp/runtime/web/ecview/presentation/vaadin/internal/TextFieldPresentation.java b/org.eclipse.osbp.runtime.web.ecview.presentation.vaadin/src/org/eclipse/osbp/runtime/web/ecview/presentation/vaadin/internal/TextFieldPresentation.java
index 2c9094e..9e99517 100644
--- a/org.eclipse.osbp.runtime.web.ecview.presentation.vaadin/src/org/eclipse/osbp/runtime/web/ecview/presentation/vaadin/internal/TextFieldPresentation.java
+++ b/org.eclipse.osbp.runtime.web.ecview.presentation.vaadin/src/org/eclipse/osbp/runtime/web/ecview/presentation/vaadin/internal/TextFieldPresentation.java
@@ -34,7 +34,6 @@
import com.vaadin.ui.Field;
import com.vaadin.ui.TextField;
-// TODO: Auto-generated Javadoc
/**
* This presenter is responsible to render a text field on the given layout.
*/
@@ -324,6 +323,7 @@
return message;
}
+ @Override
protected void validate(String fieldValue)
throws Validator.InvalidValueException {
if(fieldValue != null && fieldValue.equals(getNullRepresentation())) {
@@ -332,5 +332,21 @@
super.validate(fieldValue);
}
}
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see com.vaadin.ui.AbstractField#setConvertedValue(java.lang.Object)
+ */
+ @Override
+ public void setConvertedValue(Object value) {
+ boolean oldReadonly = isReadOnly();
+ try {
+ setReadOnly(false);
+ super.setConvertedValue(value);
+ } finally {
+ setReadOnly(oldReadonly);
+ }
+ }
}
}
diff --git a/org.eclipse.osbp.runtime.web.ecview.presentation.vaadin/src/org/eclipse/osbp/runtime/web/ecview/presentation/vaadin/internal/ViewPresentation.java b/org.eclipse.osbp.runtime.web.ecview.presentation.vaadin/src/org/eclipse/osbp/runtime/web/ecview/presentation/vaadin/internal/ViewPresentation.java
index 04f2470..fcc782e 100644
--- a/org.eclipse.osbp.runtime.web.ecview.presentation.vaadin/src/org/eclipse/osbp/runtime/web/ecview/presentation/vaadin/internal/ViewPresentation.java
+++ b/org.eclipse.osbp.runtime.web.ecview.presentation.vaadin/src/org/eclipse/osbp/runtime/web/ecview/presentation/vaadin/internal/ViewPresentation.java
@@ -59,36 +59,32 @@
import com.vaadin.ui.Component;
import com.vaadin.ui.Component.Focusable;
import com.vaadin.ui.ComponentContainer;
-import com.vaadin.ui.CssLayout;
-import com.vaadin.ui.GridLayout;
+import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.TextField;
import com.vaadin.ui.UI;
import com.vaadin.ui.Window;
-// TODO: Auto-generated Javadoc
/**
* This presenter is responsible to render a text field on the given layout.
*/
-public class ViewPresentation extends AbstractDisposable implements
- IViewPresentation<Component>, ILocaleChangedService.LocaleListener,
- IDesignListener {
+public class ViewPresentation extends AbstractDisposable
+ implements IViewPresentation<Component>, ILocaleChangedService.LocaleListener, IDesignListener {
/** The Constant LOGGER. */
- private static final Logger LOGGER = LoggerFactory
- .getLogger(ViewPresentation.class);
+ private static final Logger LOGGER = LoggerFactory.getLogger(ViewPresentation.class);
/** The model access. */
private ModelAccess modelAccess;
-
+
/** The editpart. */
private final IViewEditpart editpart;
-
+
/** The component base. */
- private CssLayout componentBase;
-
+ private HorizontalLayout componentBase;
+
/** The component. */
- private GridLayout component;
-
+ private HorizontalLayout component;
+
/** The content. */
private IEmbeddableEditpart content;
@@ -106,8 +102,12 @@
this.modelAccess = new ModelAccess((YView) editpart.getModel());
}
- /* (non-Javadoc)
- * @see org.eclipse.osbp.ecview.core.common.presentation.IWidgetPresentation#getModel()
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.osbp.ecview.core.common.presentation.IWidgetPresentation#
+ * getModel()
*/
@Override
public Object getModel() {
@@ -124,15 +124,18 @@
return editpart;
}
- /* (non-Javadoc)
- * @see org.eclipse.osbp.ecview.core.common.presentation.IViewPresentation#render(java.util.Map)
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.osbp.ecview.core.common.presentation.IViewPresentation#render
+ * (java.util.Map)
*/
@Override
public void render(Map<String, Object> options) {
checkDisposed();
this.content = editpart.getContent();
- ComponentContainer parent = (ComponentContainer) editpart.getContext()
- .getRootLayout();
+ ComponentContainer parent = (ComponentContainer) editpart.getContext().getRootLayout();
createWidget(parent);
}
@@ -150,8 +153,7 @@
contentComponent = (Component) content.render(component);
component.addComponent(contentComponent);
- applyAlignment(contentComponent,
- modelAccess.yView.getContentAlignment());
+ applyAlignment(contentComponent, modelAccess.yView.getContentAlignment());
} else {
LOGGER.warn("Content is null");
}
@@ -210,14 +212,13 @@
if (componentBase == null) {
// create component base with grid layout to enable margins
//
- componentBase = new CssLayout();
+ componentBase = new HorizontalLayout();
componentBase.setSizeFull();
componentBase.addStyleName(IConstants.CSS_CLASS_CONTROL_BASE);
componentBase.addStyleName(IConstants.CSS_CLASS_YVIEW_PROVIDER);
// register shared state
- ISharedStateContext sharedState = getViewContext().getService(
- ISharedStateContext.class.getName());
+ ISharedStateContext sharedState = getViewContext().getService(ISharedStateContext.class.getName());
if (sharedState != null) {
Map<Object, Object> viewData = new HashMap<Object, Object>();
viewData.put(ISharedStateContext.class, sharedState);
@@ -228,7 +229,7 @@
parentContainer.addComponent(componentBase);
// create the component
- component = new GridLayout(1, 1);
+ component = new HorizontalLayout();
component.addStyleName(IConstants.CSS_CLASS_CONTROL);
componentBase.addComponent(component);
component.setSizeFull();
@@ -255,8 +256,7 @@
// register as an locale change listener
IViewContext context = ModelUtil.getViewContext(modelAccess.yView);
- ILocaleChangedService service = context
- .getService(ILocaleChangedService.ID);
+ ILocaleChangedService service = context.getService(ILocaleChangedService.ID);
if (service != null) {
service.addLocaleListener(this);
}
@@ -269,38 +269,47 @@
* Setup a listener to observe design events.
*/
protected void setupDesignListener() {
- IDesignerService designService = getViewContext().getService(
- IDesignerService.class.getName());
+ IDesignerService designService = getViewContext().getService(IDesignerService.class.getName());
if (designService != null) {
designService.addListener((IDesignListener) this);
- IWidgetDesignConfigurator cService = getViewContext().getService(
- IWidgetDesignConfigurator.class.getName());
+ IWidgetDesignConfigurator cService = getViewContext().getService(IWidgetDesignConfigurator.class.getName());
if (cService != null && getWidget() != null) {
- cService.configure(getWidget(), (YView) getModel(),
- designService.isDesignMode());
+ cService.configure(getWidget(), (YView) getModel(), designService.isDesignMode());
}
}
}
- /* (non-Javadoc)
- * @see org.eclipse.osbp.ecview.core.common.presentation.IWidgetPresentation#getWidget()
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.osbp.ecview.core.common.presentation.IWidgetPresentation#
+ * getWidget()
*/
@Override
public Component getWidget() {
return componentBase;
}
- /* (non-Javadoc)
- * @see org.eclipse.osbp.ecview.core.common.presentation.IWidgetPresentation#isRendered()
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.osbp.ecview.core.common.presentation.IWidgetPresentation#
+ * isRendered()
*/
@Override
public boolean isRendered() {
return componentBase != null;
}
- /* (non-Javadoc)
- * @see org.eclipse.osbp.ecview.core.common.presentation.IWidgetPresentation#getUIBindings()
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.osbp.ecview.core.common.presentation.IWidgetPresentation#
+ * getUIBindings()
*/
@Override
public Set<Binding> getUIBindings() {
@@ -315,26 +324,22 @@
if (componentBase != null) {
// unregister as an locale change listener
IViewContext context = ModelUtil.getViewContext(modelAccess.yView);
- ILocaleChangedService service = context
- .getService(ILocaleChangedService.ID);
+ ILocaleChangedService service = context.getService(ILocaleChangedService.ID);
if (service != null) {
service.removeLocaleListener(this);
}
// unregister the design listener
- IDesignerService designService = context
- .getService(IDesignerService.class.getName());
+ IDesignerService designService = context.getService(IDesignerService.class.getName());
if (designService != null) {
designService.removeListener((IDesignListener) this);
- IWidgetDesignConfigurator cService = context
- .getService(IWidgetDesignConfigurator.class.getName());
+ IWidgetDesignConfigurator cService = context.getService(IWidgetDesignConfigurator.class.getName());
if (cService != null && getWidget() != null) {
cService.configure(getWidget(), (YView) getModel(), false);
}
}
- ComponentContainer parent = ((ComponentContainer) componentBase
- .getParent());
+ ComponentContainer parent = ((ComponentContainer) componentBase.getParent());
if (parent != null) {
parent.removeComponent(componentBase);
}
@@ -352,8 +357,12 @@
}
}
- /* (non-Javadoc)
- * @see org.eclipse.osbp.ecview.core.common.presentation.IViewPresentation#setContent(org.eclipse.osbp.ecview.core.common.editpart.IEmbeddableEditpart)
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osbp.ecview.core.common.presentation.IViewPresentation#
+ * setContent(org.eclipse.osbp.ecview.core.common.editpart.
+ * IEmbeddableEditpart)
*/
@Override
public void setContent(IEmbeddableEditpart editpart) {
@@ -361,20 +370,23 @@
renderContent();
}
- /* (non-Javadoc)
- * @see org.eclipse.osbp.ecview.core.common.presentation.IViewPresentation#requestFocus(org.eclipse.osbp.ecview.core.common.editpart.IElementEditpart)
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osbp.ecview.core.common.presentation.IViewPresentation#
+ * requestFocus(org.eclipse.osbp.ecview.core.common.editpart.
+ * IElementEditpart)
*/
@Override
public void requestFocus(IElementEditpart toFocus) {
if (toFocus instanceof IEmbeddableEditpart) {
- Component component = (Component) ((IEmbeddableEditpart) toFocus)
- .getWidget();
+ Component component = (Component) ((IEmbeddableEditpart) toFocus).getWidget();
if (component instanceof Focusable) {
((Focusable) component).focus();
-
- if(component instanceof TextField){
+
+ if (component instanceof TextField) {
((TextField) component).selectAll();
- }else if(component instanceof SuggestTextField){
+ } else if (component instanceof SuggestTextField) {
SuggestTextField field = (SuggestTextField) component;
field.getTextField().selectAll();
}
@@ -382,32 +394,47 @@
}
}
- /* (non-Javadoc)
- * @see org.eclipse.osbp.ecview.core.common.presentation.IViewPresentation#getContent()
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osbp.ecview.core.common.presentation.IViewPresentation#
+ * getContent()
*/
@Override
public IEmbeddableEditpart getContent() {
return content;
}
- /* (non-Javadoc)
- * @see org.eclipse.osbp.ecview.core.common.presentation.IWidgetPresentation#getViewContext()
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.osbp.ecview.core.common.presentation.IWidgetPresentation#
+ * getViewContext()
*/
@Override
public IViewContext getViewContext() {
return getEditpart().getContext();
}
- /* (non-Javadoc)
- * @see org.eclipse.osbp.ecview.core.common.presentation.IWidgetPresentation#getObservableValue(java.lang.Object)
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.osbp.ecview.core.common.presentation.IWidgetPresentation#
+ * getObservableValue(java.lang.Object)
*/
@Override
public IObservable getObservableValue(Object model) {
throw new UnsupportedOperationException("Must be overridden!");
}
- /* (non-Javadoc)
- * @see org.eclipse.osbp.ecview.core.common.presentation.IViewPresentation#exec(java.lang.Runnable)
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.osbp.ecview.core.common.presentation.IViewPresentation#exec(
+ * java.lang.Runnable)
*/
@Override
public void exec(Runnable runnable) {
@@ -425,12 +452,15 @@
VaadinObservables.activateRealm(ui);
IEclipseContext eclipseContext = getViewContext().getService(IEclipseContext.class.getName());
ISession.makeCurrent(eclipseContext);
-
+
ui.accessSynchronously(runnable);
}
- /* (non-Javadoc)
- * @see org.eclipse.osbp.ecview.core.common.presentation.IViewPresentation#execAsync(java.lang.Runnable)
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osbp.ecview.core.common.presentation.IViewPresentation#
+ * execAsync(java.lang.Runnable)
*/
@Override
public Future<?> execAsync(Runnable runnable) {
@@ -446,24 +476,33 @@
return ui.access(runnable);
}
- /* (non-Javadoc)
- * @see org.eclipse.osbp.ecview.core.common.editpart.visibility.IVisibilityProcessable#apply(org.eclipse.osbp.ecview.core.common.visibility.IVisibilityHandler)
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osbp.ecview.core.common.editpart.visibility.
+ * IVisibilityProcessable#apply(org.eclipse.osbp.ecview.core.common.
+ * visibility.IVisibilityHandler)
*/
@Override
public void apply(IVisibilityHandler handler) {
}
- /* (non-Javadoc)
- * @see org.eclipse.osbp.ecview.core.common.presentation.IViewPresentation#updateContentAlignment()
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osbp.ecview.core.common.presentation.IViewPresentation#
+ * updateContentAlignment()
*/
public void updateContentAlignment() {
- applyAlignment(contentComponent,
- modelAccess.yView.getContentAlignment());
+ applyAlignment(contentComponent, modelAccess.yView.getContentAlignment());
}
- /* (non-Javadoc)
- * @see org.eclipse.osbp.ecview.core.common.presentation.IViewPresentation#updateSpacings()
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osbp.ecview.core.common.presentation.IViewPresentation#
+ * updateSpacings()
*/
@Override
public void updateSpacings() {
@@ -472,24 +511,35 @@
}
}
- /* (non-Javadoc)
- * @see org.eclipse.osbp.ecview.core.common.editpart.visibility.IVisibilityProcessable#resetVisibilityProperties()
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osbp.ecview.core.common.editpart.visibility.
+ * IVisibilityProcessable#resetVisibilityProperties()
*/
@Override
public void resetVisibilityProperties() {
}
- /* (non-Javadoc)
- * @see org.eclipse.osbp.ecview.core.common.presentation.IWidgetPresentation#notifyDatatypeChanged(org.eclipse.osbp.ecview.core.common.editpart.datatypes.IDatatypeEditpart.DatatypeChangeEvent)
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.osbp.ecview.core.common.presentation.IWidgetPresentation#
+ * notifyDatatypeChanged(org.eclipse.osbp.ecview.core.common.editpart.
+ * datatypes.IDatatypeEditpart.DatatypeChangeEvent)
*/
@Override
public void notifyDatatypeChanged(DatatypeChangeEvent event) {
}
- /* (non-Javadoc)
- * @see org.eclipse.osbp.ecview.core.common.context.ILocaleChangedService.LocaleListener#localeChanged(java.util.Locale)
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osbp.ecview.core.common.context.ILocaleChangedService.
+ * LocaleListener#localeChanged(java.util.Locale)
*/
@Override
public void localeChanged(Locale locale) {
@@ -497,15 +547,17 @@
component.setLocale(locale);
}
- /* (non-Javadoc)
- * @see org.eclipse.osbp.ecview.core.common.presentation.IViewPresentation#createService(java.lang.Class)
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osbp.ecview.core.common.presentation.IViewPresentation#
+ * createService(java.lang.Class)
*/
@SuppressWarnings({ "unchecked" })
@Override
public <A extends IUiKitBasedService> A createService(Class<A> serviceClass) {
if (serviceClass == IWidgetMouseClickService.class) {
- final WidgetMouseClickService service = new WidgetMouseClickService(
- getViewContext());
+ final WidgetMouseClickService service = new WidgetMouseClickService(getViewContext());
service.activate();
return (A) service;
} else if (serviceClass == IWidgetAssocationsService.class) {
@@ -513,8 +565,7 @@
return (A) service;
}
- throw new IllegalArgumentException(String.format(
- "%s is not a supported service.", serviceClass.getName()));
+ throw new IllegalArgumentException(String.format("%s is not a supported service.", serviceClass.getName()));
}
/**
@@ -527,12 +578,16 @@
}
- /* (non-Javadoc)
- * @see org.eclipse.osbp.ecview.core.common.presentation.IViewPresentation#openDialog(org.eclipse.osbp.ecview.core.common.editpart.IDialogEditpart, org.eclipse.osbp.ecview.core.common.editpart.binding.IBindableEndpointEditpart)
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osbp.ecview.core.common.presentation.IViewPresentation#
+ * openDialog(org.eclipse.osbp.ecview.core.common.editpart.IDialogEditpart,
+ * org.eclipse.osbp.ecview.core.common.editpart.binding.
+ * IBindableEndpointEditpart)
*/
@Override
- public void openDialog(IDialogEditpart dialogEditpart,
- IBindableEndpointEditpart inputData) {
+ public void openDialog(IDialogEditpart dialogEditpart, IBindableEndpointEditpart inputData) {
if (!isRendered()) {
return;
}
@@ -544,8 +599,11 @@
componentBase.getUI().addWindow(dialog);
}
- /* (non-Javadoc)
- * @see org.eclipse.osbp.ecview.core.common.presentation.IViewPresentation#closeDialog(org.eclipse.osbp.ecview.core.common.editpart.IDialogEditpart)
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osbp.ecview.core.common.presentation.IViewPresentation#
+ * closeDialog(org.eclipse.osbp.ecview.core.common.editpart.IDialogEditpart)
*/
@Override
public void closeDialog(IDialogEditpart dialogEditpart) {
@@ -736,11 +794,9 @@
* the event
*/
protected void configureForDesignMode(DesignEvent event) {
- IWidgetDesignConfigurator service = getViewContext().getService(
- IWidgetDesignConfigurator.class.getName());
+ IWidgetDesignConfigurator service = getViewContext().getService(IWidgetDesignConfigurator.class.getName());
if (service != null && getWidget() != null) {
- service.configure(getWidget(), (YView) getModel(),
- event.getType() == EventType.ENABLED);
+ service.configure(getWidget(), (YView) getModel(), event.getType() == EventType.ENABLED);
}
}
@@ -748,7 +804,7 @@
* An internal helper class.
*/
private static class ModelAccess {
-
+
/** The y view. */
private final YView yView;
diff --git a/org.eclipse.osbp.runtime.web.testbase/.project b/org.eclipse.osbp.runtime.web.testbase/.project
index 62b5601..8c5489e 100644
--- a/org.eclipse.osbp.runtime.web.testbase/.project
+++ b/org.eclipse.osbp.runtime.web.testbase/.project
@@ -25,9 +25,15 @@
<arguments>
</arguments>
</buildCommand>
+ <buildCommand>
+ <name>org.eclipse.babel.editor.rbeBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.pde.PluginNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.eclipse.babel.editor.rbeNature</nature>
</natures>
</projectDescription>
diff --git a/org.eclipse.osbp.runtime.web.vaadin.common/src/org/eclipse/osbp/runtime/web/vaadin/common/data/BeanServiceLazyLoadingContainer.java b/org.eclipse.osbp.runtime.web.vaadin.common/src/org/eclipse/osbp/runtime/web/vaadin/common/data/BeanServiceLazyLoadingContainer.java
index 20d301e..ca93392 100644
--- a/org.eclipse.osbp.runtime.web.vaadin.common/src/org/eclipse/osbp/runtime/web/vaadin/common/data/BeanServiceLazyLoadingContainer.java
+++ b/org.eclipse.osbp.runtime.web.vaadin.common/src/org/eclipse/osbp/runtime/web/vaadin/common/data/BeanServiceLazyLoadingContainer.java
@@ -269,6 +269,8 @@
*/
protected DeepResolvingBeanItem<BEANTYPE> internalAddItemAtEnd(Object newItemId,
DeepResolvingBeanItem<BEANTYPE> item) {
+ if (newItemId == null)
+ return null;
Object key = resolveBeanId(newItemId);
if (externalCache.containsKey(key)) {
cache.put(key, externalCache.get(key));
@@ -1000,8 +1002,8 @@
if (bean == null) {
return "";
}
- if(bean instanceof IDatamartContainer) {
- return ((IDatamartContainer)bean).getIdValue();
+ if (bean instanceof IDatamartContainer) {
+ return ((IDatamartContainer) bean).getIdValue();
} else {
return DtoUtils.getIdValue(bean);
}
diff --git a/org.eclipse.osbp.runtime.web.vaadin.components/src/org/eclipse/osbp/runtime/web/vaadin/components/fields/BeanReferenceField.java b/org.eclipse.osbp.runtime.web.vaadin.components/src/org/eclipse/osbp/runtime/web/vaadin/components/fields/BeanReferenceField.java
index 3482df9..79766da 100644
--- a/org.eclipse.osbp.runtime.web.vaadin.components/src/org/eclipse/osbp/runtime/web/vaadin/components/fields/BeanReferenceField.java
+++ b/org.eclipse.osbp.runtime.web.vaadin.components/src/org/eclipse/osbp/runtime/web/vaadin/components/fields/BeanReferenceField.java
@@ -17,6 +17,9 @@
import org.eclipse.osbp.runtime.web.vaadin.common.data.BeanServiceLazyLoadingContainer;
import org.eclipse.osbp.runtime.web.vaadin.common.data.IBeanSearchService;
import org.eclipse.osbp.runtime.web.vaadin.components.widget.LazyLoadingComboBox;
+import org.eclipse.osbp.ui.api.metadata.IDSLMetadataService;
+import org.eclipse.osbp.ui.api.themes.IThemeResourceService;
+import org.eclipse.osbp.ui.api.themes.IThemeResourceService.ThemeResourceType;
import com.vaadin.data.Container.Filter;
import com.vaadin.data.Property;
@@ -32,7 +35,6 @@
import com.vaadin.ui.NativeButton;
import com.vaadin.ui.TextField;
-// TODO: Auto-generated Javadoc
/**
* The Class BeanReferenceField.
*
@@ -47,6 +49,12 @@
/** The search service. */
private IBeanSearchService<BEAN> searchService;
+
+ /** The dsl metadata service. */
+ private IDSLMetadataService dslMetadataService;
+
+ /** The theme resource service. */
+ private IThemeResourceService themeResourceService;
/** The type. */
private final Class<BEAN> type;
@@ -72,13 +80,23 @@
/** The search button. */
private NativeButton searchButton;
+ /** The dialog button. */
+ private NativeButton dialogButton;
+
/** The search button icon. */
private Resource searchButtonIcon;
+ /** The dialog button icon. */
+ private Resource dialogButtonIcon;
+
+ private DialogHandle filterHandle;
+
private DialogHandle dialogHandle;
/** The use search dialog. */
- private boolean useSearchDialog = false;
+ private boolean useFilterDialog = false;
+
+ private boolean useDialog = false;
private boolean nullSelectionAllowed = true;
@@ -154,13 +172,31 @@
searchButton.setWidth("26px");
if (searchButtonIcon != null) {
searchButton.setIcon(searchButtonIcon);
- } else {
- searchButton.setIcon(new ThemeResource("icons/SearchButton.png"));
}
- searchButton.setVisible(useSearchDialog);
+ searchButton.setVisible(useFilterDialog);
+ if(useFilterDialog) {
+ root.addStyleName("l-referencesearchbutton");
+ }
+
+ dialogButton = new NativeButton();
+ dialogButton.addClickListener(new Button.ClickListener() {
+ @Override
+ public void buttonClick(ClickEvent event) {
+ openDialog();
+ }
+ });
+ dialogButton.setWidth("26px");
+ if (dialogButtonIcon != null) {
+ dialogButton.setIcon(dialogButtonIcon);
+ }
+ dialogButton.setVisible(useDialog);
+ if(useDialog) {
+ root.addStyleName("l-referencesidekickbutton");
+ }
root.addComponent(comboBox);
root.addComponent(searchButton);
+ root.addComponent(dialogButton);
// Create the property
comboBox.setPropertyDataSource(property);
@@ -173,14 +209,22 @@
return root;
}
+ public DialogHandle getFilterHandle() {
+ return filterHandle;
+ }
+
+ public void setFilterHandle(DialogHandle dialogHandle) {
+ this.filterHandle = dialogHandle;
+ }
+
public DialogHandle getDialogHandle() {
return dialogHandle;
}
-
+
public void setDialogHandle(DialogHandle dialogHandle) {
this.dialogHandle = dialogHandle;
}
-
+
/**
* If true, then null selections are allowed. False otherwise.
*
@@ -205,11 +249,21 @@
* @param useSearchDialog
* the new use dialog
*/
- public void setUseDialog(boolean useSearchDialog) {
- this.useSearchDialog = useSearchDialog;
+ public void setFilterDialog(boolean useSearchDialog) {
+ this.useFilterDialog = useSearchDialog;
}
/**
+ * If true, then the owner dialog button is visible. False otherwise.
+ *
+ * @param useDialog
+ * the new use dialog
+ */
+ public void setDialog(boolean useDialog) {
+ this.useDialog = useDialog;
+ }
+
+ /**
* Gets the internal combo box.
*
* @return the comboBox
@@ -222,6 +276,16 @@
* Open search dialog.
*/
protected void openSearchDialog() {
+ if (filterHandle != null) {
+ filterHandle.open();
+ }
+ }
+
+ /**
+ * open a specific dialog
+ * @param dialogFQN
+ */
+ protected void openDialog(){
if (dialogHandle != null) {
dialogHandle.open();
}
@@ -298,7 +362,7 @@
comboBox.setItemIconPropertyId(propertyId);
}
}
-
+
/**
* Dispose the field.
*/
diff --git a/org.eclipse.osbp.runtime.web.vaadin.components/src/org/eclipse/osbp/runtime/web/vaadin/components/fields/DecimalField.java b/org.eclipse.osbp.runtime.web.vaadin.components/src/org/eclipse/osbp/runtime/web/vaadin/components/fields/DecimalField.java
index 088ce29..1bd34ab 100644
--- a/org.eclipse.osbp.runtime.web.vaadin.components/src/org/eclipse/osbp/runtime/web/vaadin/components/fields/DecimalField.java
+++ b/org.eclipse.osbp.runtime.web.vaadin.components/src/org/eclipse/osbp/runtime/web/vaadin/components/fields/DecimalField.java
@@ -102,6 +102,22 @@
return new DecimalConverter();
}
+ /*
+ * (non-Javadoc)
+ *
+ * @see com.vaadin.ui.AbstractField#setConvertedValue(java.lang.Object)
+ */
+ @Override
+ public void setConvertedValue(Object value) {
+ boolean oldReadonly = isReadOnly();
+ try {
+ setReadOnly(false);
+ super.setConvertedValue(value);
+ } finally {
+ setReadOnly(oldReadonly);
+ }
+ }
+
/**
* Sets the Symbols which are used to Format.
*
diff --git a/org.eclipse.osbp.runtime.web.vaadin.components/src/org/eclipse/osbp/runtime/web/vaadin/components/fields/filter2/BetweenComponent.java b/org.eclipse.osbp.runtime.web.vaadin.components/src/org/eclipse/osbp/runtime/web/vaadin/components/fields/filter2/BetweenComponent.java
index e181568..785a2b8 100644
--- a/org.eclipse.osbp.runtime.web.vaadin.components/src/org/eclipse/osbp/runtime/web/vaadin/components/fields/filter2/BetweenComponent.java
+++ b/org.eclipse.osbp.runtime.web.vaadin.components/src/org/eclipse/osbp/runtime/web/vaadin/components/fields/filter2/BetweenComponent.java
@@ -46,13 +46,15 @@
i18nService = viewContext.getService(II18nService.ID);
themeResourceService = viewContext.getService(IThemeResourceService.ID);
-
+ setLocale(viewContext.getLocale());
+
ILocaleChangedService service = viewContext.getService(ILocaleChangedService.class.getName());
service.addLocaleListener(this);
mainLayout = createMainLayout();
mainLayout.setSizeFull();
setCompositionRoot(mainLayout);
+ updateCaptions();
}
protected String getCaptionInternal() {
diff --git a/org.eclipse.osbp.runtime.web.vaadin.components/src/org/eclipse/osbp/runtime/web/vaadin/components/fields/filter2/CompareComponent.java b/org.eclipse.osbp.runtime.web.vaadin.components/src/org/eclipse/osbp/runtime/web/vaadin/components/fields/filter2/CompareComponent.java
index 5897722..1311e38 100644
--- a/org.eclipse.osbp.runtime.web.vaadin.components/src/org/eclipse/osbp/runtime/web/vaadin/components/fields/filter2/CompareComponent.java
+++ b/org.eclipse.osbp.runtime.web.vaadin.components/src/org/eclipse/osbp/runtime/web/vaadin/components/fields/filter2/CompareComponent.java
@@ -50,7 +50,7 @@
i18nService = viewContext.getService(II18nService.ID);
themeResourceService = viewContext.getService(IThemeResourceService.ID);
-
+ setLocale(viewContext.getLocale());
ILocaleChangedService service = viewContext.getService(ILocaleChangedService.class.getName());
service.addLocaleListener(this);
@@ -58,6 +58,7 @@
mainLayout.setSizeFull();
setCompositionRoot(mainLayout);
+ updateCaptions();
}
protected String getCaptionInternal() {
diff --git a/org.eclipse.osbp.runtime.web.vaadin.components/src/org/eclipse/osbp/runtime/web/vaadin/components/fields/filter2/CompareDateComponent.java b/org.eclipse.osbp.runtime.web.vaadin.components/src/org/eclipse/osbp/runtime/web/vaadin/components/fields/filter2/CompareDateComponent.java
index 48c8390..6c45f2f 100644
--- a/org.eclipse.osbp.runtime.web.vaadin.components/src/org/eclipse/osbp/runtime/web/vaadin/components/fields/filter2/CompareDateComponent.java
+++ b/org.eclipse.osbp.runtime.web.vaadin.components/src/org/eclipse/osbp/runtime/web/vaadin/components/fields/filter2/CompareDateComponent.java
@@ -29,6 +29,8 @@
private DateField valueField;
+ private CompareType selectedCompareType;
+
@Inject
public CompareDateComponent(@Named("propertyId") String propertyId, IViewContext viewContext) {
super(propertyId, viewContext);
@@ -57,14 +59,13 @@
compareTypeField.setItemCaptionPropertyId("caption");
compareTypeField.setItemIconPropertyId("image");
-
return mainLayout;
}
protected void updateContainer() {
BeanItemContainer<CompareType> container = new BeanItemContainer<>(CompareType.class);
- container
- .addBean(new CompareType(CompareTypeEnum.EQ, toLabel(CompareTypeEnum.EQ), toImage(CompareTypeEnum.EQ)));
+ selectedCompareType = new CompareType(CompareTypeEnum.EQ, toLabel(CompareTypeEnum.EQ), toImage(CompareTypeEnum.EQ));
+ container.addBean(selectedCompareType);
container
.addBean(new CompareType(CompareTypeEnum.NE, toLabel(CompareTypeEnum.NE), toImage(CompareTypeEnum.NE)));
container
@@ -77,6 +78,7 @@
.addBean(new CompareType(CompareTypeEnum.LE, toLabel(CompareTypeEnum.LE), toImage(CompareTypeEnum.LE)));
compareTypeField.setContainerDataSource(container);
+ compareTypeField.select(selectedCompareType);
}
protected String toLabel(CompareTypeEnum enumx) {
@@ -132,6 +134,7 @@
public void resetAllFilters() {
compareTypeField.setValue(null);
valueField.setValue(null);
+ compareTypeField.select(selectedCompareType);
}
protected void updateCaptions() {
diff --git a/org.eclipse.osbp.runtime.web.vaadin.components/src/org/eclipse/osbp/runtime/web/vaadin/components/fields/filter2/CompareDecimalComponent.java b/org.eclipse.osbp.runtime.web.vaadin.components/src/org/eclipse/osbp/runtime/web/vaadin/components/fields/filter2/CompareDecimalComponent.java
index 04ab25a..169c80c 100644
--- a/org.eclipse.osbp.runtime.web.vaadin.components/src/org/eclipse/osbp/runtime/web/vaadin/components/fields/filter2/CompareDecimalComponent.java
+++ b/org.eclipse.osbp.runtime.web.vaadin.components/src/org/eclipse/osbp/runtime/web/vaadin/components/fields/filter2/CompareDecimalComponent.java
@@ -46,6 +46,8 @@
private TextField valueField;
+ private CompareType selectedCompareType;
+
@Inject
public CompareDecimalComponent(@Named("propertyId") String propertyId, @Named("type") Class<? extends Number> type,
IViewContext viewContext) {
@@ -77,14 +79,13 @@
updateContainer();
compareTypeField.setItemCaptionPropertyId("caption");
compareTypeField.setItemIconPropertyId("image");
-
return mainLayout;
}
protected void updateContainer() {
BeanItemContainer<CompareType> container = new BeanItemContainer<>(CompareType.class);
- container
- .addBean(new CompareType(CompareTypeEnum.EQ, toLabel(CompareTypeEnum.EQ), toImage(CompareTypeEnum.EQ)));
+ selectedCompareType = new CompareType(CompareTypeEnum.EQ, toLabel(CompareTypeEnum.EQ), toImage(CompareTypeEnum.EQ));
+ container.addBean(selectedCompareType);
container
.addBean(new CompareType(CompareTypeEnum.NE, toLabel(CompareTypeEnum.NE), toImage(CompareTypeEnum.NE)));
container
@@ -97,6 +98,7 @@
.addBean(new CompareType(CompareTypeEnum.LE, toLabel(CompareTypeEnum.LE), toImage(CompareTypeEnum.LE)));
compareTypeField.setContainerDataSource(container);
+ compareTypeField.select(selectedCompareType);
}
protected String toLabel(CompareTypeEnum enumx) {
@@ -153,6 +155,7 @@
public void resetAllFilters() {
compareTypeField.setValue(null);
valueField.setValue(null);
+ compareTypeField.select(selectedCompareType);
}
protected void updateCaptions() {
diff --git a/org.eclipse.osbp.runtime.web.vaadin.components/src/org/eclipse/osbp/runtime/web/vaadin/components/fields/filter2/CompareTextComponent.java b/org.eclipse.osbp.runtime.web.vaadin.components/src/org/eclipse/osbp/runtime/web/vaadin/components/fields/filter2/CompareTextComponent.java
index b6d7ea5..c2d96cd 100644
--- a/org.eclipse.osbp.runtime.web.vaadin.components/src/org/eclipse/osbp/runtime/web/vaadin/components/fields/filter2/CompareTextComponent.java
+++ b/org.eclipse.osbp.runtime.web.vaadin.components/src/org/eclipse/osbp/runtime/web/vaadin/components/fields/filter2/CompareTextComponent.java
@@ -12,7 +12,6 @@
import com.vaadin.data.util.filter.Like;
import com.vaadin.data.util.filter.Not;
import com.vaadin.server.Resource;
-import com.vaadin.server.ThemeResource;
import com.vaadin.ui.ComboBox;
import com.vaadin.ui.Component;
import com.vaadin.ui.HorizontalLayout;
@@ -28,6 +27,8 @@
private TextField valueField;
+ private CompareType selectedCompareType;
+
@Inject
public CompareTextComponent(@Named("propertyId") String propertyId, IViewContext viewContext) {
super(propertyId, viewContext);
@@ -58,7 +59,6 @@
compareTypeField.setItemCaptionPropertyId("caption");
compareTypeField.setItemIconPropertyId("image");
-
return mainLayout;
}
@@ -76,10 +76,11 @@
.addBean(new CompareType(CompareTypeEnum.LT, toLabel(CompareTypeEnum.LT), toImage(CompareTypeEnum.LT)));
container
.addBean(new CompareType(CompareTypeEnum.LE, toLabel(CompareTypeEnum.LE), toImage(CompareTypeEnum.LE)));
- container.addBean(
- new CompareType(CompareTypeEnum.LIKE, toLabel(CompareTypeEnum.LIKE), toImage(CompareTypeEnum.LIKE)));
+ selectedCompareType = new CompareType(CompareTypeEnum.LIKE, toLabel(CompareTypeEnum.LIKE), toImage(CompareTypeEnum.LIKE));
+ container.addBean(selectedCompareType);
compareTypeField.setContainerDataSource(container);
+ compareTypeField.select(selectedCompareType);
}
protected String toLabel(CompareTypeEnum enumx) {
@@ -87,9 +88,10 @@
}
protected Resource toImage(CompareTypeEnum enumx) {
- return themeResourceService.getThemeResource(enumx.name(), ThemeResourceType.ICON);
+ return themeResourceService.getThemeResource(enumx.name().toLowerCase(), ThemeResourceType.ICON);
}
+ @Override
public Filter getFilter() {
if (!valueField.isValid() || !compareTypeField.isValid()) {
return null;
@@ -138,8 +140,10 @@
public void resetAllFilters() {
compareTypeField.setValue(null);
valueField.setValue(null);
+ compareTypeField.select(selectedCompareType);
}
+ @Override
protected void updateCaptions() {
captionField.setValue(getCaptionInternal());
diff --git a/org.eclipse.osbp.runtime.web.vaadin.components/src/org/eclipse/osbp/runtime/web/vaadin/components/fields/filter2/FilteringComponent.java b/org.eclipse.osbp.runtime.web.vaadin.components/src/org/eclipse/osbp/runtime/web/vaadin/components/fields/filter2/FilteringComponent.java
index 927529d..ba9d150 100644
--- a/org.eclipse.osbp.runtime.web.vaadin.components/src/org/eclipse/osbp/runtime/web/vaadin/components/fields/filter2/FilteringComponent.java
+++ b/org.eclipse.osbp.runtime.web.vaadin.components/src/org/eclipse/osbp/runtime/web/vaadin/components/fields/filter2/FilteringComponent.java
@@ -2,10 +2,13 @@
import java.util.ArrayList;
import java.util.List;
+import java.util.Locale;
import java.util.function.Consumer;
import java.util.stream.Collectors;
+import org.eclipse.osbp.ecview.core.common.context.ILocaleChangedService;
import org.eclipse.osbp.ecview.core.common.context.IViewContext;
+import org.eclipse.osbp.runtime.common.i18n.II18nService;
import org.eclipse.osbp.runtime.web.vaadin.common.data.IBeanSearchServiceFactory;
import com.vaadin.data.Container.Filter;
@@ -18,9 +21,10 @@
import com.vaadin.ui.FormLayout;
import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.VerticalLayout;
+import com.vaadin.ui.Grid.Column;
@SuppressWarnings("serial")
-public class FilteringComponent<T> extends CustomComponent implements IFilteringComponent {
+public class FilteringComponent<T> extends CustomComponent implements IFilteringComponent, ILocaleChangedService.LocaleListener {
IViewContext viewContext;
@@ -40,6 +44,12 @@
private int filterCols;
+ private Button search;
+
+ private Button reset;
+
+ private II18nService i18nService;
+
public FilteringComponent(IViewContext viewContext, Class<T> rootType, boolean hideGrid) {
this(viewContext, rootType, 2, hideGrid);
}
@@ -61,16 +71,22 @@
mainLayout = createMainLayout();
setCompositionRoot(mainLayout);
setSizeFull();
+ ILocaleChangedService service = viewContext.getService(ILocaleChangedService.class.getName());
+ service.addLocaleListener(this);
+
+ i18nService = viewContext.getService(II18nService.ID);
+ setLocale(viewContext.getLocale());
}
protected ComponentContainer createMainLayout() {
VerticalLayout mainLayout = new VerticalLayout();
mainLayout.setSizeFull();
+ i18nService = viewContext.getService(II18nService.ID);
// buttons
//
- Button search = new Button("search", e -> {
+ search = new Button(Util.getCaption(i18nService, "search", "search", viewContext.getLocale()), e -> {
applyFilters();
if (applyFilterCallback != null) {
applyFilterCallback.callback();
@@ -78,7 +94,7 @@
});
search.setSizeUndefined();
- Button reset = new Button("reset", e -> {
+ reset = new Button(Util.getCaption(i18nService, "reset", "reset", viewContext.getLocale()), e -> {
resetAllFilters();
if (resetFilterCallback != null) {
resetFilterCallback.callback();
@@ -264,4 +280,10 @@
void callback();
}
+ @Override
+ public void localeChanged(Locale locale) {
+ search.setCaption(Util.getCaption(i18nService, "search", "search", locale));
+ reset.setCaption(Util.getCaption(i18nService, "reset", "reset", locale));
+ }
+
}
diff --git a/org.eclipse.osbp.runtime.web.vaadin.components/src/org/eclipse/osbp/runtime/web/vaadin/components/fields/filter2/FilteringGridComponent.java b/org.eclipse.osbp.runtime.web.vaadin.components/src/org/eclipse/osbp/runtime/web/vaadin/components/fields/filter2/FilteringGridComponent.java
index 56d833b..b7e0161 100644
--- a/org.eclipse.osbp.runtime.web.vaadin.components/src/org/eclipse/osbp/runtime/web/vaadin/components/fields/filter2/FilteringGridComponent.java
+++ b/org.eclipse.osbp.runtime.web.vaadin.components/src/org/eclipse/osbp/runtime/web/vaadin/components/fields/filter2/FilteringGridComponent.java
@@ -78,7 +78,8 @@
service.addLocaleListener(this);
i18nService = viewContext.getService(II18nService.ID);
- }
+ setLocale(viewContext.getLocale());
+}
public void dispose() {
ILocaleChangedService service = viewContext.getService(ILocaleChangedService.class.getName());
@@ -112,6 +113,8 @@
} else if (BeanUtils.isDate(type, propertyId)) {
col.setRenderer(new DateRenderer());
}
+ col.setHeaderCaption(
+ Util.getCaption(i18nService, (String) col.getPropertyId(), (String) col.getPropertyId(), viewContext.getLocale()));
}
diff --git a/org.eclipse.osbp.runtime.web.vaadin.osgi.tests/.project b/org.eclipse.osbp.runtime.web.vaadin.osgi.tests/.project
index c67773f..e31bfdf 100644
--- a/org.eclipse.osbp.runtime.web.vaadin.osgi.tests/.project
+++ b/org.eclipse.osbp.runtime.web.vaadin.osgi.tests/.project
@@ -40,11 +40,17 @@
<arguments>
</arguments>
</buildCommand>
+ <buildCommand>
+ <name>org.eclipse.babel.editor.rbeBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.xtext.ui.shared.xtextNature</nature>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
<nature>org.eclipse.pde.PluginNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.eclipse.babel.editor.rbeNature</nature>
</natures>
</projectDescription>