catch up with development
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..4dd0f62
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,50 @@
+*.class
+
+# Mobile Tools for Java (J2ME)
+.mtj.tmp/
+
+# Package Files #
+*.jar
+*.war
+*.ear
+
+# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
+hs_err_pid*
+**/git.properties
+**/target/
+**/*trace
+git.properties
+
+**/target/
+**/.metadata/
+
+**/emf-gen/**/.gitignore
+**/src-gen/**/.gitignore
+**/git.properties
+**/*.java._trace
+**/*.log
+**/*.log.properties
+
+**/bin/
+**/build/
+*.class
+*.ctrl
+**/Debug/
+.DS_Store
+*.ear
+*.war
+
+**/*.actionbin
+**/*.blipbin
+**/*.chartbin
+**/*.cubebin
+**/*.datatypebin
+**/*.dtobin
+**/*.entitybin
+**/*.servicebin
+**/*.tablebin
+**/*.uibin
+**/*.uisemanticbin
+**/*.xtendbin
+**/*.xtextbin
+
diff --git a/jenkins.build.config.xml b/jenkins.build.config.xml
index 256900f..74e19e4 100644
--- a/jenkins.build.config.xml
+++ b/jenkins.build.config.xml
@@ -15,6 +15,7 @@
<jenkins>
<!-- DO NOT EDIT BELOW THIS LINE -->
<jenkins.build.dependencies>
+ <jenkins.build.dependency>org.eclipse.osbp.blob</jenkins.build.dependency>
<jenkins.build.dependency>org.eclipse.osbp.dsl</jenkins.build.dependency>
<jenkins.build.dependency>org.eclipse.osbp.ecview.core</jenkins.build.dependency>
<jenkins.build.dependency>org.eclipse.osbp.ecview.extension.api</jenkins.build.dependency>
@@ -23,8 +24,8 @@
<jenkins.build.dependency>org.eclipse.osbp.runtime.web</jenkins.build.dependency>
<jenkins.build.dependency>org.eclipse.osbp.ui.api</jenkins.build.dependency>
<jenkins.build.dependency>org.eclipse.osbp.utils</jenkins.build.dependency>
- <jenkins.build.dependency>org.eclipse.osbp.utils.blob</jenkins.build.dependency>
<jenkins.build.dependency>org.eclipse.osbp.utils.functionnormalizer</jenkins.build.dependency>
+ <jenkins.build.dependency>org.eclipse.osbp.utils.themes.ui</jenkins.build.dependency>
<jenkins.build.dependency>org.eclipse.osbp.utils.ui</jenkins.build.dependency>
<jenkins.build.dependency>org.eclipse.osbp.vaaclipse</jenkins.build.dependency>
<jenkins.build.dependency>org.eclipse.osbp.xtext.functionlibrary</jenkins.build.dependency>
diff --git a/org.eclipse.osbp.ecview.extension.editparts.emf/.classpath b/org.eclipse.osbp.ecview.extension.editparts.emf/.classpath
new file mode 100644
index 0000000..43b9862
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.editparts.emf/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="target/classes"/>
+</classpath>
diff --git a/org.eclipse.osbp.ecview.extension.editparts.emf/.gitignore b/org.eclipse.osbp.ecview.extension.editparts.emf/.gitignore
new file mode 100644
index 0000000..b83d222
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.editparts.emf/.gitignore
@@ -0,0 +1 @@
+/target/
diff --git a/org.eclipse.osbp.ecview.extension.editparts.emf/.settings/org.eclipse.core.resources.prefs b/org.eclipse.osbp.ecview.extension.editparts.emf/.settings/org.eclipse.core.resources.prefs
new file mode 100644
index 0000000..99f26c0
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.editparts.emf/.settings/org.eclipse.core.resources.prefs
@@ -0,0 +1,2 @@
+eclipse.preferences.version=1
+encoding/<project>=UTF-8
diff --git a/org.eclipse.osbp.ecview.extension.editparts.emf/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.osbp.ecview.extension.editparts.emf/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 0000000..0c68a61
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.editparts.emf/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,7 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+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.8
diff --git a/org.eclipse.osbp.ecview.extension.editparts.emf/.settings/org.eclipse.m2e.core.prefs b/org.eclipse.osbp.ecview.extension.editparts.emf/.settings/org.eclipse.m2e.core.prefs
new file mode 100644
index 0000000..f897a7f
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.editparts.emf/.settings/org.eclipse.m2e.core.prefs
@@ -0,0 +1,4 @@
+activeProfiles=
+eclipse.preferences.version=1
+resolveWorkspaceProjects=true
+version=1
diff --git a/org.eclipse.osbp.ecview.extension.editparts.emf/.settings/org.eclipse.xtend.core.Xtend.prefs b/org.eclipse.osbp.ecview.extension.editparts.emf/.settings/org.eclipse.xtend.core.Xtend.prefs
new file mode 100644
index 0000000..19e3115
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.editparts.emf/.settings/org.eclipse.xtend.core.Xtend.prefs
@@ -0,0 +1,11 @@
+//outlet.DEFAULT_OUTPUT.sourceFolder.src/test/java.directory=src/test/generated-sources/xtend
+BuilderConfiguration.is_project_specific=true
+eclipse.preferences.version=1
+is_project_specific=true
+outlet.DEFAULT_OUTPUT.hideLocalSyntheticVariables=true
+outlet.DEFAULT_OUTPUT.installDslAsPrimarySource=false
+outlet.DEFAULT_OUTPUT.sourceFolder.emf-gen.directory=xtend-gen
+outlet.DEFAULT_OUTPUT.sourceFolder.src-gen.directory=xtend-gen
+outlet.DEFAULT_OUTPUT.sourceFolder.src.directory=xtend-gen
+outlet.DEFAULT_OUTPUT.sourceFolder.xtend-gen.directory=xtend-gen
+outlet.DEFAULT_OUTPUT.userOutputPerSourceFolder=true
diff --git a/org.eclipse.osbp.ecview.extension.editparts.emf/META-INF/MANIFEST.MF b/org.eclipse.osbp.ecview.extension.editparts.emf/META-INF/MANIFEST.MF
index 00d6add..254c6d1 100644
--- a/org.eclipse.osbp.ecview.extension.editparts.emf/META-INF/MANIFEST.MF
+++ b/org.eclipse.osbp.ecview.extension.editparts.emf/META-INF/MANIFEST.MF
@@ -13,10 +13,10 @@
org.eclipse.osbp.ecview.core.common.model;bundle-version="[0.9.0,0.10.0)",
org.eclipse.osbp.ecview.extension.model;bundle-version="[0.9.0,0.10.0)",
org.eclipse.osbp.ecview.extension.editparts;bundle-version="[0.9.0,0.10.0)",
- org.eclipse.core.databinding.observable;bundle-version="[1.4.1,1.5.0)",
- org.eclipse.core.databinding;bundle-version="[1.4.2,1.5.0)",
+ org.eclipse.core.databinding.observable;bundle-version="[1.6.0,1.7.0)",
+ org.eclipse.core.databinding;bundle-version="[1.6.0,1.7.0)",
org.eclipse.emf.databinding;bundle-version="1.3.0",
- org.eclipse.core.databinding.beans;bundle-version="1.2.200",
+ org.eclipse.core.databinding.beans;bundle-version="[1.3.100,1.4.0)",
org.eclipse.osbp.runtime.common;bundle-version="[0.9.0,0.10.0)",
org.eclipse.osbp.ecview.extension.api;bundle-version="[0.9.0,0.10.0)",
org.eclipse.osbp.ecview.core.util.emf;bundle-version="[0.9.0,0.10.0)"
diff --git a/org.eclipse.osbp.ecview.extension.editparts.emf/src/org/eclipse/osbp/ecview/extension/editparts/emf/EditpartManager.java b/org.eclipse.osbp.ecview.extension.editparts.emf/src/org/eclipse/osbp/ecview/extension/editparts/emf/EditpartManager.java
index f1a7534..2e80d44 100644
--- a/org.eclipse.osbp.ecview.extension.editparts.emf/src/org/eclipse/osbp/ecview/extension/editparts/emf/EditpartManager.java
+++ b/org.eclipse.osbp.ecview.extension.editparts.emf/src/org/eclipse/osbp/ecview/extension/editparts/emf/EditpartManager.java
@@ -36,6 +36,7 @@
import org.eclipse.osbp.ecview.extension.editparts.emf.converter.QuantityToStringConverterEditpart;
import org.eclipse.osbp.ecview.extension.editparts.emf.converter.SimpleDecimalConverterEditpart;
import org.eclipse.osbp.ecview.extension.editparts.emf.converter.StringToResourceConverterEditpart;
+import org.eclipse.osbp.ecview.extension.editparts.emf.converter.VaaclipseUiThemeToStringConverterEditpart;
import org.eclipse.osbp.ecview.extension.editparts.emf.strategies.DefaultLayoutingStrategyEditpart;
import org.eclipse.osbp.ecview.extension.editparts.emf.strategies.DelegatingFocusingStrategyEditpart;
import org.eclipse.osbp.ecview.extension.editparts.emf.strategies.DelegatingLayoutingStrategyEditpart;
@@ -70,6 +71,7 @@
import org.eclipse.osbp.ecview.extension.model.converter.YQuantityToStringConverter;
import org.eclipse.osbp.ecview.extension.model.converter.YSimpleDecimalConverter;
import org.eclipse.osbp.ecview.extension.model.converter.YStringToResourceConverter;
+import org.eclipse.osbp.ecview.extension.model.converter.YVaaclipseUiThemeToStringConverter;
import org.eclipse.osbp.ecview.extension.model.visibility.YAuthorizationVisibilityProcessor;
import org.eclipse.osbp.ecview.extension.model.visibility.YSubTypeVisibilityProcessor;
import org.eclipse.osbp.ecview.extension.model.visibility.YVisibilityPackage;
@@ -157,6 +159,8 @@
result = createNewInstance(CustomDecimalFieldEditpart.class);
} else if (yElement instanceof YObjectToStringConverter) {
result = createNewInstance(ObjectToStringConverterEditpart.class);
+ } else if (yElement instanceof YVaaclipseUiThemeToStringConverter) {
+ result = createNewInstance(VaaclipseUiThemeToStringConverterEditpart.class);
} else if (yElement instanceof YStringToResourceConverter) {
result = createNewInstance(StringToResourceConverterEditpart.class);
} else if (yElement instanceof YNumericToResourceConverter) {
diff --git a/org.eclipse.osbp.ecview.extension.editparts.emf/src/org/eclipse/osbp/ecview/extension/editparts/emf/components/services/ContextSensitiveLayoutSelector.java b/org.eclipse.osbp.ecview.extension.editparts.emf/src/org/eclipse/osbp/ecview/extension/editparts/emf/components/services/ContextSensitiveLayoutSelector.java
index ffe227e..a754fba 100644
--- a/org.eclipse.osbp.ecview.extension.editparts.emf/src/org/eclipse/osbp/ecview/extension/editparts/emf/components/services/ContextSensitiveLayoutSelector.java
+++ b/org.eclipse.osbp.ecview.extension.editparts.emf/src/org/eclipse/osbp/ecview/extension/editparts/emf/components/services/ContextSensitiveLayoutSelector.java
@@ -27,7 +27,7 @@
@Override
public String selectComponent(Object dto) {
- return (String) service.callFunctionLibrary(FUNCTION_GROUP, FUNCTION_NAME, dto);
+ return (String) service.invoke(FUNCTION_GROUP, FUNCTION_NAME, dto);
}
@Reference(cardinality=ReferenceCardinality.MANDATORY)
diff --git a/org.eclipse.osbp.ecview.extension.editparts.emf/src/org/eclipse/osbp/ecview/extension/editparts/emf/converter/VaaclipseUiThemeToStringConverterEditpart.java b/org.eclipse.osbp.ecview.extension.editparts.emf/src/org/eclipse/osbp/ecview/extension/editparts/emf/converter/VaaclipseUiThemeToStringConverterEditpart.java
new file mode 100644
index 0000000..caff486
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.editparts.emf/src/org/eclipse/osbp/ecview/extension/editparts/emf/converter/VaaclipseUiThemeToStringConverterEditpart.java
@@ -0,0 +1,25 @@
+/**
+ *
+ * Copyright (c) 2011, 2016 - Loetz GmbH&Co.KG (69115 Heidelberg, Germany)
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Florian Pirchner - Initial implementation
+ *
+ */
+package org.eclipse.osbp.ecview.extension.editparts.emf.converter;
+
+import org.eclipse.osbp.ecview.core.common.editpart.emf.ConverterEditpart;
+import org.eclipse.osbp.ecview.extension.editparts.converter.IVaaclipseUiThemeToStringConverterEditpart;
+
+/**
+ * The Class ObjectToStringConverterEditpart.
+ */
+public class VaaclipseUiThemeToStringConverterEditpart extends ConverterEditpart
+ implements IVaaclipseUiThemeToStringConverterEditpart {
+
+}
diff --git a/org.eclipse.osbp.ecview.extension.editparts.emf/src/org/eclipse/osbp/ecview/extension/editparts/emf/visibility/AuthorizationVisibilityProcessor.java b/org.eclipse.osbp.ecview.extension.editparts.emf/src/org/eclipse/osbp/ecview/extension/editparts/emf/visibility/AuthorizationVisibilityProcessor.java
index 76e4a62..418a001 100644
--- a/org.eclipse.osbp.ecview.extension.editparts.emf/src/org/eclipse/osbp/ecview/extension/editparts/emf/visibility/AuthorizationVisibilityProcessor.java
+++ b/org.eclipse.osbp.ecview.extension.editparts.emf/src/org/eclipse/osbp/ecview/extension/editparts/emf/visibility/AuthorizationVisibilityProcessor.java
@@ -33,7 +33,7 @@
import org.eclipse.osbp.ecview.core.common.visibility.IVisibilityProcessor;
import org.eclipse.osbp.ecview.extension.model.visibility.YAuthorizationVisibilityProcessor;
import org.eclipse.osbp.ui.api.useraccess.AbstractAuthorization.Action;
-import org.eclipse.osbp.ui.api.useraccess.AbstractAuthorization.Permission;
+import org.eclipse.osbp.ui.api.useraccess.AbstractAuthorization.Group;
import org.eclipse.osbp.ui.api.useraccess.IUserAccessService;
/**
@@ -286,21 +286,15 @@
if (userAccessService == null) {
target.setVisible(true);
} else {
- if(userAccessService.isPermitted(Permission.forDto(dtoName, Action.readable)).isPermitted()) {
+ if(userAccessService.isGranted(Group.DTO, Action.READABLE, dtoName)) {
target.setVisible(true);
target.setEditable(true);
target.setEnabled(true);
- boolean nameVisible = !userAccessService.isPermitted(
- Permission.forDtoProperty(dtoName, dtoProperty,
- Action.invisible)).isPermitted();
+ boolean nameVisible = !userAccessService.isVetoed(Group.DTO, Action.INVISIBLE, dtoName, dtoProperty);
if (nameVisible) {
- boolean nameEnabled = !userAccessService.isPermitted(
- Permission.forDtoProperty(dtoName, dtoProperty,
- Action.disabled)).isPermitted();
+ boolean nameEnabled = !userAccessService.isVetoed(Group.DTO, Action.DISABLED, dtoName, dtoProperty);
if (nameEnabled) {
- boolean nameEditable = !userAccessService.isPermitted(
- Permission.forDtoProperty(dtoName, dtoProperty,
- Action.noneditable)).isPermitted();
+ boolean nameEditable = !userAccessService.isVetoed(Group.DTO, Action.NONEDITABLE, dtoName, dtoProperty);
target.setEditable(nameEditable);
} else {
target.setEnabled(nameEnabled);
diff --git a/org.eclipse.osbp.ecview.extension.feature/.gitignore b/org.eclipse.osbp.ecview.extension.feature/.gitignore
new file mode 100644
index 0000000..1dd3331
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.feature/.gitignore
@@ -0,0 +1,2 @@
+/target/
+/target/
diff --git a/org.eclipse.osbp.ecview.extension.feature/.settings/org.eclipse.core.resources.prefs b/org.eclipse.osbp.ecview.extension.feature/.settings/org.eclipse.core.resources.prefs
new file mode 100644
index 0000000..99f26c0
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.feature/.settings/org.eclipse.core.resources.prefs
@@ -0,0 +1,2 @@
+eclipse.preferences.version=1
+encoding/<project>=UTF-8
diff --git a/org.eclipse.osbp.ecview.extension.feature/.settings/org.eclipse.m2e.core.prefs b/org.eclipse.osbp.ecview.extension.feature/.settings/org.eclipse.m2e.core.prefs
new file mode 100644
index 0000000..f897a7f
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.feature/.settings/org.eclipse.m2e.core.prefs
@@ -0,0 +1,4 @@
+activeProfiles=
+eclipse.preferences.version=1
+resolveWorkspaceProjects=true
+version=1
diff --git a/org.eclipse.osbp.ecview.extension.feature/.settings/org.eclipse.xtend.core.Xtend.prefs b/org.eclipse.osbp.ecview.extension.feature/.settings/org.eclipse.xtend.core.Xtend.prefs
new file mode 100644
index 0000000..19e3115
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.feature/.settings/org.eclipse.xtend.core.Xtend.prefs
@@ -0,0 +1,11 @@
+//outlet.DEFAULT_OUTPUT.sourceFolder.src/test/java.directory=src/test/generated-sources/xtend
+BuilderConfiguration.is_project_specific=true
+eclipse.preferences.version=1
+is_project_specific=true
+outlet.DEFAULT_OUTPUT.hideLocalSyntheticVariables=true
+outlet.DEFAULT_OUTPUT.installDslAsPrimarySource=false
+outlet.DEFAULT_OUTPUT.sourceFolder.emf-gen.directory=xtend-gen
+outlet.DEFAULT_OUTPUT.sourceFolder.src-gen.directory=xtend-gen
+outlet.DEFAULT_OUTPUT.sourceFolder.src.directory=xtend-gen
+outlet.DEFAULT_OUTPUT.sourceFolder.xtend-gen.directory=xtend-gen
+outlet.DEFAULT_OUTPUT.userOutputPerSourceFolder=true
diff --git a/org.eclipse.osbp.ecview.extension.grid.editparts.emf/.classpath b/org.eclipse.osbp.ecview.extension.grid.editparts.emf/.classpath
new file mode 100644
index 0000000..0f2de47
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.grid.editparts.emf/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
+ <classpathentry exported="true" kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="target/classes"/>
+</classpath>
diff --git a/org.eclipse.osbp.ecview.extension.grid.editparts.emf/.gitignore b/org.eclipse.osbp.ecview.extension.grid.editparts.emf/.gitignore
new file mode 100644
index 0000000..b83d222
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.grid.editparts.emf/.gitignore
@@ -0,0 +1 @@
+/target/
diff --git a/org.eclipse.osbp.ecview.extension.grid.editparts.emf/.settings/org.eclipse.core.resources.prefs b/org.eclipse.osbp.ecview.extension.grid.editparts.emf/.settings/org.eclipse.core.resources.prefs
new file mode 100644
index 0000000..99f26c0
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.grid.editparts.emf/.settings/org.eclipse.core.resources.prefs
@@ -0,0 +1,2 @@
+eclipse.preferences.version=1
+encoding/<project>=UTF-8
diff --git a/org.eclipse.osbp.ecview.extension.grid.editparts.emf/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.osbp.ecview.extension.grid.editparts.emf/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 0000000..0c68a61
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.grid.editparts.emf/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,7 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+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.8
diff --git a/org.eclipse.osbp.ecview.extension.grid.editparts.emf/.settings/org.eclipse.m2e.core.prefs b/org.eclipse.osbp.ecview.extension.grid.editparts.emf/.settings/org.eclipse.m2e.core.prefs
new file mode 100644
index 0000000..f897a7f
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.grid.editparts.emf/.settings/org.eclipse.m2e.core.prefs
@@ -0,0 +1,4 @@
+activeProfiles=
+eclipse.preferences.version=1
+resolveWorkspaceProjects=true
+version=1
diff --git a/org.eclipse.osbp.ecview.extension.grid.editparts.emf/.settings/org.eclipse.xtend.core.Xtend.prefs b/org.eclipse.osbp.ecview.extension.grid.editparts.emf/.settings/org.eclipse.xtend.core.Xtend.prefs
new file mode 100644
index 0000000..19e3115
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.grid.editparts.emf/.settings/org.eclipse.xtend.core.Xtend.prefs
@@ -0,0 +1,11 @@
+//outlet.DEFAULT_OUTPUT.sourceFolder.src/test/java.directory=src/test/generated-sources/xtend
+BuilderConfiguration.is_project_specific=true
+eclipse.preferences.version=1
+is_project_specific=true
+outlet.DEFAULT_OUTPUT.hideLocalSyntheticVariables=true
+outlet.DEFAULT_OUTPUT.installDslAsPrimarySource=false
+outlet.DEFAULT_OUTPUT.sourceFolder.emf-gen.directory=xtend-gen
+outlet.DEFAULT_OUTPUT.sourceFolder.src-gen.directory=xtend-gen
+outlet.DEFAULT_OUTPUT.sourceFolder.src.directory=xtend-gen
+outlet.DEFAULT_OUTPUT.sourceFolder.xtend-gen.directory=xtend-gen
+outlet.DEFAULT_OUTPUT.userOutputPerSourceFolder=true
diff --git a/org.eclipse.osbp.ecview.extension.grid.editparts.emf/META-INF/MANIFEST.MF b/org.eclipse.osbp.ecview.extension.grid.editparts.emf/META-INF/MANIFEST.MF
index 140e1ab..cb76c73 100644
--- a/org.eclipse.osbp.ecview.extension.grid.editparts.emf/META-INF/MANIFEST.MF
+++ b/org.eclipse.osbp.ecview.extension.grid.editparts.emf/META-INF/MANIFEST.MF
@@ -11,10 +11,10 @@
org.eclipse.osbp.ecview.core.extension.model;bundle-version="[0.9.0,0.10.0)",
org.eclipse.osbp.ecview.core.common;bundle-version="[0.9.0,0.10.0)",
org.eclipse.osbp.ecview.core.common.model;bundle-version="[0.9.0,0.10.0)",
- org.eclipse.core.databinding.observable;bundle-version="[1.4.1,1.5.0)",
- org.eclipse.core.databinding;bundle-version="[1.4.2,1.5.0)",
+ org.eclipse.core.databinding.observable;bundle-version="[1.6.0,1.7.0)",
+ org.eclipse.core.databinding;bundle-version="[1.6.0,1.7.0)",
org.eclipse.emf.databinding;bundle-version="1.3.0",
- org.eclipse.core.databinding.beans;bundle-version="1.2.200",
+ org.eclipse.core.databinding.beans;bundle-version="[1.3.100,1.4.0)",
org.eclipse.osbp.runtime.common;bundle-version="[0.9.0,0.10.0)",
org.eclipse.osbp.ecview.core.util.emf;bundle-version="[0.9.0,0.10.0)",
org.eclipse.osbp.ecview.extension.grid.editparts;bundle-version="[0.9.0,0.10.0)",
diff --git a/org.eclipse.osbp.ecview.extension.grid.model.editor/.classpath b/org.eclipse.osbp.ecview.extension.grid.model.editor/.classpath
new file mode 100644
index 0000000..22f3064
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.grid.model.editor/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/org.eclipse.osbp.ecview.extension.grid.model.editor/META-INF/MANIFEST.MF b/org.eclipse.osbp.ecview.extension.grid.model.editor/META-INF/MANIFEST.MF
index 3ae5058..cf9222f 100644
--- a/org.eclipse.osbp.ecview.extension.grid.model.editor/META-INF/MANIFEST.MF
+++ b/org.eclipse.osbp.ecview.extension.grid.model.editor/META-INF/MANIFEST.MF
@@ -7,16 +7,16 @@
Bundle-Activator: org.eclipse.osbp.ecview.extension.grid.presentation.cxecviewEditorPlugin$Implementation
Bundle-Vendor: Eclipse OSBP
Bundle-Localization: plugin
-Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Export-Package: org.eclipse.osbp.ecview.extension.grid.memento.presentation,
org.eclipse.osbp.ecview.extension.grid.presentation,
org.eclipse.osbp.ecview.extension.grid.renderer.presentation
Require-Bundle: org.eclipse.core.runtime,
org.eclipse.core.resources;visibility:=reexport,
- org.eclipse.osbp.ecview.extension.grid.model.edit;visibility:=reexport,
+ org.eclipse.osbp.ecview.extension.grid.model.edit;bundle-version="[0.9.0,0.10.0)";visibility:=reexport,
org.eclipse.emf.ecore.xmi;visibility:=reexport,
org.eclipse.emf.edit.ui;visibility:=reexport,
org.eclipse.ui.ide;visibility:=reexport,
- org.eclipse.osbp.ecview.core.common.model.edit;visibility:=reexport,
- org.eclipse.osbp.ecview.core.extension.model.edit;visibility:=reexport
+ org.eclipse.osbp.ecview.core.common.model.edit;bundle-version="[0.9.0,0.10.0)";visibility:=reexport,
+ org.eclipse.osbp.ecview.core.extension.model.edit;bundle-version="[0.9.0,0.10.0)";visibility:=reexport
Bundle-ActivationPolicy: lazy
diff --git a/org.eclipse.osbp.ecview.extension.grid.presentation.clientside/.classpath b/org.eclipse.osbp.ecview.extension.grid.presentation.clientside/.classpath
new file mode 100644
index 0000000..43b9862
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.grid.presentation.clientside/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="target/classes"/>
+</classpath>
diff --git a/org.eclipse.osbp.ecview.extension.grid.presentation.clientside/.gitignore b/org.eclipse.osbp.ecview.extension.grid.presentation.clientside/.gitignore
new file mode 100644
index 0000000..869c021
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.grid.presentation.clientside/.gitignore
@@ -0,0 +1,5 @@
+/target/
+/target/
+/resources/
+/gwt-unitCache
+/VAADIN/*
diff --git a/org.eclipse.osbp.ecview.extension.grid.presentation.clientside/.settings/com.vaadin.integration.eclipse.prefs b/org.eclipse.osbp.ecview.extension.grid.presentation.clientside/.settings/com.vaadin.integration.eclipse.prefs
new file mode 100644
index 0000000..e1173bc
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.grid.presentation.clientside/.settings/com.vaadin.integration.eclipse.prefs
@@ -0,0 +1,2 @@
+com.vaadin.integration.eclipse.previousCompileAction=widgetset
+eclipse.preferences.version=1
diff --git a/org.eclipse.osbp.ecview.extension.grid.presentation.clientside/.settings/org.eclipse.core.resources.prefs b/org.eclipse.osbp.ecview.extension.grid.presentation.clientside/.settings/org.eclipse.core.resources.prefs
new file mode 100644
index 0000000..99f26c0
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.grid.presentation.clientside/.settings/org.eclipse.core.resources.prefs
@@ -0,0 +1,2 @@
+eclipse.preferences.version=1
+encoding/<project>=UTF-8
diff --git a/org.eclipse.osbp.ecview.extension.grid.presentation.clientside/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.osbp.ecview.extension.grid.presentation.clientside/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 0000000..0c68a61
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.grid.presentation.clientside/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,7 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+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.8
diff --git a/org.eclipse.osbp.ecview.extension.grid.presentation.clientside/.settings/org.eclipse.m2e.core.prefs b/org.eclipse.osbp.ecview.extension.grid.presentation.clientside/.settings/org.eclipse.m2e.core.prefs
new file mode 100644
index 0000000..f897a7f
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.grid.presentation.clientside/.settings/org.eclipse.m2e.core.prefs
@@ -0,0 +1,4 @@
+activeProfiles=
+eclipse.preferences.version=1
+resolveWorkspaceProjects=true
+version=1
diff --git a/org.eclipse.osbp.ecview.extension.grid.presentation.clientside/.settings/org.eclipse.xtend.core.Xtend.prefs b/org.eclipse.osbp.ecview.extension.grid.presentation.clientside/.settings/org.eclipse.xtend.core.Xtend.prefs
new file mode 100644
index 0000000..19e3115
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.grid.presentation.clientside/.settings/org.eclipse.xtend.core.Xtend.prefs
@@ -0,0 +1,11 @@
+//outlet.DEFAULT_OUTPUT.sourceFolder.src/test/java.directory=src/test/generated-sources/xtend
+BuilderConfiguration.is_project_specific=true
+eclipse.preferences.version=1
+is_project_specific=true
+outlet.DEFAULT_OUTPUT.hideLocalSyntheticVariables=true
+outlet.DEFAULT_OUTPUT.installDslAsPrimarySource=false
+outlet.DEFAULT_OUTPUT.sourceFolder.emf-gen.directory=xtend-gen
+outlet.DEFAULT_OUTPUT.sourceFolder.src-gen.directory=xtend-gen
+outlet.DEFAULT_OUTPUT.sourceFolder.src.directory=xtend-gen
+outlet.DEFAULT_OUTPUT.sourceFolder.xtend-gen.directory=xtend-gen
+outlet.DEFAULT_OUTPUT.userOutputPerSourceFolder=true
diff --git a/org.eclipse.osbp.ecview.extension.grid.presentation.clientside/META-INF/MANIFEST.MF b/org.eclipse.osbp.ecview.extension.grid.presentation.clientside/META-INF/MANIFEST.MF
index d11421f..6298fed 100644
--- a/org.eclipse.osbp.ecview.extension.grid.presentation.clientside/META-INF/MANIFEST.MF
+++ b/org.eclipse.osbp.ecview.extension.grid.presentation.clientside/META-INF/MANIFEST.MF
@@ -5,12 +5,13 @@
Bundle-Vendor: Eclipse OSBP
Bundle-Version: 0.9.0.qualifier
Require-Bundle: org.slf4j.api,
- com.vaadin.shared;bundle-version="[7.5.7,7.7.0)",
- com.vaadin.client;bundle-version="[7.5.7,7.7.0)",
- com.vaadin.server;bundle-version="[7.5.7,7.7.0)",
+ com.vaadin.shared;bundle-version="[7.7.6,7.8.0)",
+ com.vaadin.client;bundle-version="[7.7.6,7.8.0)",
+ com.vaadin.server;bundle-version="[7.7.6,7.8.0)",
com.ibm.icu;bundle-version="50.1.1",
org.jsoup;bundle-version="1.7.2",
- org.eclipse.osbp.ecview.extension.grid.presentation;bundle-version="[0.9.0,0.10.0)"
+ org.eclipse.osbp.ecview.extension.grid.presentation;bundle-version="[0.9.0,0.10.0)",
+ org.eclipse.osbp.dependencies.bundle.vaadin.external.gwt;bundle-version="[2.7.0,2.7.1)"
Import-Package: org.osgi.framework;version="1.7.0",
org.osgi.service.component.annotations;version="1.2.0"
Export-Package: org.eclipse.osbp.ecview.extension.grid.presentation.clientside;x-internal:=true;version="0.9.0"
diff --git a/org.eclipse.osbp.ecview.extension.grid.presentation.clientside/pom-compileWidgetset.xml b/org.eclipse.osbp.ecview.extension.grid.presentation.clientside/pom-compileWidgetset.xml
index 127f2bb..ec041d0 100644
--- a/org.eclipse.osbp.ecview.extension.grid.presentation.clientside/pom-compileWidgetset.xml
+++ b/org.eclipse.osbp.ecview.extension.grid.presentation.clientside/pom-compileWidgetset.xml
@@ -8,8 +8,6 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
- <vaadin.version>7.5.7</vaadin.version>
- <vaadin.plugin.version>7.5.7</vaadin.plugin.version>
</properties>
<dependencies>
@@ -99,7 +97,7 @@
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-maven-plugin</artifactId>
- <version>0.21.0</version>
+ <version>0.26.0</version>
<extensions>true</extensions>
</plugin>
<plugin>
diff --git a/org.eclipse.osbp.ecview.extension.grid.presentation.clientside/pom.xml b/org.eclipse.osbp.ecview.extension.grid.presentation.clientside/pom.xml
index d8e382e..5789b22 100644
--- a/org.eclipse.osbp.ecview.extension.grid.presentation.clientside/pom.xml
+++ b/org.eclipse.osbp.ecview.extension.grid.presentation.clientside/pom.xml
@@ -24,8 +24,6 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
-<!-- <vaadin.version>7.5.7</vaadin.version> -->
-<!-- <vaadin.plugin.version>7.5.7</vaadin.plugin.version> -->
</properties>
<!-- no dependencies after o.e.o.dependencies
@@ -113,13 +111,11 @@
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-maven-plugin</artifactId>
- <version>0.21.0</version>
<extensions>true</extensions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
- <version>2.5</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
diff --git a/org.eclipse.osbp.ecview.extension.grid.presentation/.classpath b/org.eclipse.osbp.ecview.extension.grid.presentation/.classpath
new file mode 100644
index 0000000..43b9862
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.grid.presentation/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="target/classes"/>
+</classpath>
diff --git a/org.eclipse.osbp.ecview.extension.grid.presentation/.gitignore b/org.eclipse.osbp.ecview.extension.grid.presentation/.gitignore
new file mode 100644
index 0000000..1dd3331
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.grid.presentation/.gitignore
@@ -0,0 +1,2 @@
+/target/
+/target/
diff --git a/org.eclipse.osbp.ecview.extension.grid.presentation/.settings/com.vaadin.integration.eclipse.prefs b/org.eclipse.osbp.ecview.extension.grid.presentation/.settings/com.vaadin.integration.eclipse.prefs
new file mode 100644
index 0000000..0904e44
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.grid.presentation/.settings/com.vaadin.integration.eclipse.prefs
@@ -0,0 +1,2 @@
+com.vaadin.integration.eclipse.mavenLatestVersionsUpgrade=["7.7.7"]
+eclipse.preferences.version=1
diff --git a/org.eclipse.osbp.ecview.extension.grid.presentation/.settings/org.eclipse.core.resources.prefs b/org.eclipse.osbp.ecview.extension.grid.presentation/.settings/org.eclipse.core.resources.prefs
new file mode 100644
index 0000000..99f26c0
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.grid.presentation/.settings/org.eclipse.core.resources.prefs
@@ -0,0 +1,2 @@
+eclipse.preferences.version=1
+encoding/<project>=UTF-8
diff --git a/org.eclipse.osbp.ecview.extension.grid.presentation/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.osbp.ecview.extension.grid.presentation/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 0000000..0c68a61
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.grid.presentation/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,7 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+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.8
diff --git a/org.eclipse.osbp.ecview.extension.grid.presentation/.settings/org.eclipse.m2e.core.prefs b/org.eclipse.osbp.ecview.extension.grid.presentation/.settings/org.eclipse.m2e.core.prefs
new file mode 100644
index 0000000..f897a7f
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.grid.presentation/.settings/org.eclipse.m2e.core.prefs
@@ -0,0 +1,4 @@
+activeProfiles=
+eclipse.preferences.version=1
+resolveWorkspaceProjects=true
+version=1
diff --git a/org.eclipse.osbp.ecview.extension.grid.presentation/.settings/org.eclipse.xtend.core.Xtend.prefs b/org.eclipse.osbp.ecview.extension.grid.presentation/.settings/org.eclipse.xtend.core.Xtend.prefs
new file mode 100644
index 0000000..19e3115
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.grid.presentation/.settings/org.eclipse.xtend.core.Xtend.prefs
@@ -0,0 +1,11 @@
+//outlet.DEFAULT_OUTPUT.sourceFolder.src/test/java.directory=src/test/generated-sources/xtend
+BuilderConfiguration.is_project_specific=true
+eclipse.preferences.version=1
+is_project_specific=true
+outlet.DEFAULT_OUTPUT.hideLocalSyntheticVariables=true
+outlet.DEFAULT_OUTPUT.installDslAsPrimarySource=false
+outlet.DEFAULT_OUTPUT.sourceFolder.emf-gen.directory=xtend-gen
+outlet.DEFAULT_OUTPUT.sourceFolder.src-gen.directory=xtend-gen
+outlet.DEFAULT_OUTPUT.sourceFolder.src.directory=xtend-gen
+outlet.DEFAULT_OUTPUT.sourceFolder.xtend-gen.directory=xtend-gen
+outlet.DEFAULT_OUTPUT.userOutputPerSourceFolder=true
diff --git a/org.eclipse.osbp.ecview.extension.grid.presentation/META-INF/MANIFEST.MF b/org.eclipse.osbp.ecview.extension.grid.presentation/META-INF/MANIFEST.MF
index d539f68..6661c6b 100644
--- a/org.eclipse.osbp.ecview.extension.grid.presentation/META-INF/MANIFEST.MF
+++ b/org.eclipse.osbp.ecview.extension.grid.presentation/META-INF/MANIFEST.MF
@@ -5,9 +5,9 @@
Bundle-Vendor: Eclipse OSBP
Bundle-Version: 0.9.0.qualifier
Require-Bundle: org.slf4j.api,
- com.vaadin.shared;bundle-version="[7.5.7,7.7.0)",
- com.vaadin.client;bundle-version="[7.5.7,7.7.0)",
- com.vaadin.server;bundle-version="[7.5.7,7.7.0)",
+ com.vaadin.shared;bundle-version="[7.7.6,7.8.0)",
+ com.vaadin.client;bundle-version="[7.7.6,7.8.0)",
+ com.vaadin.server;bundle-version="[7.7.6,7.8.0)",
com.ibm.icu;bundle-version="50.1.1",
org.eclipse.osbp.ecview.core.common;bundle-version="[0.9.0,0.10.0)",
org.eclipse.osbp.ecview.core.common.editparts.emf;bundle-version="[0.9.0,0.10.0)",
@@ -24,14 +24,16 @@
org.eclipse.emf.databinding;bundle-version="1.3.0",
org.eclipse.osbp.ecview.extension.grid.editparts;bundle-version="[0.9.0,0.10.0)",
org.eclipse.osbp.ecview.extension.grid.model;bundle-version="[0.9.0,0.10.0)",
- org.eclipse.core.databinding.property,
+ org.eclipse.core.databinding.property;bundle-version="[1.6.0,1.7.0)",
org.vaadin.addons.vaadin-grid-util,
org.apache.commons.beanutils;bundle-version="1.9.2",
org.jsoup;bundle-version="1.8.3",
- dragdroplayouts.osgi;bundle-version="1.1.3",
- org.eclipse.osbp.runtime.designer.api;bundle-version="[0.9.0,0.10.0)"
+ dragdroplayouts.osgi;bundle-version="[1.3.2,1.3.3)",
+ org.eclipse.osbp.runtime.designer.api;bundle-version="[0.9.0,0.10.0)",
+ org.eclipse.osbp.dependencies.bundle.vaadin.external.gwt;bundle-version="[2.7.0,2.7.1)",
+ org.eclipse.osbp.dsl.dto.xtext;bundle-version="0.9.0",
+ org.eclipse.osbp.utils;bundle-version="0.9.0"
Import-Package: org.apache.commons.lang,
- org.eclipse.core.databinding.property.value,
org.eclipse.osbp.vaaclipse.publicapi.authentication;version="0.9.0",
org.osgi.framework;version="1.7.0",
org.osgi.service.component.annotations;version="1.2.0"
diff --git a/org.eclipse.osbp.ecview.extension.grid.presentation/src/org/eclipse/osbp/ecview/extension/grid/presentation/GridPresentation.java b/org.eclipse.osbp.ecview.extension.grid.presentation/src/org/eclipse/osbp/ecview/extension/grid/presentation/GridPresentation.java
index ebd5c77..554cf8f 100644
--- a/org.eclipse.osbp.ecview.extension.grid.presentation/src/org/eclipse/osbp/ecview/extension/grid/presentation/GridPresentation.java
+++ b/org.eclipse.osbp.ecview.extension.grid.presentation/src/org/eclipse/osbp/ecview/extension/grid/presentation/GridPresentation.java
@@ -19,9 +19,11 @@
import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
+import java.util.Iterator;
import java.util.List;
import java.util.Locale;
import java.util.Map;
+import java.util.Objects;
import java.util.Set;
import org.eclipse.core.databinding.Binding;
@@ -29,9 +31,12 @@
import org.eclipse.core.databinding.observable.list.IObservableList;
import org.eclipse.core.databinding.observable.value.IObservableValue;
import org.eclipse.core.databinding.observable.value.WritableValue;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.common.notify.impl.AdapterImpl;
import org.eclipse.emf.databinding.EMFObservables;
import org.eclipse.emf.databinding.EMFProperties;
import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.osbp.dsl.semantic.dto.util.NamingConventionsUtil;
import org.eclipse.osbp.ecview.core.common.editpart.IElementEditpart;
import org.eclipse.osbp.ecview.core.common.editpart.IEmbeddableEditpart;
import org.eclipse.osbp.ecview.core.common.editpart.IFieldEditpart;
@@ -66,6 +71,10 @@
import org.eclipse.osbp.ecview.extension.grid.memento.CxGridMementoSortable;
import org.eclipse.osbp.runtime.common.annotations.DtoUtils;
import org.eclipse.osbp.runtime.common.dispose.AbstractDisposable;
+import org.eclipse.osbp.runtime.common.event.EventDispatcherEvent;
+import org.eclipse.osbp.runtime.common.event.EventDispatcherEvent.EventDispatcherCommand;
+import org.eclipse.osbp.runtime.common.event.EventDispatcherEvent.EventDispatcherDataTag;
+import org.eclipse.osbp.runtime.common.event.IEventDispatcher;
import org.eclipse.osbp.runtime.common.i18n.II18nService;
import org.eclipse.osbp.runtime.common.state.ISharedStateContext;
import org.eclipse.osbp.runtime.designer.api.IDesignerService.IDesignListener;
@@ -108,19 +117,18 @@
/**
* This presenter is responsible to render a text field on the given layout.
*/
-public class GridPresentation extends AbstractEmbeddedWidgetPresenter<Grid>
- implements IGridPresentation<Grid>, IDesignListener{
+public class GridPresentation extends AbstractEmbeddedWidgetPresenter<Grid> implements IGridPresentation<Grid>, // NOSONAR
+ IDesignListener {
/** The Constant LOGGER. */
- private static final Logger LOGGER = LoggerFactory
- .getLogger(GridPresentation.class);
+ private static final Logger LOGGER = LoggerFactory.getLogger(GridPresentation.class);
/** The grid. */
- private Grid grid;
-
+ private CustomGrid grid;
+
/** The model access. */
private ModelAccess modelAccess;
-
+
/** The user changed handler. */
private UserChangedHandler userChangedHandler = new UserChangedHandler();
@@ -129,16 +137,16 @@
/** The columns. */
private Set<ColumnWrapper> columns = new HashSet<>();
-
+
/** The grouping headers. */
private Map<CxGridHeaderRow, HeaderRow> groupingHeaders = new HashMap<CxGridHeaderRow, HeaderRow>();
-
+
/** The grouping footers. */
private Map<CxGridFooterRow, FooterRow> groupingFooters = new HashMap<CxGridFooterRow, FooterRow>();
-
+
/** The filtering header. */
private HeaderRow filteringHeader;
-
+
/** The filtering header fields. */
private Map<CxGridColumn, ISearchFieldEditpart> filteringHeaderFields = new HashMap<CxGridColumn, ISearchFieldEditpart>();
@@ -166,8 +174,11 @@
this.modelAccess = new ModelAccess((CxGrid) editpart.getModel());
}
- /* (non-Javadoc)
- * @see org.eclipse.osbp.runtime.web.ecview.presentation.vaadin.common.AbstractVaadinWidgetPresenter#doUpdateLocale(java.util.Locale)
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osbp.runtime.web.ecview.presentation.vaadin.common.
+ * AbstractVaadinWidgetPresenter#doUpdateLocale(java.util.Locale)
*/
@Override
protected void doUpdateLocale(Locale locale) {
@@ -188,18 +199,20 @@
createColumns();
}
- Util.applyCaptions(getI18nService(), modelAccess.getLabel(),
- modelAccess.getLabelI18nKey(), getLocale(), grid);
+ Util.applyCaptions(getI18nService(), modelAccess.getLabel(), modelAccess.getLabelI18nKey(), getLocale(), grid);
grid.setEditorCancelCaption(Util.getCaption(getI18nService(), "Cancel",
modelAccess.yField.getEditorCancelI18nLabelKey(), getLocale()));
- grid.setEditorSaveCaption(Util.getCaption(getI18nService(), "Save",
- modelAccess.yField.getEditorSaveI18nLabelKey(), getLocale()));
+ grid.setEditorSaveCaption(
+ Util.getCaption(getI18nService(), "Save", modelAccess.yField.getEditorSaveI18nLabelKey(), getLocale()));
}
- /* (non-Javadoc)
- * @see org.eclipse.osbp.ecview.extension.grid.editparts.presentation.IGridPresentation#setFilter(java.util.Map)
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osbp.ecview.extension.grid.editparts.presentation.
+ * IGridPresentation#setFilter(java.util.Map)
*/
@Override
public void setFilter(Map<String, Object> filter) {
@@ -208,11 +221,9 @@
filters.add(new Compare.Equal(entry.getKey(), entry.getValue()));
}
- Container.Filterable filterable = (Container.Filterable) grid
- .getContainerDataSource();
+ Container.Filterable filterable = (Container.Filterable) grid.getContainerDataSource();
filterable.removeAllContainerFilters();
- filterable.addContainerFilter(new And(filters
- .toArray(new Container.Filter[filters.size()])));
+ filterable.addContainerFilter(new And(filters.toArray(new Container.Filter[filters.size()])));
}
/**
@@ -225,15 +236,13 @@
// reset the column reference in the editparts
for (CxGridColumn cxColumn : modelAccess.yField.getColumns()) {
- IGridColumnEditpart editpart = ModelUtil.getEditpart(
- getViewContext(), cxColumn);
+ IGridColumnEditpart editpart = ModelUtil.getEditpart(getViewContext(), cxColumn);
editpart.setColumnReference(null);
}
// set the visible columns and icons
List<String> visibleColumns = new ArrayList<String>();
- Collection<?> propertyIds = grid.getContainerDataSource()
- .getContainerPropertyIds();
+ Collection<?> propertyIds = grid.getContainerDataSource().getContainerPropertyIds();
for (CxGridColumn cxColumn : modelAccess.yField.getColumns()) {
if (!cxColumn.isHidden()
&& (propertyIds.contains(cxColumn.getPropertyPath()) || isNestedColumn(cxColumn))) {
@@ -249,8 +258,7 @@
// add nested properties
if (grid.getContainerDataSource() instanceof INestedPropertyAble) {
- INestedPropertyAble<?> container = (INestedPropertyAble<?>) grid
- .getContainerDataSource();
+ INestedPropertyAble<?> container = (INestedPropertyAble<?>) grid.getContainerDataSource();
for (String property : visibleColumns) {
if (property.contains(".")) {
container.addNestedContainerProperty(property);
@@ -261,10 +269,8 @@
if (visibleColumns.size() > 0) {
// create the columns based on the model
//
- grid.setColumns(visibleColumns.toArray(new Object[visibleColumns
- .size()]));
- grid.setColumnOrder(visibleColumns
- .toArray(new Object[visibleColumns.size()]));
+ grid.setColumns(visibleColumns.toArray(new Object[visibleColumns.size()]));
+ grid.setColumnOrder(visibleColumns.toArray(new Object[visibleColumns.size()]));
// traverse the columns again and set other properties
for (CxGridColumn cxColumn : modelAccess.yField.getColumns()) {
@@ -272,15 +278,35 @@
&& (propertyIds.contains(cxColumn.getPropertyPath()) || isNestedColumn(cxColumn))) {
String columnId = cxColumn.getPropertyPath();
- IGridColumnEditpart editpart = ModelUtil.getEditpart(
- getViewContext(), cxColumn);
+ IGridColumnEditpart editpart = ModelUtil.getEditpart(getViewContext(), cxColumn);
Grid.Column column = grid.getColumn(columnId);
- editpart.setColumnReference(new ColumnWrapper(cxColumn,
- column));
+ editpart.setColumnReference(new ColumnWrapper(cxColumn, column));
editpart.initializeColumn();
}
}
+ } else {
+ Class<?> rootType = modelAccess.yField.getType();
+ // order columns by field order in rootType
+ List<String> fieldNames = DtoUtils.getFieldNames(rootType);
+ for (Iterator<String> iterator = fieldNames.iterator(); iterator.hasNext();) {
+ String name = iterator.next();
+ if (grid.getColumn(name) == null) {
+ iterator.remove();
+ }
+ }
+ grid.setColumnOrder(fieldNames.toArray(new Object[fieldNames.size()]));
+ // remove not used fields
+ for (Grid.Column col : new ArrayList<>(grid.getColumns())) {
+ String propId = (String) col.getPropertyId();
+ if (!propId.contains(".")) {
+ // only check not nested fields
+ if (DtoUtils.isIdField(rootType, propId) || DtoUtils.isVersionField(rootType, propId)
+ || DtoUtils.isDisposeField(rootType, propId) || DtoUtils.isDirtyField(rootType, propId)) {
+ grid.removeColumn(propId);
+ }
+ }
+ }
}
updateCellStyleGenerator();
@@ -300,11 +326,9 @@
Sort sort = null;
for (CxGridSortable memSort : cxGrid.getSortOrder()) {
if (sort == null) {
- sort = Sort.by(memSort.getColumn().getPropertyId(),
- toDirection(memSort));
+ sort = Sort.by(memSort.getColumn().getPropertyId(), toDirection(memSort));
} else {
- sort = sort.then(memSort.getColumn().getPropertyId(),
- toDirection(memSort));
+ sort = sort.then(memSort.getColumn().getPropertyId(), toDirection(memSort));
}
}
grid.sort(sort);
@@ -328,14 +352,11 @@
// create the grouping headers
//
for (CxGridGroupedCell groupingColumn : cxHeader.getGroupings()) {
- List<Grid.HeaderCell> headerCells = getCells(headerRow,
- groupingColumn);
- Grid.HeaderCell cell = headerRow.join(headerCells
- .toArray(new Grid.HeaderCell[headerCells.size()]));
+ List<Grid.HeaderCell> headerCells = getCells(headerRow, groupingColumn);
+ Grid.HeaderCell cell = headerRow.join(headerCells.toArray(new Grid.HeaderCell[headerCells.size()]));
// apply the caption of the cell
- String caption = Util.getCaption(getI18nService(),
- groupingColumn.getLabel(),
+ String caption = Util.getCaption(getI18nService(), groupingColumn.getLabel(),
groupingColumn.getLabelI18nKey(), getLocale());
if (groupingColumn.isUseHTML()) {
@@ -348,22 +369,19 @@
// create the custom cells
//
for (CxGridMetaCell cxCell : cxHeader.getCustomCells()) {
- Grid.HeaderCell cell = headerRow.getCell(cxCell.getTarget()
- .getPropertyId());
+ Grid.HeaderCell cell = headerRow.getCell(cxCell.getTarget().getPropertyId());
if (cell == null) {
continue;
}
if (cxCell.getElement() != null) {
- IEmbeddableEditpart ep = ModelUtil.getEditpart(
- getViewContext(), cxCell.getElement());
+ IEmbeddableEditpart ep = ModelUtil.getEditpart(getViewContext(), cxCell.getElement());
if (ep != null) {
Component component = (Component) ep.render(null);
cell.setComponent(component);
}
} else {
- String caption = Util.getCaption(getI18nService(),
- cxCell.getLabel(), cxCell.getLabelI18nKey(),
+ String caption = Util.getCaption(getI18nService(), cxCell.getLabel(), cxCell.getLabelI18nKey(),
getLocale());
if (cxCell.isUseHTML()) {
cell.setHtml(caption);
@@ -390,8 +408,7 @@
for (CxGridHeaderRow cxHeader : modelAccess.yField.getHeaders()) {
for (CxGridMetaCell cxCell : cxHeader.getCustomCells()) {
if (cxCell.getElement() != null) {
- IEmbeddableEditpart ep = ModelUtil.findEditpart(cxCell
- .getElement());
+ IEmbeddableEditpart ep = ModelUtil.findEditpart(cxCell.getElement());
if (ep != null && !ep.isDisposed()) {
ep.requestDispose();
}
@@ -447,26 +464,23 @@
*/
protected void createAutoFilters() {
cellFilters = new GridCellFilter(grid);
- Container.Filterable container = (Container.Filterable) grid
- .getContainerDataSource();
+ Container.Filterable container = (Container.Filterable) grid.getContainerDataSource();
for (Grid.Column column : grid.getColumns()) {
Class<?> propertyType = container.getType(column.getPropertyId());
- if (Number.class.isAssignableFrom(propertyType)
- || isPrimitiveNumber(propertyType)) {
+ if (Number.class.isAssignableFrom(propertyType) || isPrimitiveNumber(propertyType)) {
cellFilters.setNumberFilter(column.getPropertyId());
} else if (propertyType == String.class) {
cellFilters.setTextFilter(column.getPropertyId(), true, false);
} else if (propertyType == Date.class) {
cellFilters.setDateFilter(column.getPropertyId());
- } else if (propertyType == Boolean.class
- || propertyType == Boolean.TYPE) {
+ // otherwise the column is to wide
+ column.setMaximumWidth(175);
+ } else if (propertyType == Boolean.class || propertyType == Boolean.TYPE) {
cellFilters.setBooleanFilter(column.getPropertyId());
} else if (propertyType.isEnum()) {
- cellFilters.setComboBoxFilter(column.getPropertyId(),
- Arrays.asList(propertyType.getEnumConstants()));
+ cellFilters.setComboBoxFilter(column.getPropertyId(), Arrays.asList(propertyType.getEnumConstants()));
} else if (DtoUtils.getDomainKeyField(propertyType) != null) {
- cellFilters.setDtoFilter(column.getPropertyId(), propertyType,
- "");
+ cellFilters.setDtoFilter(column.getPropertyId(), propertyType, "");
}
}
}
@@ -479,9 +493,8 @@
* @return true, if is primitive number
*/
private boolean isPrimitiveNumber(Class<?> propertyType) {
- return propertyType == Byte.TYPE || propertyType == Double.TYPE
- || propertyType == Float.TYPE || propertyType == Integer.TYPE
- || propertyType == Long.TYPE || propertyType == Short.TYPE;
+ return propertyType == Byte.TYPE || propertyType == Double.TYPE || propertyType == Float.TYPE
+ || propertyType == Integer.TYPE || propertyType == Long.TYPE || propertyType == Short.TYPE;
}
/**
@@ -493,8 +506,7 @@
protected void createCustomFilters(CxGrid cxGrid) {
filteringHeader = grid.appendHeaderRow();
for (CxGridColumn cxColumn : cxGrid.getColumns()) {
- Grid.HeaderCell cell = filteringHeader.getCell(cxColumn
- .getPropertyId());
+ Grid.HeaderCell cell = filteringHeader.getCell(cxColumn.getPropertyId());
if (cell == null) {
continue;
}
@@ -502,8 +514,7 @@
// render the search field
YSearchField cxSearchField = cxColumn.getSearchField();
if (cxSearchField != null) {
- ISearchFieldEditpart editpart = ModelUtil.getEditpart(
- getViewContext(), cxSearchField);
+ ISearchFieldEditpart editpart = ModelUtil.getEditpart(getViewContext(), cxSearchField);
filteringHeaderFields.put(cxColumn, editpart);
ISearchField component = (ISearchField) editpart.render(null);
component.bindFilterChanged(filterChangedTracker);
@@ -528,11 +539,9 @@
}
try {
- Container.Filterable filterable = (Container.Filterable) grid
- .getContainerDataSource();
+ Container.Filterable filterable = (Container.Filterable) grid.getContainerDataSource();
filterable.removeAllContainerFilters();
- filterable.addContainerFilter(new And(filters
- .toArray(new Container.Filter[filters.size()])));
+ filterable.addContainerFilter(new And(filters.toArray(new Container.Filter[filters.size()])));
} catch (Exception e) {
LOGGER.error("{}", e);
}
@@ -554,14 +563,11 @@
FooterRow footerRow = grid.appendFooterRow();
groupingFooters.put(cxFooter, footerRow);
for (CxGridGroupedCell groupingColumn : cxFooter.getGroupings()) {
- List<Grid.FooterCell> footerCells = getCells(footerRow,
- groupingColumn);
- Grid.FooterCell cell = footerRow.join(footerCells
- .toArray(new Grid.FooterCell[footerCells.size()]));
+ List<Grid.FooterCell> footerCells = getCells(footerRow, groupingColumn);
+ Grid.FooterCell cell = footerRow.join(footerCells.toArray(new Grid.FooterCell[footerCells.size()]));
// apply the caption of the cell
- String caption = Util.getCaption(getI18nService(),
- groupingColumn.getLabel(),
+ String caption = Util.getCaption(getI18nService(), groupingColumn.getLabel(),
groupingColumn.getLabelI18nKey(), getLocale());
if (groupingColumn.isUseHTML()) {
@@ -574,22 +580,19 @@
// create the custom cells
//
for (CxGridMetaCell cxCell : cxFooter.getCustomCells()) {
- Grid.FooterCell cell = footerRow.getCell(cxCell.getTarget()
- .getPropertyId());
+ Grid.FooterCell cell = footerRow.getCell(cxCell.getTarget().getPropertyId());
if (cell == null) {
continue;
}
if (cxCell.getElement() != null) {
- IEmbeddableEditpart ep = ModelUtil.getEditpart(
- getViewContext(), cxCell.getElement());
+ IEmbeddableEditpart ep = ModelUtil.getEditpart(getViewContext(), cxCell.getElement());
if (ep != null) {
Component component = (Component) ep.render(null);
cell.setComponent(component);
}
} else {
- String caption = Util.getCaption(getI18nService(),
- cxCell.getLabel(), cxCell.getLabelI18nKey(),
+ String caption = Util.getCaption(getI18nService(), cxCell.getLabel(), cxCell.getLabelI18nKey(),
getLocale());
if (cxCell.isUseHTML()) {
cell.setHtml(caption);
@@ -616,8 +619,7 @@
for (CxGridFooterRow cxFooter : modelAccess.yField.getFooters()) {
for (CxGridMetaCell cxCell : cxFooter.getCustomCells()) {
if (cxCell.getElement() != null) {
- IEmbeddableEditpart ep = ModelUtil.findEditpart(cxCell
- .getElement());
+ IEmbeddableEditpart ep = ModelUtil.findEditpart(cxCell.getElement());
if (ep != null && !ep.isDisposed()) {
ep.requestDispose();
}
@@ -635,8 +637,7 @@
* the grouping column
* @return the cells
*/
- private List<Grid.HeaderCell> getCells(HeaderRow row,
- CxGridGroupedCell groupingColumn) {
+ private List<Grid.HeaderCell> getCells(HeaderRow row, CxGridGroupedCell groupingColumn) {
List<Grid.HeaderCell> cells = new ArrayList<Grid.HeaderCell>();
for (CxGridGroupable column : groupingColumn.getGroupables()) {
if (column instanceof CxGridColumn) {
@@ -665,8 +666,7 @@
* the grouping column
* @return the cells
*/
- private List<Grid.FooterCell> getCells(FooterRow row,
- CxGridGroupedCell groupingColumn) {
+ private List<Grid.FooterCell> getCells(FooterRow row, CxGridGroupedCell groupingColumn) {
List<Grid.FooterCell> cells = new ArrayList<Grid.FooterCell>();
for (CxGridGroupable column : groupingColumn.getGroupables()) {
if (column instanceof CxGridColumn) {
@@ -694,8 +694,7 @@
* @return true, if is nested column
*/
protected boolean isNestedColumn(CxGridColumn cxColumn) {
- return cxColumn.getPropertyPath() != null
- && cxColumn.getPropertyPath().contains(".");
+ return cxColumn.getPropertyPath() != null && cxColumn.getPropertyPath().contains(".");
}
/**
@@ -723,8 +722,11 @@
return result;
}
- /* (non-Javadoc)
- * @see org.eclipse.osbp.runtime.web.ecview.presentation.vaadin.common.AbstractVaadinWidgetPresenter#doCreateWidget(java.lang.Object)
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osbp.runtime.web.ecview.presentation.vaadin.common.
+ * AbstractVaadinWidgetPresenter#doCreateWidget(java.lang.Object)
*/
@SuppressWarnings({ "unchecked", "rawtypes", "serial" })
@Override
@@ -737,7 +739,7 @@
CxGrid cxGrid = modelAccess.yField;
- grid = new Grid();
+ grid = new CustomGrid();
setupComponent(grid, getCastedModel());
associateWidget(grid, cxGrid);
@@ -754,6 +756,32 @@
grid.addStyleName(CSS_CLASS_CONTROL);
}
+ cxGrid.eAdapters().add(new AdapterImpl() {
+ @Override
+ public void notifyChanged(Notification msg) {
+ if (msg.getFeature() == CxGridPackage.Literals.CX_GRID__SELECTION) {
+ Class<?> bean = modelAccess.yField.getType();
+ if (bean != null) {
+ IEventDispatcher eventDispatcher = getViewContext()
+ .getService(IEventDispatcher.class.getName());
+ if (eventDispatcher == null) {
+ return;
+ }
+ String topic = NamingConventionsUtil.toEntityName(bean.getSimpleName()) + "."
+ + DtoUtils.getIdField(bean).getName();
+ EventDispatcherEvent evnt = new EventDispatcherEvent(EventDispatcherCommand.SELECT, topic,
+ toString());
+ if (msg.getNewValue() != null) {
+ evnt.addItem(EventDispatcherDataTag.ID, DtoUtils.getIdValue(msg.getNewValue()));
+ } else {
+ evnt.addItem(EventDispatcherDataTag.ID, null);
+ }
+ eventDispatcher.sendEvent(evnt);
+ }
+ }
+ }
+ });
+
createColumns = false;
if (cxGrid.getType() == String.class) {
IndexedContainer datasource = new IndexedContainer();
@@ -762,21 +790,17 @@
if (cxGrid.getType() != null) {
IBeanSearchService<?> service = null;
IBeanSearchServiceFactory factory = getViewContext()
- .getService(
- IBeanSearchServiceFactory.class.getName());
+ .getService(IBeanSearchServiceFactory.class.getName());
if (factory != null) {
service = factory.createService(cxGrid.getType());
}
if (cxGrid.isUseBeanService() && service != null) {
ISharedStateContext sharedState = getViewContext()
.getService(ISharedStateContext.class.getName());
- BeanServiceLazyLoadingContainer<?> datasource = new BeanServiceLazyLoadingContainer(
- service, cxGrid.getType(), sharedState);
-
- // Filter filter = createFilter();
- // if (filter != null) {
- // datasource.addContainerFilter(filter);
- // }
+ IEventDispatcher eventDispatcher = (IEventDispatcher) getViewContext()
+ .getService(IEventDispatcher.class.getName());
+ BeanServiceLazyLoadingContainer<?> datasource = new BeanServiceLazyLoadingContainer(service,
+ cxGrid.getType(), sharedState, eventDispatcher);
grid.setContainerDataSource(datasource);
} else {
@@ -788,8 +812,7 @@
} else {
IndexedContainer container = new IndexedContainer();
container.addContainerProperty("for", String.class, null);
- container.addContainerProperty("preview", String.class,
- null);
+ container.addContainerProperty("preview", String.class, null);
container.addItem(new String[] { "Some value", "other" });
grid.setContainerDataSource(container);
}
@@ -806,21 +829,19 @@
}
// notify field about save
- grid.getEditorFieldGroup().addCommitHandler(
- new FieldGroup.CommitHandler() {
- @Override
- public void preCommit(CommitEvent commitEvent)
- throws CommitException {
+ grid.getEditorFieldGroup().addCommitHandler(new FieldGroup.CommitHandler() {
+ @Override
+ public void preCommit(CommitEvent commitEvent) throws CommitException {
- }
+ }
- @Override
- public void postCommit(CommitEvent commitEvent)
- throws CommitException {
- Object itemId = grid.getEditedItemId();
- modelAccess.yField.setEditorSaved(itemId);
- }
- });
+ @Override
+ public void postCommit(CommitEvent commitEvent) throws CommitException {
+ Object itemId = grid.getEditedItemId();
+ modelAccess.yField.setEditorSaved(itemId);
+ grid.refreshRows(itemId);
+ }
+ });
applyCaptions();
@@ -831,11 +852,9 @@
return grid;
}
-/**
- // * Creates a predefined filter for the grid.
- // *
- // * @return
- // */
+ /**
+ * // * Creates a predefined filter for the grid. // * // * @return //
+ */
// private Filter createFilter() {
// CxGrid grid = modelAccess.yField;
// if (grid.getFilters().isEmpty()) {
@@ -851,8 +870,11 @@
// return new And(filters.toArray(new Filter[filters.size()]));
// }
- /* (non-Javadoc)
- * @see org.eclipse.osbp.runtime.web.ecview.presentation.vaadin.common.AbstractVaadinWidgetPresenter#castEObject(java.lang.Object)
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osbp.runtime.web.ecview.presentation.vaadin.common.
+ * AbstractVaadinWidgetPresenter#castEObject(java.lang.Object)
*/
@Override
protected CxGrid castEObject(Object model) {
@@ -871,57 +893,51 @@
super.createBindings(yGrid, widget, null);
// bind the editorEnabled property
- IVaadinObservableValue editorEnabledUiObservable = VaadinProperties
- .accessor(Grid.class, "editorEnabled").observe(widget);
- IObservableValue editorEnabledModelObservable = EMFObservables
- .observeValue(castEObject(yGrid),
- CxGridPackage.eINSTANCE.getCxGrid_EditorEnabled());
- registerBinding(createBindings(editorEnabledUiObservable,
- editorEnabledModelObservable));
+ IVaadinObservableValue editorEnabledUiObservable = VaadinProperties.accessor(Grid.class, "editorEnabled")
+ .observe(widget);
+ IObservableValue editorEnabledModelObservable = EMFObservables.observeValue(castEObject(yGrid),
+ CxGridPackage.eINSTANCE.getCxGrid_EditorEnabled());
+ registerBinding(createBindings(editorEnabledUiObservable, editorEnabledModelObservable));
// bind the footerVisible property
- IVaadinObservableValue footerVisibleUiObservable = VaadinProperties
- .accessor(Grid.class, "footerVisible").observe(widget);
- IObservableValue footerVisibleModelObservable = EMFObservables
- .observeValue(castEObject(yGrid),
- CxGridPackage.eINSTANCE.getCxGrid_FooterVisible());
- registerBinding(createBindings(footerVisibleUiObservable,
- footerVisibleModelObservable));
+ IVaadinObservableValue footerVisibleUiObservable = VaadinProperties.accessor(Grid.class, "footerVisible")
+ .observe(widget);
+ IObservableValue footerVisibleModelObservable = EMFObservables.observeValue(castEObject(yGrid),
+ CxGridPackage.eINSTANCE.getCxGrid_FooterVisible());
+ registerBinding(createBindings(footerVisibleUiObservable, footerVisibleModelObservable));
// add a value change listener to update the memento
footerVisibleModelObservable.addValueChangeListener(e -> {
- if (currentMemento == null
- || currentMemento.isFooterVisible() != grid
- .isFooterVisible()) {
+ if (currentMemento == null || currentMemento.isFooterVisible() != grid.isFooterVisible()) {
updateMemento();
}
});
// bind the headerVisible property
- IVaadinObservableValue headerVisibleUiObservable = VaadinProperties
- .accessor(Grid.class, "headerVisible").observe(widget);
- IObservableValue headerVisibleModelObservable = EMFObservables
- .observeValue(castEObject(yGrid),
- CxGridPackage.eINSTANCE.getCxGrid_HeaderVisible());
- registerBinding(createBindings(headerVisibleUiObservable,
- headerVisibleModelObservable));
+ IVaadinObservableValue headerVisibleUiObservable = VaadinProperties.accessor(Grid.class, "headerVisible")
+ .observe(widget);
+ IObservableValue headerVisibleModelObservable = EMFObservables.observeValue(castEObject(yGrid),
+ CxGridPackage.eINSTANCE.getCxGrid_HeaderVisible());
+ registerBinding(createBindings(headerVisibleUiObservable, headerVisibleModelObservable));
// add a value change listener to update the memento
headerVisibleModelObservable.addValueChangeListener(e -> {
- if (currentMemento == null
- || currentMemento.isHeaderVisible() != grid
- .isHeaderVisible()) {
+ if (currentMemento == null || currentMemento.isHeaderVisible() != grid.isHeaderVisible()) {
updateMemento();
}
});
// bind the columnReorderingAllowed property
IVaadinObservableValue columnReorderingAllowedUiObservable = VaadinProperties
- .accessor(Grid.class, "columnReorderingAllowed")
+ .accessor(Grid.class, "columnReorderingAllowed").observe(widget);
+ IObservableValue columnReorderingAllowedModelObservable = EMFObservables.observeValue(castEObject(yGrid),
+ CxGridPackage.eINSTANCE.getCxGrid_ColumnReorderingAllowed());
+ registerBinding(createBindings(columnReorderingAllowedUiObservable, columnReorderingAllowedModelObservable));
+
+ // bind the editorEnabled property
+ IVaadinObservableValue refreshUiObservable = VaadinProperties.accessor(CustomGrid.class, "refresh")
.observe(widget);
- IObservableValue columnReorderingAllowedModelObservable = EMFObservables
- .observeValue(castEObject(yGrid), CxGridPackage.eINSTANCE
- .getCxGrid_ColumnReorderingAllowed());
- registerBinding(createBindings(columnReorderingAllowedUiObservable,
- columnReorderingAllowedModelObservable));
+ IObservableValue refreshModelObservable = EMFObservables.observeValue(castEObject(yGrid),
+ CxGridPackage.eINSTANCE.getCxGrid_SetLastRefreshTime());
+ registerBinding(createBindings(refreshUiObservable, refreshModelObservable));
if (!modelAccess.yField.isUseBeanService()) {
// if use bean service, the container is responsible to collect
@@ -929,10 +945,8 @@
// YGrid#collection attribute.
Container.Indexed container = grid.getContainerDataSource();
// bind the rows
- registerBinding(createBindings_ContainerContents(
- castEObject(getModel()),
- CxGridPackage.Literals.CX_GRID__COLLECTION,
- (Container.ItemSetChangeNotifier) container,
+ registerBinding(createBindings_ContainerContents(castEObject(getModel()),
+ CxGridPackage.Literals.CX_GRID__COLLECTION, (Container.ItemSetChangeNotifier) container,
yGrid.getType()));
}
// update the selection binding
@@ -953,50 +967,59 @@
// create the model binding from widget to ECView-model
if (yGrid.getSelectionType() == YSelectionType.MULTI) {
- selectionBinding = createBindingsMultiSelection(
- castEObject(getModel()),
- CxGridPackage.Literals.CX_GRID__MULTI_SELECTION, grid,
- yGrid.getType());
+ selectionBinding = createBindingsMultiSelection(castEObject(getModel()),
+ CxGridPackage.Literals.CX_GRID__MULTI_SELECTION, grid, yGrid.getType());
// create the model binding from widget to ECView-model
registerBinding(selectionBinding);
} else {
// create the model binding from widget to ECView-model
- selectionBinding = createBindingsSingleSelection(
- castEObject(getModel()),
- CxGridPackage.Literals.CX_GRID__SELECTION, grid,
- yGrid.getType());
+ selectionBinding = createBindingsSingleSelection(castEObject(getModel()),
+ CxGridPackage.Literals.CX_GRID__SELECTION, grid, yGrid.getType());
registerBinding(selectionBinding);
}
}
- /* (non-Javadoc)
- * @see org.eclipse.osbp.ecview.extension.grid.editparts.presentation.IGridPresentation#updateSelectionType()
- */
@Override
public void updateSelectionType() {
- grid.setSelectionMode(modelAccess.yField.getSelectionType() == YSelectionType.MULTI ? Grid.SelectionMode.MULTI
- : Grid.SelectionMode.SINGLE);
+
+ if (modelAccess.yField.getSelectionType() == YSelectionType.MULTI) {
+ grid.setSelectionMode(Grid.SelectionMode.MULTI);
+ } else {
+ grid.setSelectionModel(new CustomSelectionModel());
+ }
+
updateSelectionBinding();
}
- /* (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 Grid getWidget() {
return grid;
}
- /* (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 grid != null;
}
- /* (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() {
@@ -1007,8 +1030,11 @@
}
}
- /* (non-Javadoc)
- * @see org.eclipse.osbp.runtime.web.ecview.presentation.vaadin.common.AbstractVaadinWidgetPresenter#doUnrender()
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osbp.runtime.web.ecview.presentation.vaadin.common.
+ * AbstractVaadinWidgetPresenter#doUnrender()
*/
@Override
public void doUnrender() {
@@ -1042,22 +1068,16 @@
* the collection type
* @return the binding
*/
- protected Binding createBindingsSingleSelection(CxGrid model,
- EStructuralFeature modelFeature, final Grid field,
+ protected Binding createBindingsSingleSelection(CxGrid model, EStructuralFeature modelFeature, final Grid field,
Class<?> collectionType) {
IBindingManager bindingManager = getViewContext()
- .getService(
- org.eclipse.osbp.ecview.core.common.binding.IECViewBindingManager.class
- .getName());
+ .getService(org.eclipse.osbp.ecview.core.common.binding.IECViewBindingManager.class.getName());
if (bindingManager != null) {
// bind the value of yText to textRidget
- IObservableValue modelObservable = EMFProperties
- .value(modelFeature).observe(model);
- IVaadinObservableValue uiObservable = VaadinProperties
- .propertyGridSelectionValueProperty(collectionType)
+ IObservableValue modelObservable = EMFProperties.value(modelFeature).observe(model);
+ IVaadinObservableValue uiObservable = VaadinProperties.propertyGridSelectionValueProperty(collectionType)
.observe(field);
- final Binding binding = bindingManager.bindValue(uiObservable,
- modelObservable, null, null);
+ final Binding binding = bindingManager.bindValue(uiObservable, modelObservable, null, null);
return binding;
}
@@ -1077,23 +1097,17 @@
* the collection type
* @return the binding
*/
- protected Binding createBindingsMultiSelection(CxGrid model,
- EStructuralFeature modelFeature, final Grid field,
+ protected Binding createBindingsMultiSelection(CxGrid model, EStructuralFeature modelFeature, final Grid field,
Class<?> collectionType) {
IBindingManager bindingManager = getViewContext()
- .getService(
- org.eclipse.osbp.ecview.core.common.binding.IECViewBindingManager.class
- .getName());
+ .getService(org.eclipse.osbp.ecview.core.common.binding.IECViewBindingManager.class.getName());
if (bindingManager != null) {
// bind the value of yText to textRidget
- IObservableList modelObservable = EMFProperties.list(modelFeature)
- .observe(model);
+ IObservableList modelObservable = EMFProperties.list(modelFeature).observe(model);
IVaadinObservableList uiObservable = new SetToListAdapter(
- VaadinProperties.propertyGridSelectionSetPropertyAsSet(
- collectionType).observe(field), field);
+ VaadinProperties.propertyGridSelectionSetPropertyAsSet(collectionType).observe(field), field);
- final Binding binding = bindingManager.bindList(uiObservable,
- modelObservable, null, null);
+ final Binding binding = bindingManager.bindList(uiObservable, modelObservable, null, null);
return binding;
}
@@ -1124,8 +1138,11 @@
updateMemento();
}
- /* (non-Javadoc)
- * @see org.eclipse.osbp.ecview.extension.grid.editparts.presentation.IGridPresentation#updateFilter()
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osbp.ecview.extension.grid.editparts.presentation.
+ * IGridPresentation#updateFilter()
*/
@Override
public void updateFilter() {
@@ -1133,26 +1150,30 @@
updateMemento();
}
- /* (non-Javadoc)
- * @see org.eclipse.osbp.ecview.extension.grid.editparts.presentation.IGridPresentation#updateCellStyleGenerator()
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osbp.ecview.extension.grid.editparts.presentation.
+ * IGridPresentation#updateCellStyleGenerator()
*/
@Override
public void updateCellStyleGenerator() {
- CxGridCellStyleGenerator cxGenerator = modelAccess.yField
- .getCellStyleGenerator();
+ CxGridCellStyleGenerator cxGenerator = modelAccess.yField.getCellStyleGenerator();
if (cxGenerator != null) {
- IGridCellStyleGeneratorEditpart ep = ModelUtil.getEditpart(
- getViewContext(), cxGenerator);
- Grid.CellStyleGenerator generator = (Grid.CellStyleGenerator) ep
- .getDelegate();
+ IGridCellStyleGeneratorEditpart ep = ModelUtil.getEditpart(getViewContext(), cxGenerator);
+ Grid.CellStyleGenerator generator = (Grid.CellStyleGenerator) ep.getDelegate();
grid.setCellStyleGenerator(generator);
} else {
grid.setCellStyleGenerator(null);
}
}
- /* (non-Javadoc)
- * @see org.eclipse.osbp.runtime.common.memento.IMementoHandler#applyMemento(java.lang.Object)
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.osbp.runtime.common.memento.IMementoHandler#applyMemento(java
+ * .lang.Object)
*/
@Override
public void applyMemento(Object value) {
@@ -1194,8 +1215,7 @@
// apply the columns to the grid and the setting to each column
//
List<CxGridColumn> tempColumns = new ArrayList<>(cxGrid.getColumns());
- List<CxGridColumn> cxOrderedColumns = new ArrayList<>(cxGrid
- .getColumns().size());
+ List<CxGridColumn> cxOrderedColumns = new ArrayList<>(cxGrid.getColumns().size());
for (CxGridMementoColumn memColumn : cxMemento.getColumns()) {
CxGridColumn cxColumn = findCxColumn(memColumn.getPropertyId());
if (cxColumn != null) {
@@ -1227,16 +1247,13 @@
// update the sortorder
//
- List<CxGridSortable> cxSortables = new ArrayList<>(cxMemento
- .getSortOrders().size());
+ List<CxGridSortable> cxSortables = new ArrayList<>(cxMemento.getSortOrders().size());
if (cxMemento.getSortOrders().size() > 0) {
for (CxGridMementoSortable memSort : cxMemento.getSortOrders()) {
- CxGridColumn cxColumn = findCxColumn(memSort.getColumn()
- .getPropertyId());
+ CxGridColumn cxColumn = findCxColumn(memSort.getColumn().getPropertyId());
if (cxColumn != null) {
- CxGridSortable cxSortable = CxGridFactory.eINSTANCE
- .createCxGridSortable();
+ CxGridSortable cxSortable = CxGridFactory.eINSTANCE.createCxGridSortable();
cxSortable.setColumn(cxColumn);
cxSortable.setDescending(memSort.isDescending());
cxSortables.add(cxSortable);
@@ -1254,8 +1271,7 @@
* @return the sort direction
*/
private SortDirection toDirection(CxGridSortable cxSortable) {
- return cxSortable.isDescending() ? SortDirection.DESCENDING
- : SortDirection.ASCENDING;
+ return cxSortable.isDescending() ? SortDirection.DESCENDING : SortDirection.ASCENDING;
}
/**
@@ -1264,8 +1280,7 @@
* @return the memento
*/
private Object getMemento() {
- CxGridMemento cxMemento = CxGridMementoFactory.eINSTANCE
- .createCxGridMemento();
+ CxGridMemento cxMemento = CxGridMementoFactory.eINSTANCE.createCxGridMemento();
currentMemento = cxMemento;
@@ -1278,8 +1293,7 @@
Map<Object, CxGridMementoColumn> tempColumns = new HashMap<>();
for (Grid.Column column : grid.getColumns()) {
- CxGridMementoColumn cxColumn = CxGridMementoFactory.eINSTANCE
- .createCxGridMementoColumn();
+ CxGridMementoColumn cxColumn = CxGridMementoFactory.eINSTANCE.createCxGridMementoColumn();
cxColumn.setEditable(column.isEditable());
cxColumn.setExpandRatio(column.getExpandRatio());
cxColumn.setHideable(column.isHidable());
@@ -1293,19 +1307,15 @@
}
for (SortOrder sortOrder : grid.getSortOrder()) {
- CxGridMementoSortable cxSortable = CxGridMementoFactory.eINSTANCE
- .createCxGridMementoSortable();
- CxGridMementoColumn cxColumn = tempColumns.get(sortOrder
- .getPropertyId());
+ CxGridMementoSortable cxSortable = CxGridMementoFactory.eINSTANCE.createCxGridMementoSortable();
+ CxGridMementoColumn cxColumn = tempColumns.get(sortOrder.getPropertyId());
if (cxColumn == null) {
- LOGGER.warn("Column is not available :"
- + sortOrder.getPropertyId());
+ LOGGER.warn("Column is not available :" + sortOrder.getPropertyId());
continue;
}
cxSortable.setColumn(cxColumn);
- cxSortable
- .setDescending(sortOrder.getDirection() == SortDirection.DESCENDING);
+ cxSortable.setDescending(sortOrder.getDirection() == SortDirection.DESCENDING);
cxMemento.getSortOrders().add(cxSortable);
}
@@ -1351,7 +1361,6 @@
updateMemento();
}
});
-
}
/**
@@ -1362,8 +1371,7 @@
* @return the column wrapper
*/
private ColumnWrapper findColumnWrapper(Grid.Column column) {
- return columns.stream().filter(e -> e.column == column).findFirst()
- .orElse(null);
+ return columns.stream().filter(e -> e.column == column).findFirst().orElse(null);
}
/**
@@ -1374,9 +1382,7 @@
* @return the column wrapper
*/
private ColumnWrapper findColumnWrapper(String propertyId) {
- return columns.stream()
- .filter(e -> e.column.getPropertyId().equals(propertyId))
- .findFirst().orElse(null);
+ return columns.stream().filter(e -> e.column.getPropertyId().equals(propertyId)).findFirst().orElse(null);
}
/**
@@ -1388,9 +1394,7 @@
*/
private CxGridColumn findCxColumn(String propertyId) {
CxGrid cxGrid = modelAccess.yField;
- return cxGrid.getColumns().stream()
- .filter(e -> e.getPropertyId().equals(propertyId)).findFirst()
- .orElse(null);
+ return cxGrid.getColumns().stream().filter(e -> e.getPropertyId().equals(propertyId)).findFirst().orElse(null);
}
/**
@@ -1403,15 +1407,17 @@
}
}
- /* (non-Javadoc)
- * @see org.eclipse.osbp.runtime.web.ecview.presentation.vaadin.common.AbstractVaadinWidgetPresenter#internalGetObservableEndpoint(org.eclipse.osbp.ecview.core.common.model.core.YEmbeddableBindingEndpoint)
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osbp.runtime.web.ecview.presentation.vaadin.common.
+ * AbstractVaadinWidgetPresenter#internalGetObservableEndpoint(org.eclipse.
+ * osbp.ecview.core.common.model.core. YEmbeddableBindingEndpoint)
*/
@Override
- protected IObservable internalGetObservableEndpoint(
- YEmbeddableBindingEndpoint bindableValue) {
+ protected IObservable internalGetObservableEndpoint(YEmbeddableBindingEndpoint bindableValue) {
if (bindableValue == null) {
- throw new IllegalArgumentException(
- "BindableValue must not be null!");
+ throw new IllegalArgumentException("BindableValue must not be null!");
}
if (bindableValue instanceof YEmbeddableCollectionEndpoint) {
@@ -1421,8 +1427,7 @@
} else if (bindableValue instanceof YEmbeddableMultiSelectionEndpoint) {
return internalGetMultiSelectionEndpoint();
}
- throw new IllegalArgumentException("Not a valid input: "
- + bindableValue);
+ throw new IllegalArgumentException("Not a valid input: " + bindableValue);
}
/**
@@ -1432,8 +1437,7 @@
*/
protected IObservableList internalGetCollectionEndpoint() {
// return the observable value for text
- return EMFProperties.list(CxGridPackage.Literals.CX_GRID__COLLECTION)
- .observe(getModel());
+ return EMFProperties.list(CxGridPackage.Literals.CX_GRID__COLLECTION).observe(getModel());
}
/**
@@ -1444,16 +1448,13 @@
* @return the i observable value
*/
@SuppressWarnings("restriction")
- protected IObservableValue internalGetSelectionEndpoint(
- YEmbeddableSelectionEndpoint yEndpoint) {
+ protected IObservableValue internalGetSelectionEndpoint(YEmbeddableSelectionEndpoint yEndpoint) {
- String attributePath = ECViewModelBindable.getAttributePath(
- CxGridPackage.Literals.CX_GRID__SELECTION,
+ String attributePath = ECViewModelBindable.getAttributePath(CxGridPackage.Literals.CX_GRID__SELECTION,
yEndpoint.getAttributePath());
// return the observable value
- return ECViewModelBindable.observeValue(castEObject(getModel()),
- attributePath, modelAccess.yField.getType(),
+ return ECViewModelBindable.observeValue(castEObject(getModel()), attributePath, modelAccess.yField.getType(),
modelAccess.yField.getEmfNsURI());
}
@@ -1464,15 +1465,14 @@
*/
protected IObservableList internalGetMultiSelectionEndpoint() {
// return the observable value for text
- return EMFProperties.list(CxGridPackage.Literals.CX_GRID__SELECTION)
- .observe(getModel());
+ return EMFProperties.list(CxGridPackage.Literals.CX_GRID__SELECTION).observe(getModel());
}
/**
* An internal helper class.
*/
private static class ModelAccess {
-
+
/** The y field. */
private final CxGrid yField;
@@ -1547,12 +1547,11 @@
/**
* The Class ColumnWrapper.
*/
- private class ColumnWrapper extends AbstractDisposable implements
- IGridColumnEditpart.ColumnReference {
+ private class ColumnWrapper extends AbstractDisposable implements IGridColumnEditpart.ColumnReference {
/** The cx column. */
private CxGridColumn cxColumn;
-
+
/** The column. */
private Grid.Column column;
@@ -1572,8 +1571,12 @@
columns.add(this);
}
- /* (non-Javadoc)
- * @see org.eclipse.osbp.ecview.extension.grid.editparts.IGridColumnEditpart.ColumnReference#setConverter(java.lang.Object)
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.osbp.ecview.extension.grid.editparts.IGridColumnEditpart.
+ * ColumnReference#setConverter(java.lang.Object)
*/
@Override
public void setConverter(Object converter) {
@@ -1582,8 +1585,12 @@
}
}
- /* (non-Javadoc)
- * @see org.eclipse.osbp.ecview.extension.grid.editparts.IGridColumnEditpart.ColumnReference#setRenderer(java.lang.Object, java.lang.Object)
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.osbp.ecview.extension.grid.editparts.IGridColumnEditpart.
+ * ColumnReference#setRenderer(java.lang.Object, java.lang.Object)
*/
@SuppressWarnings({ "unchecked", "rawtypes" })
@Override
@@ -1599,8 +1606,12 @@
}
}
- /* (non-Javadoc)
- * @see org.eclipse.osbp.ecview.extension.grid.editparts.IGridColumnEditpart.ColumnReference#updateProperties()
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.osbp.ecview.extension.grid.editparts.IGridColumnEditpart.
+ * ColumnReference#updateProperties()
*/
@Override
public void updateProperties() {
@@ -1625,8 +1636,12 @@
}
}
- /* (non-Javadoc)
- * @see org.eclipse.osbp.ecview.extension.grid.editparts.IGridColumnEditpart.ColumnReference#updateEditorField()
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.osbp.ecview.extension.grid.editparts.IGridColumnEditpart.
+ * ColumnReference#updateEditorField()
*/
@Override
public void updateEditorField() {
@@ -1636,8 +1651,7 @@
YField cxField = cxColumn.getEditorField();
Field<?> field = null;
if (cxField != null) {
- IFieldEditpart editpart = ModelUtil.getEditpart(
- getViewContext(), cxField);
+ IFieldEditpart editpart = ModelUtil.getEditpart(getViewContext(), cxField);
field = (Field<?>) editpart.render(null);
field.setSizeFull();
}
@@ -1645,8 +1659,11 @@
}
}
- /* (non-Javadoc)
- * @see org.eclipse.osbp.runtime.common.dispose.AbstractDisposable#internalDispose()
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osbp.runtime.common.dispose.AbstractDisposable#
+ * internalDispose()
*/
@Override
protected void internalDispose() {
@@ -1678,17 +1695,14 @@
private void userChangedSortOrder(SortEvent e) {
List<CxGridSortable> cxSortOrder = new ArrayList<>();
for (SortOrder sortOrder : e.getSortOrder()) {
- ColumnWrapper wrapper = findColumnWrapper((String) sortOrder
- .getPropertyId());
+ ColumnWrapper wrapper = findColumnWrapper((String) sortOrder.getPropertyId());
- CxGridSortable cxSortable = CxGridFactory.eINSTANCE
- .createCxGridSortable();
+ CxGridSortable cxSortable = CxGridFactory.eINSTANCE.createCxGridSortable();
cxSortOrder.add(cxSortable);
if (wrapper != null) {
cxSortable.setColumn(wrapper.cxColumn);
}
- cxSortable
- .setDescending(sortOrder.getDirection() == SortDirection.DESCENDING);
+ cxSortable.setDescending(sortOrder.getDirection() == SortDirection.DESCENDING);
}
CxGrid cxGrid = modelAccess.yField;
@@ -1712,8 +1726,7 @@
Grid.Column affected = e.getColumn();
ColumnWrapper wrapper = findColumnWrapper(affected);
if (wrapper == null) {
- LOGGER.warn("No column available for "
- + affected.getHeaderCaption());
+ LOGGER.warn("No column available for " + affected.getHeaderCaption());
return;
}
@@ -1735,7 +1748,9 @@
List<CxGridColumn> cxColumns = new ArrayList<>();
for (Grid.Column column : grid.getColumns()) {
ColumnWrapper wrapper = findColumnWrapper(column);
- cxColumns.add(wrapper.cxColumn);
+ if (wrapper != null) {
+ cxColumns.add(wrapper.cxColumn);
+ }
}
CxGrid cxGrid = modelAccess.yField;
@@ -1748,4 +1763,48 @@
}
}
}
+
+ /**
+ * The Class CustomTextField.
+ */
+ @SuppressWarnings("serial")
+ public class CustomGrid extends Grid {
+
+ // only required to be able to create a binding between
+ // org.eclipse.osbp.ecview.extension.grid.CxGrid and com.vaadin.ui.Grid
+ // to call this method which refresh the grid.
+ public long getRefresh() {
+ return 0;
+ }
+
+ // only required to be able to create a binding between
+ // org.eclipse.osbp.ecview.extension.grid.CxGrid and com.vaadin.ui.Grid
+ // to call this method which refresh the grid.
+ public void setRefresh(long time) {
+ List<SortOrder> sort = getSortOrder();
+ clearSortOrder();
+ setSortOrder(sort);
+ }
+ }
+
+ @SuppressWarnings("serial")
+ public class CustomSelectionModel extends Grid.SingleSelectionModel {
+ @Override
+ public boolean isSelected(Object itemId) {
+ boolean result = super.isSelected(itemId);
+ if (!result) {
+ Object selectedItemId = getSelectedRow();
+ if (selectedItemId != null && itemId != selectedItemId) {
+ Object id1 = DtoUtils.getIdValue(itemId);
+ Object id2 = DtoUtils.getIdValue(selectedItemId);
+ result = Objects.equals(id1, id2);
+ if (result) {
+ reset();
+ select(itemId);
+ }
+ }
+ }
+ return result;
+ }
+ }
}
diff --git a/org.eclipse.osbp.ecview.extension.grid.sample/.classpath b/org.eclipse.osbp.ecview.extension.grid.sample/.classpath
new file mode 100644
index 0000000..502f456
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.grid.sample/.classpath
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src/"/>
+ <classpathentry kind="src" path="src-gen/"/>
+ <classpathentry kind="output" path="target/classes"/>
+</classpath>
diff --git a/org.eclipse.osbp.ecview.extension.grid.sample/.gitignore b/org.eclipse.osbp.ecview.extension.grid.sample/.gitignore
new file mode 100644
index 0000000..b83d222
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.grid.sample/.gitignore
@@ -0,0 +1 @@
+/target/
diff --git a/org.eclipse.osbp.ecview.extension.grid.sample/.settings/org.eclipse.core.resources.prefs b/org.eclipse.osbp.ecview.extension.grid.sample/.settings/org.eclipse.core.resources.prefs
new file mode 100644
index 0000000..99f26c0
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.grid.sample/.settings/org.eclipse.core.resources.prefs
@@ -0,0 +1,2 @@
+eclipse.preferences.version=1
+encoding/<project>=UTF-8
diff --git a/org.eclipse.osbp.ecview.extension.grid.sample/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.osbp.ecview.extension.grid.sample/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 0000000..0c68a61
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.grid.sample/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,7 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+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.8
diff --git a/org.eclipse.osbp.ecview.extension.grid.sample/.settings/org.eclipse.m2e.core.prefs b/org.eclipse.osbp.ecview.extension.grid.sample/.settings/org.eclipse.m2e.core.prefs
new file mode 100644
index 0000000..f897a7f
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.grid.sample/.settings/org.eclipse.m2e.core.prefs
@@ -0,0 +1,4 @@
+activeProfiles=
+eclipse.preferences.version=1
+resolveWorkspaceProjects=true
+version=1
diff --git a/org.eclipse.osbp.ecview.extension.grid.sample/.settings/org.eclipse.xtend.core.Xtend.prefs b/org.eclipse.osbp.ecview.extension.grid.sample/.settings/org.eclipse.xtend.core.Xtend.prefs
new file mode 100644
index 0000000..19e3115
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.grid.sample/.settings/org.eclipse.xtend.core.Xtend.prefs
@@ -0,0 +1,11 @@
+//outlet.DEFAULT_OUTPUT.sourceFolder.src/test/java.directory=src/test/generated-sources/xtend
+BuilderConfiguration.is_project_specific=true
+eclipse.preferences.version=1
+is_project_specific=true
+outlet.DEFAULT_OUTPUT.hideLocalSyntheticVariables=true
+outlet.DEFAULT_OUTPUT.installDslAsPrimarySource=false
+outlet.DEFAULT_OUTPUT.sourceFolder.emf-gen.directory=xtend-gen
+outlet.DEFAULT_OUTPUT.sourceFolder.src-gen.directory=xtend-gen
+outlet.DEFAULT_OUTPUT.sourceFolder.src.directory=xtend-gen
+outlet.DEFAULT_OUTPUT.sourceFolder.xtend-gen.directory=xtend-gen
+outlet.DEFAULT_OUTPUT.userOutputPerSourceFolder=true
diff --git a/org.eclipse.osbp.ecview.extension.grid.sample/META-INF/MANIFEST.MF b/org.eclipse.osbp.ecview.extension.grid.sample/META-INF/MANIFEST.MF
index 20f766b..f2213f2 100644
--- a/org.eclipse.osbp.ecview.extension.grid.sample/META-INF/MANIFEST.MF
+++ b/org.eclipse.osbp.ecview.extension.grid.sample/META-INF/MANIFEST.MF
@@ -4,9 +4,9 @@
Bundle-SymbolicName: org.eclipse.osbp.ecview.extension.grid.sample;singleton:=true
Bundle-Vendor: Eclipse OSBP
Bundle-Version: 0.9.0.qualifier
-Require-Bundle: com.vaadin.shared;bundle-version="[7.5.7,7.7.0)",
- com.vaadin.client;bundle-version="[7.5.7,7.7.0)",
- com.vaadin.server;bundle-version="[7.5.7,7.7.0)",
+Require-Bundle: com.vaadin.shared;bundle-version="[7.7.6,7.8.0)",
+ com.vaadin.client;bundle-version="[7.7.6,7.8.0)",
+ com.vaadin.server;bundle-version="[7.7.6,7.8.0)",
com.ibm.icu;bundle-version="50.1.1",
org.eclipse.osbp.ecview.core.common;bundle-version="[0.9.0,0.10.0)",
org.eclipse.osbp.ecview.core.common.editparts.emf;bundle-version="[0.9.0,0.10.0)",
@@ -28,8 +28,8 @@
javax.persistence;bundle-version="2.1.0",
org.jsoup;bundle-version="1.7.2",
org.eclipse.osbp.ecview.extension.grid.editparts;bundle-version="[0.9.0,0.10.0)",
- com.vaadin.client-compiled;bundle-version="[7.5.7,7.7.0)",
- com.vaadin.themes;bundle-version="[7.5.7,7.7.0)",
+ com.vaadin.client-compiled;bundle-version="[7.7.6,7.8.0)",
+ com.vaadin.themes;bundle-version="[7.7.6,7.8.0)",
org.vaadin.addons.vaadin-grid-util;bundle-version="1.0.7",
org.eclipse.osbp.runtime.memento;bundle-version="[0.9.0,0.10.0)"
Import-Package: org.osgi.framework;version="1.7.0",
diff --git a/org.eclipse.osbp.ecview.extension.grid.tests/.classpath b/org.eclipse.osbp.ecview.extension.grid.tests/.classpath
new file mode 100644
index 0000000..fec2eab
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.grid.tests/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="output" path="target/classes"/>
+</classpath>
diff --git a/org.eclipse.osbp.ecview.extension.grid.tests/.settings/org.eclipse.core.resources.prefs b/org.eclipse.osbp.ecview.extension.grid.tests/.settings/org.eclipse.core.resources.prefs
new file mode 100644
index 0000000..99f26c0
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.grid.tests/.settings/org.eclipse.core.resources.prefs
@@ -0,0 +1,2 @@
+eclipse.preferences.version=1
+encoding/<project>=UTF-8
diff --git a/org.eclipse.osbp.ecview.extension.grid.tests/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.osbp.ecview.extension.grid.tests/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 0000000..0c68a61
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.grid.tests/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,7 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+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.8
diff --git a/org.eclipse.osbp.ecview.extension.grid.tests/.settings/org.eclipse.m2e.core.prefs b/org.eclipse.osbp.ecview.extension.grid.tests/.settings/org.eclipse.m2e.core.prefs
new file mode 100644
index 0000000..f897a7f
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.grid.tests/.settings/org.eclipse.m2e.core.prefs
@@ -0,0 +1,4 @@
+activeProfiles=
+eclipse.preferences.version=1
+resolveWorkspaceProjects=true
+version=1
diff --git a/org.eclipse.osbp.ecview.extension.grid.tests/.settings/org.eclipse.xtend.core.Xtend.prefs b/org.eclipse.osbp.ecview.extension.grid.tests/.settings/org.eclipse.xtend.core.Xtend.prefs
new file mode 100644
index 0000000..0933f8c
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.grid.tests/.settings/org.eclipse.xtend.core.Xtend.prefs
@@ -0,0 +1,10 @@
+//outlet.DEFAULT_OUTPUT.sourceFolder.src/test/java.directory=src/test/generated-sources/xtend
+eclipse.preferences.version=1
+is_project_specific=true
+outlet.DEFAULT_OUTPUT.hideLocalSyntheticVariables=true
+outlet.DEFAULT_OUTPUT.installDslAsPrimarySource=false
+outlet.DEFAULT_OUTPUT.sourceFolder.emf-gen.directory=xtend-gen
+outlet.DEFAULT_OUTPUT.sourceFolder.src-gen.directory=xtend-gen
+outlet.DEFAULT_OUTPUT.sourceFolder.src.directory=xtend-gen
+outlet.DEFAULT_OUTPUT.sourceFolder.xtend-gen.directory=xtend-gen
+outlet.DEFAULT_OUTPUT.userOutputPerSourceFolder=true
diff --git a/org.eclipse.osbp.ecview.extension.grid.tests/META-INF/MANIFEST.MF b/org.eclipse.osbp.ecview.extension.grid.tests/META-INF/MANIFEST.MF
index fe82590..67d1ce3 100644
--- a/org.eclipse.osbp.ecview.extension.grid.tests/META-INF/MANIFEST.MF
+++ b/org.eclipse.osbp.ecview.extension.grid.tests/META-INF/MANIFEST.MF
@@ -20,8 +20,8 @@
Require-Bundle: org.junit;bundle-version="4.10.0",
org.knowhowlab.osgi.testing.assertions;bundle-version="[1.3.0,1.3.1)",
org.knowhowlab.osgi.testing.utils;bundle-version="[1.2.2,1.2.3)",
- com.vaadin.shared;bundle-version="[7.5.7,7.7.0)",
- com.vaadin.server;bundle-version="[7.5.7,7.7.0)",
+ com.vaadin.shared;bundle-version="[7.7.6,7.8.0)",
+ com.vaadin.server;bundle-version="[7.7.6,7.8.0)",
org.eclipse.osbp.runtime.web.vaadin.common;bundle-version="[0.9.0,0.10.0)",
org.eclipse.osbp.runtime.web.ecview.presentation.vaadin;bundle-version="[0.9.0,0.10.0)",
org.eclipse.osbp.runtime.web.vaadin.databinding;bundle-version="[0.9.0,0.10.0)",
@@ -45,7 +45,7 @@
org.eclipse.osbp.ecview.extension.grid.editparts;bundle-version="[0.9.0,0.10.0)",
org.eclipse.osbp.ecview.extension.grid.presentation;bundle-version="[0.9.0,0.10.0)",
org.eclipse.osbp.ecview.extension.grid.model;bundle-version="[0.9.0,0.10.0)",
- org.eclipse.osbp.runtime.designer.api;bundle-version="0.9.0"
+ org.eclipse.osbp.runtime.designer.api;bundle-version="[0.9.0,0.10.0)"
Service-Component: OSGI-INF/org.eclipse.osbp.ecview.extension.grid.tests.presentation.CellStyleGeneratorFactorty.xml,
OSGI-INF/org.eclipse.osbp.ecview.extension.grid.tests.presentation.ConverterFactorty.xml,
OSGI-INF/org.eclipse.osbp.ecview.extension.grid.tests.presentation.GridTests$I18nService.xml
diff --git a/org.eclipse.osbp.ecview.extension.model.editor/.classpath b/org.eclipse.osbp.ecview.extension.model.editor/.classpath
new file mode 100644
index 0000000..22f3064
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.model.editor/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/org.eclipse.osbp.ecview.extension.model.editor/META-INF/MANIFEST.MF b/org.eclipse.osbp.ecview.extension.model.editor/META-INF/MANIFEST.MF
index 1a42c14..11e229d 100644
--- a/org.eclipse.osbp.ecview.extension.model.editor/META-INF/MANIFEST.MF
+++ b/org.eclipse.osbp.ecview.extension.model.editor/META-INF/MANIFEST.MF
@@ -7,17 +7,17 @@
Bundle-Activator: org.eclipse.osbp.ecview.extension.model.presentation.ecviewEditorPlugin$Implementation
Bundle-Vendor: Eclipse OSBP
Bundle-Localization: plugin
-Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Export-Package: org.eclipse.osbp.ecview.extension.model.converter.presentation,
org.eclipse.osbp.ecview.extension.model.presentation,
org.eclipse.osbp.ecview.extension.model.visibility.presentation
Require-Bundle: org.eclipse.core.runtime,
org.eclipse.core.resources;visibility:=reexport,
- org.eclipse.osbp.ecview.extension.model.edit;visibility:=reexport,
+ org.eclipse.osbp.ecview.extension.model.edit;bundle-version="[0.9.0,0.10.0)";visibility:=reexport,
org.eclipse.emf.ecore.xmi;visibility:=reexport,
org.eclipse.emf.edit.ui;visibility:=reexport,
org.eclipse.ui.ide;visibility:=reexport,
- org.eclipse.osbp.ecview.core.common.model.edit;visibility:=reexport,
- org.eclipse.osbp.ecview.core.extension.model.edit;visibility:=reexport,
- org.eclipse.xtext.common.types.edit;visibility:=reexport
+ org.eclipse.osbp.ecview.core.common.model.edit;bundle-version="[0.9.0,0.10.0)";visibility:=reexport,
+ org.eclipse.osbp.ecview.core.extension.model.edit;bundle-version="[0.9.0,0.10.0)";visibility:=reexport,
+ org.eclipse.xtext.common.types.edit;bundle-version="[2.11.0,2.12.0)";visibility:=reexport
Bundle-ActivationPolicy: lazy
diff --git a/org.eclipse.osbp.ecview.extension.model.editor/src/org/eclipse/osbp/ecview/extension/model/converter/presentation/YConverterActionBarContributor.java b/org.eclipse.osbp.ecview.extension.model.editor/src/org/eclipse/osbp/ecview/extension/model/converter/presentation/YConverterActionBarContributor.java
index 4c16bbf..a312247 100644
--- a/org.eclipse.osbp.ecview.extension.model.editor/src/org/eclipse/osbp/ecview/extension/model/converter/presentation/YConverterActionBarContributor.java
+++ b/org.eclipse.osbp.ecview.extension.model.editor/src/org/eclipse/osbp/ecview/extension/model/converter/presentation/YConverterActionBarContributor.java
@@ -66,7 +66,7 @@
* <!-- end-user-doc -->
* @generated
*/
- public static final String copyright = "All rights reserved by Loetz GmbH&Co.KG Heidelberg 2015.\n\nContributors:\n Florian Pirchner - initial API and implementation";
+ public static final String copyright = "All rights reserved by Loetz GmbH und CoKG Heidelberg 2015.\n\nContributors:\n Florian Pirchner - initial API and implementation";
/**
* This keeps track of the active editor.
diff --git a/org.eclipse.osbp.ecview.extension.model.editor/src/org/eclipse/osbp/ecview/extension/model/converter/presentation/YConverterEditor.java b/org.eclipse.osbp.ecview.extension.model.editor/src/org/eclipse/osbp/ecview/extension/model/converter/presentation/YConverterEditor.java
index 9b30c50..091727c 100644
--- a/org.eclipse.osbp.ecview.extension.model.editor/src/org/eclipse/osbp/ecview/extension/model/converter/presentation/YConverterEditor.java
+++ b/org.eclipse.osbp.ecview.extension.model.editor/src/org/eclipse/osbp/ecview/extension/model/converter/presentation/YConverterEditor.java
@@ -208,7 +208,7 @@
* <!-- end-user-doc -->
* @generated
*/
- public static final String copyright = "All rights reserved by Loetz GmbH&Co.KG Heidelberg 2015.\n\nContributors:\n Florian Pirchner - initial API and implementation";
+ public static final String copyright = "All rights reserved by Loetz GmbH und CoKG Heidelberg 2015.\n\nContributors:\n Florian Pirchner - initial API and implementation";
/**
* This keeps track of the editing domain that is used to track all changes to the model.
@@ -1002,7 +1002,7 @@
* @generated
*/
public void createModel() {
- URI resourceURI = EditUIUtil.getURI(getEditorInput());
+ URI resourceURI = EditUIUtil.getURI(getEditorInput(), editingDomain.getResourceSet().getURIConverter());
Exception exception = null;
Resource resource = null;
try {
@@ -1030,10 +1030,11 @@
* @generated
*/
public Diagnostic analyzeResourceProblems(Resource resource, Exception exception) {
- if (!resource.getErrors().isEmpty() || !resource.getWarnings().isEmpty()) {
+ boolean hasErrors = !resource.getErrors().isEmpty();
+ if (hasErrors || !resource.getWarnings().isEmpty()) {
BasicDiagnostic basicDiagnostic =
new BasicDiagnostic
- (Diagnostic.ERROR,
+ (hasErrors ? Diagnostic.ERROR : Diagnostic.WARNING,
"org.eclipse.osbp.ecview.extension.model.editor",
0,
getString("_UI_CreateModelError_message", resource.getURI()),
diff --git a/org.eclipse.osbp.ecview.extension.model.editor/src/org/eclipse/osbp/ecview/extension/model/converter/presentation/YConverterModelWizard.java b/org.eclipse.osbp.ecview.extension.model.editor/src/org/eclipse/osbp/ecview/extension/model/converter/presentation/YConverterModelWizard.java
index dd12677..183d63b 100644
--- a/org.eclipse.osbp.ecview.extension.model.editor/src/org/eclipse/osbp/ecview/extension/model/converter/presentation/YConverterModelWizard.java
+++ b/org.eclipse.osbp.ecview.extension.model.editor/src/org/eclipse/osbp/ecview/extension/model/converter/presentation/YConverterModelWizard.java
@@ -110,7 +110,7 @@
* <!-- end-user-doc -->
* @generated
*/
- public static final String copyright = "All rights reserved by Loetz GmbH&Co.KG Heidelberg 2015.\n\nContributors:\n Florian Pirchner - initial API and implementation";
+ public static final String copyright = "All rights reserved by Loetz GmbH und CoKG Heidelberg 2015.\n\nContributors:\n Florian Pirchner - initial API and implementation";
/**
* The supported extensions for created files.
@@ -415,8 +415,7 @@
* @generated
*/
public void createControl(Composite parent) {
- Composite composite = new Composite(parent, SWT.NONE);
- {
+ Composite composite = new Composite(parent, SWT.NONE); {
GridLayout layout = new GridLayout();
layout.numColumns = 1;
layout.verticalSpacing = 12;
diff --git a/org.eclipse.osbp.ecview.extension.model.editor/src/org/eclipse/osbp/ecview/extension/model/presentation/YECviewActionBarContributor.java b/org.eclipse.osbp.ecview.extension.model.editor/src/org/eclipse/osbp/ecview/extension/model/presentation/YECviewActionBarContributor.java
index ee41b39..63933b1 100644
--- a/org.eclipse.osbp.ecview.extension.model.editor/src/org/eclipse/osbp/ecview/extension/model/presentation/YECviewActionBarContributor.java
+++ b/org.eclipse.osbp.ecview.extension.model.editor/src/org/eclipse/osbp/ecview/extension/model/presentation/YECviewActionBarContributor.java
@@ -64,7 +64,7 @@
* <!-- end-user-doc -->
* @generated
*/
- public static final String copyright = "All rights reserved by Loetz GmbH&Co.KG Heidelberg 2015.\n\nContributors:\n Florian Pirchner - initial API and implementation";
+ public static final String copyright = "All rights reserved by Loetz GmbH und CoKG Heidelberg 2015.\n\nContributors:\n Florian Pirchner - initial API and implementation";
/**
* This keeps track of the active editor.
diff --git a/org.eclipse.osbp.ecview.extension.model.editor/src/org/eclipse/osbp/ecview/extension/model/presentation/YECviewEditor.java b/org.eclipse.osbp.ecview.extension.model.editor/src/org/eclipse/osbp/ecview/extension/model/presentation/YECviewEditor.java
index 1d12182..c5e99ea 100644
--- a/org.eclipse.osbp.ecview.extension.model.editor/src/org/eclipse/osbp/ecview/extension/model/presentation/YECviewEditor.java
+++ b/org.eclipse.osbp.ecview.extension.model.editor/src/org/eclipse/osbp/ecview/extension/model/presentation/YECviewEditor.java
@@ -206,7 +206,7 @@
* <!-- end-user-doc -->
* @generated
*/
- public static final String copyright = "All rights reserved by Loetz GmbH&Co.KG Heidelberg 2015.\n\nContributors:\n Florian Pirchner - initial API and implementation";
+ public static final String copyright = "All rights reserved by Loetz GmbH und CoKG Heidelberg 2015.\n\nContributors:\n Florian Pirchner - initial API and implementation";
/**
* This keeps track of the editing domain that is used to track all changes to the model.
@@ -1000,7 +1000,7 @@
* @generated
*/
public void createModel() {
- URI resourceURI = EditUIUtil.getURI(getEditorInput());
+ URI resourceURI = EditUIUtil.getURI(getEditorInput(), editingDomain.getResourceSet().getURIConverter());
Exception exception = null;
Resource resource = null;
try {
@@ -1028,10 +1028,11 @@
* @generated
*/
public Diagnostic analyzeResourceProblems(Resource resource, Exception exception) {
- if (!resource.getErrors().isEmpty() || !resource.getWarnings().isEmpty()) {
+ boolean hasErrors = !resource.getErrors().isEmpty();
+ if (hasErrors || !resource.getWarnings().isEmpty()) {
BasicDiagnostic basicDiagnostic =
new BasicDiagnostic
- (Diagnostic.ERROR,
+ (hasErrors ? Diagnostic.ERROR : Diagnostic.WARNING,
"org.eclipse.osbp.ecview.extension.model.editor",
0,
getString("_UI_CreateModelError_message", resource.getURI()),
diff --git a/org.eclipse.osbp.ecview.extension.model.editor/src/org/eclipse/osbp/ecview/extension/model/presentation/YECviewModelWizard.java b/org.eclipse.osbp.ecview.extension.model.editor/src/org/eclipse/osbp/ecview/extension/model/presentation/YECviewModelWizard.java
index 0c45464..a21efc4 100644
--- a/org.eclipse.osbp.ecview.extension.model.editor/src/org/eclipse/osbp/ecview/extension/model/presentation/YECviewModelWizard.java
+++ b/org.eclipse.osbp.ecview.extension.model.editor/src/org/eclipse/osbp/ecview/extension/model/presentation/YECviewModelWizard.java
@@ -108,7 +108,7 @@
* <!-- end-user-doc -->
* @generated
*/
- public static final String copyright = "All rights reserved by Loetz GmbH&Co.KG Heidelberg 2015.\n\nContributors:\n Florian Pirchner - initial API and implementation";
+ public static final String copyright = "All rights reserved by Loetz GmbH und CoKG Heidelberg 2015.\n\nContributors:\n Florian Pirchner - initial API and implementation";
/**
* The supported extensions for created files.
@@ -413,8 +413,7 @@
* @generated
*/
public void createControl(Composite parent) {
- Composite composite = new Composite(parent, SWT.NONE);
- {
+ Composite composite = new Composite(parent, SWT.NONE); {
GridLayout layout = new GridLayout();
layout.numColumns = 1;
layout.verticalSpacing = 12;
diff --git a/org.eclipse.osbp.ecview.extension.model.editor/src/org/eclipse/osbp/ecview/extension/model/presentation/ecviewEditorPlugin.java b/org.eclipse.osbp.ecview.extension.model.editor/src/org/eclipse/osbp/ecview/extension/model/presentation/ecviewEditorPlugin.java
index 12842a3..71e139d 100644
--- a/org.eclipse.osbp.ecview.extension.model.editor/src/org/eclipse/osbp/ecview/extension/model/presentation/ecviewEditorPlugin.java
+++ b/org.eclipse.osbp.ecview.extension.model.editor/src/org/eclipse/osbp/ecview/extension/model/presentation/ecviewEditorPlugin.java
@@ -37,7 +37,7 @@
* <!-- end-user-doc -->
* @generated
*/
- public static final String copyright = "All rights reserved by Loetz GmbH&Co.KG Heidelberg 2015.\n\nContributors:\n Florian Pirchner - initial API and implementation";
+ public static final String copyright = "All rights reserved by Loetz GmbH und CoKG Heidelberg 2015.\n\nContributors:\n Florian Pirchner - initial API and implementation";
/**
* Keep track of the singleton.
diff --git a/org.eclipse.osbp.ecview.extension.model.editor/src/org/eclipse/osbp/ecview/extension/model/visibility/presentation/YVisibilityActionBarContributor.java b/org.eclipse.osbp.ecview.extension.model.editor/src/org/eclipse/osbp/ecview/extension/model/visibility/presentation/YVisibilityActionBarContributor.java
index 31f1852..698f284 100644
--- a/org.eclipse.osbp.ecview.extension.model.editor/src/org/eclipse/osbp/ecview/extension/model/visibility/presentation/YVisibilityActionBarContributor.java
+++ b/org.eclipse.osbp.ecview.extension.model.editor/src/org/eclipse/osbp/ecview/extension/model/visibility/presentation/YVisibilityActionBarContributor.java
@@ -66,7 +66,7 @@
* <!-- end-user-doc -->
* @generated
*/
- public static final String copyright = "All rights reserved by Loetz GmbH&Co.KG Heidelberg 2015.\n\nContributors:\n Florian Pirchner - initial API and implementation";
+ public static final String copyright = "All rights reserved by Loetz GmbH und CoKG Heidelberg 2015.\n\nContributors:\n Florian Pirchner - initial API and implementation";
/**
* This keeps track of the active editor.
diff --git a/org.eclipse.osbp.ecview.extension.model.editor/src/org/eclipse/osbp/ecview/extension/model/visibility/presentation/YVisibilityEditor.java b/org.eclipse.osbp.ecview.extension.model.editor/src/org/eclipse/osbp/ecview/extension/model/visibility/presentation/YVisibilityEditor.java
index 9e5e18b..96684a7 100644
--- a/org.eclipse.osbp.ecview.extension.model.editor/src/org/eclipse/osbp/ecview/extension/model/visibility/presentation/YVisibilityEditor.java
+++ b/org.eclipse.osbp.ecview.extension.model.editor/src/org/eclipse/osbp/ecview/extension/model/visibility/presentation/YVisibilityEditor.java
@@ -208,7 +208,7 @@
* <!-- end-user-doc -->
* @generated
*/
- public static final String copyright = "All rights reserved by Loetz GmbH&Co.KG Heidelberg 2015.\n\nContributors:\n Florian Pirchner - initial API and implementation";
+ public static final String copyright = "All rights reserved by Loetz GmbH und CoKG Heidelberg 2015.\n\nContributors:\n Florian Pirchner - initial API and implementation";
/**
* This keeps track of the editing domain that is used to track all changes to the model.
@@ -1002,7 +1002,7 @@
* @generated
*/
public void createModel() {
- URI resourceURI = EditUIUtil.getURI(getEditorInput());
+ URI resourceURI = EditUIUtil.getURI(getEditorInput(), editingDomain.getResourceSet().getURIConverter());
Exception exception = null;
Resource resource = null;
try {
@@ -1030,10 +1030,11 @@
* @generated
*/
public Diagnostic analyzeResourceProblems(Resource resource, Exception exception) {
- if (!resource.getErrors().isEmpty() || !resource.getWarnings().isEmpty()) {
+ boolean hasErrors = !resource.getErrors().isEmpty();
+ if (hasErrors || !resource.getWarnings().isEmpty()) {
BasicDiagnostic basicDiagnostic =
new BasicDiagnostic
- (Diagnostic.ERROR,
+ (hasErrors ? Diagnostic.ERROR : Diagnostic.WARNING,
"org.eclipse.osbp.ecview.extension.model.editor",
0,
getString("_UI_CreateModelError_message", resource.getURI()),
diff --git a/org.eclipse.osbp.ecview.extension.model.editor/src/org/eclipse/osbp/ecview/extension/model/visibility/presentation/YVisibilityModelWizard.java b/org.eclipse.osbp.ecview.extension.model.editor/src/org/eclipse/osbp/ecview/extension/model/visibility/presentation/YVisibilityModelWizard.java
index d091a49..8f4e259 100644
--- a/org.eclipse.osbp.ecview.extension.model.editor/src/org/eclipse/osbp/ecview/extension/model/visibility/presentation/YVisibilityModelWizard.java
+++ b/org.eclipse.osbp.ecview.extension.model.editor/src/org/eclipse/osbp/ecview/extension/model/visibility/presentation/YVisibilityModelWizard.java
@@ -110,7 +110,7 @@
* <!-- end-user-doc -->
* @generated
*/
- public static final String copyright = "All rights reserved by Loetz GmbH&Co.KG Heidelberg 2015.\n\nContributors:\n Florian Pirchner - initial API and implementation";
+ public static final String copyright = "All rights reserved by Loetz GmbH und CoKG Heidelberg 2015.\n\nContributors:\n Florian Pirchner - initial API and implementation";
/**
* The supported extensions for created files.
@@ -415,8 +415,7 @@
* @generated
*/
public void createControl(Composite parent) {
- Composite composite = new Composite(parent, SWT.NONE);
- {
+ Composite composite = new Composite(parent, SWT.NONE); {
GridLayout layout = new GridLayout();
layout.numColumns = 1;
layout.verticalSpacing = 12;
diff --git a/org.eclipse.osbp.ecview.extension.presentation.vaadin.tests/.classpath b/org.eclipse.osbp.ecview.extension.presentation.vaadin.tests/.classpath
new file mode 100644
index 0000000..4ff52d4
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.presentation.vaadin.tests/.classpath
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="src" path="src-gen"/>
+ <classpathentry kind="output" path="target/classes"/>
+</classpath>
diff --git a/org.eclipse.osbp.ecview.extension.presentation.vaadin.tests/.gitignore b/org.eclipse.osbp.ecview.extension.presentation.vaadin.tests/.gitignore
new file mode 100644
index 0000000..b83d222
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.presentation.vaadin.tests/.gitignore
@@ -0,0 +1 @@
+/target/
diff --git a/org.eclipse.osbp.ecview.extension.presentation.vaadin.tests/.project b/org.eclipse.osbp.ecview.extension.presentation.vaadin.tests/.project
new file mode 100644
index 0000000..89d322a
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.presentation.vaadin.tests/.project
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.osbp.ecview.extension.presentation.vaadin.tests</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.xtext.ui.shared.xtextBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.babel.editor.rbeBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.m2e.core.maven2Builder</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>
diff --git a/org.eclipse.osbp.ecview.extension.presentation.vaadin.tests/.settings/org.eclipse.core.resources.prefs b/org.eclipse.osbp.ecview.extension.presentation.vaadin.tests/.settings/org.eclipse.core.resources.prefs
new file mode 100644
index 0000000..99f26c0
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.presentation.vaadin.tests/.settings/org.eclipse.core.resources.prefs
@@ -0,0 +1,2 @@
+eclipse.preferences.version=1
+encoding/<project>=UTF-8
diff --git a/org.eclipse.osbp.ecview.extension.presentation.vaadin.tests/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.osbp.ecview.extension.presentation.vaadin.tests/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 0000000..0c68a61
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.presentation.vaadin.tests/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,7 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+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.8
diff --git a/org.eclipse.osbp.ecview.extension.presentation.vaadin.tests/.settings/org.eclipse.m2e.core.prefs b/org.eclipse.osbp.ecview.extension.presentation.vaadin.tests/.settings/org.eclipse.m2e.core.prefs
new file mode 100644
index 0000000..f897a7f
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.presentation.vaadin.tests/.settings/org.eclipse.m2e.core.prefs
@@ -0,0 +1,4 @@
+activeProfiles=
+eclipse.preferences.version=1
+resolveWorkspaceProjects=true
+version=1
diff --git a/org.eclipse.osbp.ecview.extension.presentation.vaadin.tests/.settings/org.eclipse.pde.core.prefs b/org.eclipse.osbp.ecview.extension.presentation.vaadin.tests/.settings/org.eclipse.pde.core.prefs
new file mode 100644
index 0000000..f29e940
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.presentation.vaadin.tests/.settings/org.eclipse.pde.core.prefs
@@ -0,0 +1,3 @@
+eclipse.preferences.version=1
+pluginProject.extensions=false
+resolve.requirebundle=false
diff --git a/org.eclipse.osbp.ecview.extension.presentation.vaadin.tests/.settings/org.eclipse.xtend.core.Xtend.prefs b/org.eclipse.osbp.ecview.extension.presentation.vaadin.tests/.settings/org.eclipse.xtend.core.Xtend.prefs
new file mode 100644
index 0000000..0933f8c
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.presentation.vaadin.tests/.settings/org.eclipse.xtend.core.Xtend.prefs
@@ -0,0 +1,10 @@
+//outlet.DEFAULT_OUTPUT.sourceFolder.src/test/java.directory=src/test/generated-sources/xtend
+eclipse.preferences.version=1
+is_project_specific=true
+outlet.DEFAULT_OUTPUT.hideLocalSyntheticVariables=true
+outlet.DEFAULT_OUTPUT.installDslAsPrimarySource=false
+outlet.DEFAULT_OUTPUT.sourceFolder.emf-gen.directory=xtend-gen
+outlet.DEFAULT_OUTPUT.sourceFolder.src-gen.directory=xtend-gen
+outlet.DEFAULT_OUTPUT.sourceFolder.src.directory=xtend-gen
+outlet.DEFAULT_OUTPUT.sourceFolder.xtend-gen.directory=xtend-gen
+outlet.DEFAULT_OUTPUT.userOutputPerSourceFolder=true
diff --git a/org.eclipse.osbp.ecview.extension.presentation.vaadin.tests/LICENSE.txt b/org.eclipse.osbp.ecview.extension.presentation.vaadin.tests/LICENSE.txt
new file mode 100644
index 0000000..ff42ad4
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.presentation.vaadin.tests/LICENSE.txt
@@ -0,0 +1,161 @@
+Eclipse Public License -v 1.0
+
+THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION
+OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
+
+1. DEFINITIONS
+
+"Contribution" means:
+
+a) in the case of the initial Contributor, the initial code and documentation distributed under this Agreement, and
+
+b) in the case of each subsequent Contributor:
+
+i) changes to the Program, and
+
+ii) additions to the Program;
+
+where such changes and/or additions to the Program originate from and are distributed by that particular Contributor.
+A Contribution 'originates' from a Contributor if it was added to the Program by such Contributor itself or anyone
+acting on such Contributor's behalf. Contributions do not include additions to the Program which: (i) are separate
+modules of software distributed in conjunction with the Program under their own license agreement, and (ii) are not
+derivative works of the Program.
+
+"Contributor" means any person or entity that distributes the Program.
+
+"Licensed Patents " mean patent claims licensable by a Contributor which are necessarily infringed by the use or sale of
+its Contribution alone or when combined with the Program.
+
+"Program" means the Contributions distributed in accordance with this Agreement.
+
+"Recipient" means anyone who receives the Program under this Agreement, including all Contributors.
+
+2. GRANT OF RIGHTS
+
+a) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide,
+royalty-free copyright license to reproduce, prepare derivative works of, publicly display, publicly perform, distribute
+and sublicense the Contribution of such Contributor, if any, and such derivative works, in source code and object code
+form.
+
+b) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide,
+royalty-free patent license under Licensed Patents to make, use, sell, offer to sell, import and otherwise transfer the
+Contribution of such Contributor, if any, in source code and object code form. This patent license shall apply to the
+combination of the Contribution and the Program if, at the time the Contribution is added by the Contributor, such
+addition of the Contribution causes such combination to be covered by the Licensed Patents. The patent license shall not
+apply to any other combinations which include the Contribution. No hardware per se is licensed hereunder.
+
+c) Recipient understands that although each Contributor grants the licenses to its Contributions set forth herein, no
+assurances are provided by any Contributor that the Program does not infringe the patent or other intellectual property
+rights of any other entity. Each Contributor disclaims any liability to Recipient for claims brought by any other entity
+based on infringement of intellectual property rights or otherwise. As a condition to exercising the rights and
+licenses granted hereunder, each Recipient hereby assumes sole responsibility to secure any other intellectual property
+rights needed, if any. For example, if a third party patent license is required to allow Recipient to distribute the
+Program, it is Recipient's responsibility to acquire that license before distributing the Program.
+
+d) Each Contributor represents that to its knowledge it has sufficient copyright rights in its Contribution, if any, to
+grant the copyright license set forth in this Agreement.
+
+3. REQUIREMENTS
+
+A Contributor may choose to distribute the Program in object code form under its own license agreement, provided that:
+
+a) it complies with the terms and conditions of this Agreement; and
+
+b) its license agreement:
+
+i) effectively disclaims on behalf of all Contributors all warranties and conditions, express and implied, including
+warranties or conditions of title and non-infringement, and implied warranties or conditions of merchantability and
+fitness for a particular purpose;
+
+ii) effectively excludes on behalf of all Contributors all liability for damages, including direct, indirect, special,
+incidental and consequential damages, such as lost profits;
+
+iii) states that any provisions which differ from this Agreement are offered by that Contributor alone and not by any
+other party; and
+
+iv) states that source code for the Program is available from such Contributor, and informs licensees how to obtain it
+in a reasonable manner on or through a medium customarily used for software exchange.
+
+When the Program is made available in source code form:
+
+a) it must be made available under this Agreement; and
+
+b) a copy of this Agreement must be included with each copy of the Program.
+
+Contributors may not remove or alter any copyright notices contained within the Program.
+
+Each Contributor must identify itself as the originator of its Contribution, if any, in a manner that reasonably allows
+subsequent Recipients to identify the originator of the Contribution.
+
+4. COMMERCIAL DISTRIBUTION
+
+Commercial distributors of software may accept certain responsibilities with respect to end users, business partners and
+the like. While this license is intended to facilitate the commercial use of the Program, the Contributor who includes
+the Program in a commercial product offering should do so in a manner which does not create potential liability for
+other Contributors. Therefore, if a Contributor includes the Program in a commercial product offering, such Contributor
+("Commercial Contributor") hereby agrees to defend and indemnify every other Contributor ("Indemnified Contributor")
+against any losses, damages and costs (collectively "Losses") arising from claims, lawsuits and other legal actions
+brought by a third party against the Indemnified Contributor to the extent caused by the acts or omissions of such
+Commercial Contributor in connection with its distribution of the Program in a commercial product offering. The
+obligations in this section do not apply to any claims or Losses relating to any actual or alleged intellectual
+property infringement. In order to qualify, an Indemnified Contributor must: a) promptly notify the Commercial
+Contributor in writing of such claim, and b) allow the Commercial Contributor to control, and cooperate with the
+Commercial Contributor in, the defense and any related settlement negotiations. The Indemnified Contributor may
+ participate in any such claim at its own expense.
+
+For example, a Contributor might include the Program in a commercial product offering, Product X. That Contributor is
+then a Commercial Contributor. If that Commercial Contributor then makes performance claims, or offers warranties
+related to Product X, those performance claims and warranties are such Commercial Contributor's responsibility alone.
+Under this section, the Commercial Contributor would have to defend claims against the other Contributors related to
+those performance claims and warranties, and if a court requires any other Contributor to pay any damages as a result,
+the Commercial Contributor must pay those damages.
+
+5. NO WARRANTY
+
+EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR
+CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE,
+NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely responsible for
+determining the appropriateness of using and distributing the Program and assumes all risks associated with its
+exercise of rights under this Agreement , including but not limited to the risks and costs of program errors, compliance
+with applicable laws, damage to or loss of data, programs or equipment, and unavailability or interruption of operations.
+
+6. DISCLAIMER OF LIABILITY
+
+EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY
+DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS),
+HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED
+HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
+7. GENERAL
+
+If any provision of this Agreement is invalid or unenforceable under applicable law, it shall not affect the validity or
+enforceability of the remainder of the terms of this Agreement, and without further action by the parties hereto, such
+provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable.
+
+If Recipient institutes patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit)
+alleging that the Program itself (excluding combinations of the Program with other software or hardware) infringes such
+Recipient's patent(s), then such Recipient's rights granted under Section 2(b) shall terminate as of the date such
+litigation is filed.
+
+All Recipient's rights under this Agreement shall terminate if it fails to comply with any of the material terms or
+conditions of this Agreement and does not cure such failure in a reasonable period of time after becoming aware of such
+noncompliance. If all Recipient's rights under this Agreement terminate, Recipient agrees to cease use and distribution
+of the Program as soon as reasonably practicable. However, Recipient's obligations under this Agreement and any licenses
+ granted by Recipient relating to the Program shall continue and survive.
+
+Everyone is permitted to copy and distribute copies of this Agreement, but in order to avoid inconsistency the Agreement
+is copyrighted and may only be modified in the following manner. The Agreement Steward reserves the right to publish
+new versions (including revisions) of this Agreement from time to time. No one other than the Agreement Steward has the
+right to modify this Agreement. The Eclipse Foundation is the initial Agreement Steward. The Eclipse Foundation may
+assign the responsibility to serve as the Agreement Steward to a suitable separate entity. Each new version of the
+Agreement will be given a distinguishing version number. The Program (including Contributions) may always be
+distributed subject to the version of the Agreement under which it was received. In addition, after a new version of
+the Agreement is published, Contributor may elect to distribute the Program (including its Contributions) under the
+new version. Except as expressly stated in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to
+the intellectual property of any Contributor under this Agreement, whether expressly, by implication, estoppel or
+otherwise. All rights in the Program not expressly granted under this Agreement are reserved.
+
+This Agreement is governed by the laws of the State of New York and the intellectual property laws of the United States
+of America. No party to this Agreement will bring a legal action under this Agreement more than one year after the cause
+of action arose. Each party waives its rights to a jury trial in any resulting litigation.
\ No newline at end of file
diff --git a/org.eclipse.osbp.ecview.extension.presentation.vaadin.tests/META-INF/MANIFEST.MF b/org.eclipse.osbp.ecview.extension.presentation.vaadin.tests/META-INF/MANIFEST.MF
new file mode 100644
index 0000000..d050c0e
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.presentation.vaadin.tests/META-INF/MANIFEST.MF
@@ -0,0 +1,59 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: org.eclipse.osbp.ecview.extension.presentation.vaadin.tests
+Bundle-SymbolicName: org.eclipse.osbp.ecview.extension.presentation.vaadin.tests
+Bundle-Vendor: Eclipse OSBP
+Bundle-Version: 0.9.0.qualifier
+Bundle-Activator: org.eclipse.osbp.ecview.extension.presentation.tests.Activator
+Bundle-RequiredExecutionEnvironment: JavaSE-1.8
+Import-Package: org.eclipse.osbp.ecview.extension.editparts.components;version="0.9.0",
+ org.osgi.framework;version="1.3.0",
+ org.osgi.service.cm;version="1.5.0"
+Bundle-ActivationPolicy: lazy
+Require-Bundle: org.junit;bundle-version="4.10.0",
+ org.knowhowlab.osgi.testing.assertions;bundle-version="[1.3.0,1.3.1)",
+ org.knowhowlab.osgi.testing.utils;bundle-version="[1.2.2,1.2.3)",
+ com.vaadin.shared;bundle-version="[7.7.6,7.8.0)",
+ com.vaadin.server;bundle-version="[7.7.6,7.8.0)",
+ org.eclipse.osbp.runtime.web.vaadin.common;bundle-version="[0.9.0,0.10.0)",
+ org.eclipse.osbp.runtime.web.ecview.presentation.vaadin;bundle-version="[0.9.0,0.10.0)",
+ org.eclipse.osbp.runtime.web.vaadin.databinding;bundle-version="[0.9.0,0.10.0)",
+ org.eclipse.osbp.runtime.web.vaadin.components;bundle-version="[0.9.0,0.10.0)",
+ org.eclipse.emf.databinding;bundle-version="1.3.0",
+ org.eclipse.core.runtime,
+ org.eclipse.emf.ecore;visibility:=reexport,
+ org.eclipse.osbp.ecview.core.common;bundle-version="[0.9.0,0.10.0)",
+ org.eclipse.osbp.ecview.core.common.editparts.emf;bundle-version="[0.9.0,0.10.0)",
+ org.eclipse.osbp.ecview.core.common.model;bundle-version="[0.9.0,0.10.0)",
+ org.eclipse.osbp.ecview.core.databinding.beans;bundle-version="[0.9.0,0.10.0)",
+ org.eclipse.osbp.ecview.core.databinding.emf;bundle-version="[0.9.0,0.10.0)",
+ org.eclipse.osbp.ecview.core.extension.editparts.emf;bundle-version="[0.9.0,0.10.0)",
+ org.eclipse.osbp.ecview.core.ui.presentation.common;bundle-version="[0.9.0,0.10.0)",
+ org.eclipse.osbp.ecview.core.util.emf;bundle-version="[0.9.0,0.10.0)",
+ org.eclipse.osbp.runtime.common;bundle-version="[0.9.0,0.10.0)",
+ org.jsoup;bundle-version="1.7.2",
+ org.eclipse.osbp.runtime.web.vaadin.components.widget;bundle-version="[0.9.0,0.10.0)",
+ org.eclipse.osbp.ecview.extension.presentation.vaadin;bundle-version="[0.9.0,0.10.0)",
+ org.eclipse.osbp.ecview.extension.model;bundle-version="[0.9.0,0.10.0)",
+ javax.servlet;bundle-version="3.0.0",
+ org.eclipse.osbp.utils.functionnormalizer;bundle-version="[0.9.0,0.10.0)",
+ org.eclipse.osbp.xtext.i18n;bundle-version="[0.9.0,0.10.0)",
+ org.slf4j.api;bundle-version="1.7.2",
+ com.google.guava;bundle-version="18.0.0",
+ org.eclipse.osbp.ecview.extension.api;bundle-version="[0.9.0,0.10.0)",
+ org.eclipse.osbp.xtext.functionlibrary.common.api;bundle-version="[0.9.0,0.10.0)",
+ org.eclipse.osbp.ecview.extension.editparts;bundle-version="[0.9.0,0.10.0)",
+ org.eclipse.osbp.ecview.extension.editparts.emf;bundle-version="[0.9.0,0.10.0)",
+ org.eclipse.osbp.ecview.extension.services;bundle-version="[0.9.0,0.10.0)",
+ org.eclipse.osbp.ecview.extension.strategy;bundle-version="[0.9.0,0.10.0)",
+ org.eclipse.osbp.dsl.datatype.lib;bundle-version="[0.9.0,0.10.0)",
+ org.eclipse.osbp.dsl.dto.lib;bundle-version="[0.9.0,0.10.0)",
+ javax.validation.api;bundle-version="1.1.0",
+ javax.persistence;bundle-version="2.1.0",
+ org.eclipse.xtext.xbase.lib;bundle-version="[2.11.0,2.12.0)",
+ org.eclipse.equinox.ds;bundle-version="1.4.200",
+ org.eclipse.osbp.runtime.event;bundle-version="[0.9.0,0.10.0)",
+ org.eclipse.equinox.event;bundle-version="1.3.100",
+ org.eclipse.osbp.xtext.functionlibrarydsl.provider;bundle-version="[0.9.0,0.10.0)",
+ org.eclipse.osbp.runtime.designer.api;bundle-version="[0.9.0,0.10.0)"
+
diff --git a/org.eclipse.osbp.ecview.extension.presentation.vaadin.tests/about.html b/org.eclipse.osbp.ecview.extension.presentation.vaadin.tests/about.html
new file mode 100644
index 0000000..64c0598
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.presentation.vaadin.tests/about.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
+<title>About</title>
+</head>
+<body lang="EN-US">
+<h2>About This Content</h2>
+
+<p>June 1, 2016</p>
+<h3>License</h3>
+
+<p>The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise
+indicated below, the Content is provided to you under the terms and conditions of the
+Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available
+at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
+For purposes of the EPL, "Program" will mean the Content.</p>
+
+<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
+being redistributed by another party ("Redistributor") and different terms and conditions may
+apply to your use of any object code in the Content. Check the Redistributor's license that was
+provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
+indicated below, the terms and conditions of the EPL still apply to any source code in the Content
+and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/org.eclipse.osbp.ecview.extension.presentation.vaadin.tests/about.ini b/org.eclipse.osbp.ecview.extension.presentation.vaadin.tests/about.ini
new file mode 100644
index 0000000..7df671f
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.presentation.vaadin.tests/about.ini
@@ -0,0 +1,17 @@
+# about.ini
+# contains information about a feature
+# java.io.Properties file (ISO 8859-1 with "\" escapes)
+# "%key" are externalized strings defined in about.properties
+# This file does not need to be translated.
+
+# Property "aboutText" contains blurb for "About" dialog (translated)
+aboutText=%featureText
+
+# Property "featureImage" contains path to feature image (32x32)
+featureImage=
+
+# Property "appName" contains name of the application (translated)
+appName=%featureName
+
+# Property "welcomePage" contains path to welcome page (special XML-based format)
+welcomePage=
diff --git a/org.eclipse.osbp.ecview.extension.presentation.vaadin.tests/about.mappings b/org.eclipse.osbp.ecview.extension.presentation.vaadin.tests/about.mappings
new file mode 100644
index 0000000..4511a0a
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.presentation.vaadin.tests/about.mappings
@@ -0,0 +1,6 @@
+# about.mappings
+# contains fill-ins for about.properties
+# java.io.Properties file (ISO 8859-1 with "\" escapes)
+# This file does not need to be translated.
+
+0=qualifier
diff --git a/org.eclipse.osbp.ecview.extension.presentation.vaadin.tests/about.properties b/org.eclipse.osbp.ecview.extension.presentation.vaadin.tests/about.properties
new file mode 100644
index 0000000..6303d83
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.presentation.vaadin.tests/about.properties
@@ -0,0 +1,26 @@
+#
+# Copyright (c) 2012, 2016 - Loetz GmbH&Co.KG (Heidelberg)
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Loetz GmbH&Co.KG - initial API and implementation
+#
+
+# NLS_MESSAGEFORMAT_VAR
+
+featureName=org.eclipse.osbp.ecview.extension.presentation.vaadin.tests
+
+################ blurb property ####################################
+featureText=\
+Copyright (c) 2012-2016 - Loetz GmbH&Co.KG \n\
+All rights reserved. This program and the accompanying materials\n\
+are made available under the terms of the Eclipse Public License v1.0\n\
+which accompanies this distribution, and is available at\n\
+http://www.eclipse.org/legal/epl-v10.html\n\
+\n\
+Contributors:\n\
+ Loetz GmbH&Co.KG - implementation\n
+################ end of blurb property ####################################
diff --git a/org.eclipse.osbp.ecview.extension.presentation.vaadin.tests/build.properties b/org.eclipse.osbp.ecview.extension.presentation.vaadin.tests/build.properties
new file mode 100644
index 0000000..ed1f977
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.presentation.vaadin.tests/build.properties
@@ -0,0 +1,4 @@
+source.. = src/
+output.. = bin/
+bin.includes = about.properties, about.mappings, about.ini, about.html, META-INF/,\
+ .
diff --git a/org.eclipse.osbp.ecview.extension.presentation.vaadin.tests/dto/dtos.dtos b/org.eclipse.osbp.ecview.extension.presentation.vaadin.tests/dto/dtos.dtos
new file mode 100644
index 0000000..e5c0aee
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.presentation.vaadin.tests/dto/dtos.dtos
@@ -0,0 +1,25 @@
+/**
+ * Copyright (c) 2011, 2016 - Loetz GmbH&Co.KG (69115 Heidelberg, Germany)
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Florian Pirchner - Initial implementation
+ */
+package de.compex.ecview.^extension.tests.dtos {
+
+ datatype String jvmType String;
+ datatype int jvmType Integer as primitive;
+ datatype Date jvmType Date;
+
+ dto Person {
+ uuid String name;
+ var String name2;
+ var int age;
+ var Date birthday;
+ }
+
+}
\ No newline at end of file
diff --git a/org.eclipse.osbp.ecview.extension.presentation.vaadin.tests/epl-v10.html b/org.eclipse.osbp.ecview.extension.presentation.vaadin.tests/epl-v10.html
new file mode 100644
index 0000000..b398acc
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.presentation.vaadin.tests/epl-v10.html
@@ -0,0 +1,259 @@
+<!--?xml version="1.0" encoding="ISO-8859-1" ?-->
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"><head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Eclipse Public License - Version 1.0</title>
+<style type="text/css">
+ body {
+ size: 8.5in 11.0in;
+ margin: 0.25in 0.5in 0.25in 0.5in;
+ tab-interval: 0.5in;
+ }
+ p {
+ margin-left: auto;
+ margin-top: 0.5em;
+ margin-bottom: 0.5em;
+ }
+ p.list {
+ margin-left: 0.5in;
+ margin-top: 0.05em;
+ margin-bottom: 0.05em;
+ }
+ </style>
+
+</head>
+
+<body lang="EN-US">
+
+<h2>Eclipse Public License - v 1.0</h2>
+
+<p>THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE
+PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR
+DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS
+AGREEMENT.</p>
+
+<p><b>1. DEFINITIONS</b></p>
+
+<p>"Contribution" means:</p>
+
+<p class="list">a) in the case of the initial Contributor, the initial
+code and documentation distributed under this Agreement, and</p>
+<p class="list">b) in the case of each subsequent Contributor:</p>
+<p class="list">i) changes to the Program, and</p>
+<p class="list">ii) additions to the Program;</p>
+<p class="list">where such changes and/or additions to the Program
+originate from and are distributed by that particular Contributor. A
+Contribution 'originates' from a Contributor if it was added to the
+Program by such Contributor itself or anyone acting on such
+Contributor's behalf. Contributions do not include additions to the
+Program which: (i) are separate modules of software distributed in
+conjunction with the Program under their own license agreement, and (ii)
+are not derivative works of the Program.</p>
+
+<p>"Contributor" means any person or entity that distributes
+the Program.</p>
+
+<p>"Licensed Patents" mean patent claims licensable by a
+Contributor which are necessarily infringed by the use or sale of its
+Contribution alone or when combined with the Program.</p>
+
+<p>"Program" means the Contributions distributed in accordance
+with this Agreement.</p>
+
+<p>"Recipient" means anyone who receives the Program under
+this Agreement, including all Contributors.</p>
+
+<p><b>2. GRANT OF RIGHTS</b></p>
+
+<p class="list">a) Subject to the terms of this Agreement, each
+Contributor hereby grants Recipient a non-exclusive, worldwide,
+royalty-free copyright license to reproduce, prepare derivative works
+of, publicly display, publicly perform, distribute and sublicense the
+Contribution of such Contributor, if any, and such derivative works, in
+source code and object code form.</p>
+
+<p class="list">b) Subject to the terms of this Agreement, each
+Contributor hereby grants Recipient a non-exclusive, worldwide,
+royalty-free patent license under Licensed Patents to make, use, sell,
+offer to sell, import and otherwise transfer the Contribution of such
+Contributor, if any, in source code and object code form. This patent
+license shall apply to the combination of the Contribution and the
+Program if, at the time the Contribution is added by the Contributor,
+such addition of the Contribution causes such combination to be covered
+by the Licensed Patents. The patent license shall not apply to any other
+combinations which include the Contribution. No hardware per se is
+licensed hereunder.</p>
+
+<p class="list">c) Recipient understands that although each Contributor
+grants the licenses to its Contributions set forth herein, no assurances
+are provided by any Contributor that the Program does not infringe the
+patent or other intellectual property rights of any other entity. Each
+Contributor disclaims any liability to Recipient for claims brought by
+any other entity based on infringement of intellectual property rights
+or otherwise. As a condition to exercising the rights and licenses
+granted hereunder, each Recipient hereby assumes sole responsibility to
+secure any other intellectual property rights needed, if any. For
+example, if a third party patent license is required to allow Recipient
+to distribute the Program, it is Recipient's responsibility to acquire
+that license before distributing the Program.</p>
+
+<p class="list">d) Each Contributor represents that to its knowledge it
+has sufficient copyright rights in its Contribution, if any, to grant
+the copyright license set forth in this Agreement.</p>
+
+<p><b>3. REQUIREMENTS</b></p>
+
+<p>A Contributor may choose to distribute the Program in object code
+form under its own license agreement, provided that:</p>
+
+<p class="list">a) it complies with the terms and conditions of this
+Agreement; and</p>
+
+<p class="list">b) its license agreement:</p>
+
+<p class="list">i) effectively disclaims on behalf of all Contributors
+all warranties and conditions, express and implied, including warranties
+or conditions of title and non-infringement, and implied warranties or
+conditions of merchantability and fitness for a particular purpose;</p>
+
+<p class="list">ii) effectively excludes on behalf of all Contributors
+all liability for damages, including direct, indirect, special,
+incidental and consequential damages, such as lost profits;</p>
+
+<p class="list">iii) states that any provisions which differ from this
+Agreement are offered by that Contributor alone and not by any other
+party; and</p>
+
+<p class="list">iv) states that source code for the Program is available
+from such Contributor, and informs licensees how to obtain it in a
+reasonable manner on or through a medium customarily used for software
+exchange.</p>
+
+<p>When the Program is made available in source code form:</p>
+
+<p class="list">a) it must be made available under this Agreement; and</p>
+
+<p class="list">b) a copy of this Agreement must be included with each
+copy of the Program.</p>
+
+<p>Contributors may not remove or alter any copyright notices contained
+within the Program.</p>
+
+<p>Each Contributor must identify itself as the originator of its
+Contribution, if any, in a manner that reasonably allows subsequent
+Recipients to identify the originator of the Contribution.</p>
+
+<p><b>4. COMMERCIAL DISTRIBUTION</b></p>
+
+<p>Commercial distributors of software may accept certain
+responsibilities with respect to end users, business partners and the
+like. While this license is intended to facilitate the commercial use of
+the Program, the Contributor who includes the Program in a commercial
+product offering should do so in a manner which does not create
+potential liability for other Contributors. Therefore, if a Contributor
+includes the Program in a commercial product offering, such Contributor
+("Commercial Contributor") hereby agrees to defend and
+indemnify every other Contributor ("Indemnified Contributor")
+against any losses, damages and costs (collectively "Losses")
+arising from claims, lawsuits and other legal actions brought by a third
+party against the Indemnified Contributor to the extent caused by the
+acts or omissions of such Commercial Contributor in connection with its
+distribution of the Program in a commercial product offering. The
+obligations in this section do not apply to any claims or Losses
+relating to any actual or alleged intellectual property infringement. In
+order to qualify, an Indemnified Contributor must: a) promptly notify
+the Commercial Contributor in writing of such claim, and b) allow the
+Commercial Contributor to control, and cooperate with the Commercial
+Contributor in, the defense and any related settlement negotiations. The
+Indemnified Contributor may participate in any such claim at its own
+expense.</p>
+
+<p>For example, a Contributor might include the Program in a commercial
+product offering, Product X. That Contributor is then a Commercial
+Contributor. If that Commercial Contributor then makes performance
+claims, or offers warranties related to Product X, those performance
+claims and warranties are such Commercial Contributor's responsibility
+alone. Under this section, the Commercial Contributor would have to
+defend claims against the other Contributors related to those
+performance claims and warranties, and if a court requires any other
+Contributor to pay any damages as a result, the Commercial Contributor
+must pay those damages.</p>
+
+<p><b>5. NO WARRANTY</b></p>
+
+<p>EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS
+PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
+OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION,
+ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY
+OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely
+responsible for determining the appropriateness of using and
+distributing the Program and assumes all risks associated with its
+exercise of rights under this Agreement , including but not limited to
+the risks and costs of program errors, compliance with applicable laws,
+damage to or loss of data, programs or equipment, and unavailability or
+interruption of operations.</p>
+
+<p><b>6. DISCLAIMER OF LIABILITY</b></p>
+
+<p>EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT
+NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT,
+INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING
+WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF
+LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR
+DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED
+HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.</p>
+
+<p><b>7. GENERAL</b></p>
+
+<p>If any provision of this Agreement is invalid or unenforceable under
+applicable law, it shall not affect the validity or enforceability of
+the remainder of the terms of this Agreement, and without further action
+by the parties hereto, such provision shall be reformed to the minimum
+extent necessary to make such provision valid and enforceable.</p>
+
+<p>If Recipient institutes patent litigation against any entity
+(including a cross-claim or counterclaim in a lawsuit) alleging that the
+Program itself (excluding combinations of the Program with other
+software or hardware) infringes such Recipient's patent(s), then such
+Recipient's rights granted under Section 2(b) shall terminate as of the
+date such litigation is filed.</p>
+
+<p>All Recipient's rights under this Agreement shall terminate if it
+fails to comply with any of the material terms or conditions of this
+Agreement and does not cure such failure in a reasonable period of time
+after becoming aware of such noncompliance. If all Recipient's rights
+under this Agreement terminate, Recipient agrees to cease use and
+distribution of the Program as soon as reasonably practicable. However,
+Recipient's obligations under this Agreement and any licenses granted by
+Recipient relating to the Program shall continue and survive.</p>
+
+<p>Everyone is permitted to copy and distribute copies of this
+Agreement, but in order to avoid inconsistency the Agreement is
+copyrighted and may only be modified in the following manner. The
+Agreement Steward reserves the right to publish new versions (including
+revisions) of this Agreement from time to time. No one other than the
+Agreement Steward has the right to modify this Agreement. The Eclipse
+Foundation is the initial Agreement Steward. The Eclipse Foundation may
+assign the responsibility to serve as the Agreement Steward to a
+suitable separate entity. Each new version of the Agreement will be
+given a distinguishing version number. The Program (including
+Contributions) may always be distributed subject to the version of the
+Agreement under which it was received. In addition, after a new version
+of the Agreement is published, Contributor may elect to distribute the
+Program (including its Contributions) under the new version. Except as
+expressly stated in Sections 2(a) and 2(b) above, Recipient receives no
+rights or licenses to the intellectual property of any Contributor under
+this Agreement, whether expressly, by implication, estoppel or
+otherwise. All rights in the Program not expressly granted under this
+Agreement are reserved.</p>
+
+<p>This Agreement is governed by the laws of the State of New York and
+the intellectual property laws of the United States of America. No party
+to this Agreement will bring a legal action under this Agreement more
+than one year after the cause of action arose. Each party waives its
+rights to a jury trial in any resulting litigation.</p>
+
+
+
+</body></html>
\ No newline at end of file
diff --git a/org.eclipse.osbp.ecview.extension.presentation.vaadin.tests/i18n/I18N.properties b/org.eclipse.osbp.ecview.extension.presentation.vaadin.tests/i18n/I18N.properties
new file mode 100644
index 0000000..bb772da
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.presentation.vaadin.tests/i18n/I18N.properties
@@ -0,0 +1 @@
+#default
diff --git a/org.eclipse.osbp.ecview.extension.presentation.vaadin.tests/i18n/I18N_de.properties b/org.eclipse.osbp.ecview.extension.presentation.vaadin.tests/i18n/I18N_de.properties
new file mode 100644
index 0000000..af6fdef
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.presentation.vaadin.tests/i18n/I18N_de.properties
@@ -0,0 +1 @@
+#de
diff --git a/org.eclipse.osbp.ecview.extension.presentation.vaadin.tests/i18n/I18N_de_AT.properties b/org.eclipse.osbp.ecview.extension.presentation.vaadin.tests/i18n/I18N_de_AT.properties
new file mode 100644
index 0000000..6c73e1d
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.presentation.vaadin.tests/i18n/I18N_de_AT.properties
@@ -0,0 +1 @@
+#de_AT
diff --git a/org.eclipse.osbp.ecview.extension.presentation.vaadin.tests/i18n/I18N_en.properties b/org.eclipse.osbp.ecview.extension.presentation.vaadin.tests/i18n/I18N_en.properties
new file mode 100644
index 0000000..45dd805
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.presentation.vaadin.tests/i18n/I18N_en.properties
@@ -0,0 +1 @@
+#en
diff --git a/org.eclipse.osbp.ecview.extension.presentation.vaadin.tests/i18n/I18N_en_US.properties b/org.eclipse.osbp.ecview.extension.presentation.vaadin.tests/i18n/I18N_en_US.properties
new file mode 100644
index 0000000..d89e21c
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.presentation.vaadin.tests/i18n/I18N_en_US.properties
@@ -0,0 +1 @@
+#en_US
diff --git a/org.eclipse.osbp.ecview.extension.presentation.vaadin.tests/i18n/I18N_fr.properties b/org.eclipse.osbp.ecview.extension.presentation.vaadin.tests/i18n/I18N_fr.properties
new file mode 100644
index 0000000..a84da83
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.presentation.vaadin.tests/i18n/I18N_fr.properties
@@ -0,0 +1 @@
+#fr
diff --git a/org.eclipse.osbp.ecview.extension.presentation.vaadin.tests/license.html b/org.eclipse.osbp.ecview.extension.presentation.vaadin.tests/license.html
new file mode 100644
index 0000000..6e579a5
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.presentation.vaadin.tests/license.html
@@ -0,0 +1,164 @@
+<!--?xml version="1.0" encoding="ISO-8859-1" ?-->
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"><head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Eclipse Foundation Software User Agreement</title>
+</head>
+
+<body lang="EN-US">
+<h2>Eclipse Foundation Software User Agreement</h2>
+<p>February 1, 2011</p>
+
+<h3>Usage Of Content</h3>
+
+<p>THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR OTHER MATERIALS FOR OPEN SOURCE PROJECTS
+ (COLLECTIVELY "CONTENT"). USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS AGREEMENT AND/OR THE TERMS AND
+ CONDITIONS OF LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU AGREE THAT YOUR USE
+ OF THE CONTENT IS GOVERNED BY THIS AGREEMENT AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR
+ NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND
+ CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW, THEN YOU MAY NOT USE THE CONTENT.</p>
+
+<h3>Applicable Licenses</h3>
+
+<p>Unless otherwise indicated, all Content made available by the Eclipse
+ Foundation is provided to you under the terms and conditions of the
+Eclipse Public License Version 1.0
+ ("EPL"). A copy of the EPL is provided with this Content and is also
+ available at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
+ For purposes of the EPL, "Program" will mean the Content.</p>
+
+<p>Content includes, but is not limited to, source code, object code,
+documentation and other files maintained in the Eclipse Foundation
+source code
+ repository ("Repository") in software modules ("Modules") and made
+available as downloadable archives ("Downloads").</p>
+
+<ul>
+ <li>Content may be structured and packaged into modules to
+facilitate delivering, extending, and upgrading the Content. Typical
+modules may include plug-ins ("Plug-ins"), plug-in fragments
+("Fragments"), and features ("Features").</li>
+ <li>Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java™ ARchive) in a directory named "plugins".</li>
+ <li>A Feature is a bundle of one or more Plug-ins and/or
+Fragments and associated material. Each Feature may be packaged as a
+sub-directory in a directory named "features". Within a Feature, files
+named "feature.xml" may contain a list of the names and version numbers
+of the Plug-ins
+ and/or Fragments associated with that Feature.</li>
+ <li>Features may also include other Features ("Included
+Features"). Within a Feature, files named "feature.xml" may contain a
+list of the names and version numbers of Included Features.</li>
+</ul>
+
+<p>The terms and conditions governing Plug-ins and Fragments should be
+contained in files named "about.html" ("Abouts"). The terms and
+conditions governing Features and
+Included Features should be contained in files named "license.html"
+("Feature Licenses"). Abouts and Feature Licenses may be located in any
+ directory of a Download or Module
+including, but not limited to the following locations:</p>
+
+<ul>
+ <li>The top-level (root) directory</li>
+ <li>Plug-in and Fragment directories</li>
+ <li>Inside Plug-ins and Fragments packaged as JARs</li>
+ <li>Sub-directories of the directory named "src" of certain Plug-ins</li>
+ <li>Feature directories</li>
+</ul>
+
+<p>Note: if a Feature made available by the Eclipse Foundation is
+installed using the Provisioning Technology (as defined below), you must
+ agree to a license ("Feature Update License") during the
+installation process. If the Feature contains Included Features, the
+Feature Update License should either provide you with the terms and
+conditions governing the Included Features or
+inform you where you can locate them. Feature Update Licenses may be
+found in the "license" property of files named "feature.properties"
+found within a Feature.
+Such Abouts, Feature Licenses, and Feature Update Licenses contain the
+terms and conditions (or references to such terms and conditions) that
+govern your use of the associated Content in
+that directory.</p>
+
+<p>THE ABOUTS, FEATURE LICENSES, AND FEATURE UPDATE LICENSES MAY REFER
+TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS.
+ SOME OF THESE
+OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):</p>
+
+<ul>
+ <li>Eclipse Distribution License Version 1.0 (available at <a href="http://www.eclipse.org/licenses/edl-v10.html">http://www.eclipse.org/licenses/edl-v1.0.html</a>)</li>
+ <li>Common Public License Version 1.0 (available at <a href="http://www.eclipse.org/legal/cpl-v10.html">http://www.eclipse.org/legal/cpl-v10.html</a>)</li>
+ <li>Apache Software License 1.1 (available at <a href="http://www.apache.org/licenses/LICENSE">http://www.apache.org/licenses/LICENSE</a>)</li>
+ <li>Apache Software License 2.0 (available at <a href="http://www.apache.org/licenses/LICENSE-2.0">http://www.apache.org/licenses/LICENSE-2.0</a>)</li>
+ <li>Metro Link Public License 1.00 (available at <a href="http://www.opengroup.org/openmotif/supporters/metrolink/license.html">http://www.opengroup.org/openmotif/supporters/metrolink/license.html</a>)</li>
+ <li>Mozilla Public License Version 1.1 (available at <a href="http://www.mozilla.org/MPL/MPL-1.1.html">http://www.mozilla.org/MPL/MPL-1.1.html</a>)</li>
+</ul>
+
+<p>IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND
+CONDITIONS PRIOR TO USE OF THE CONTENT. If no About, Feature License,
+or Feature Update License is provided, please
+contact the Eclipse Foundation to determine what terms and conditions
+govern that particular Content.</p>
+
+
+<h3>Use of Provisioning Technology</h3>
+
+<p>The Eclipse Foundation makes available provisioning software,
+examples of which include, but are not limited to, p2 and the Eclipse
+ Update Manager ("Provisioning Technology") for the purpose of
+allowing users to install software, documentation, information and/or
+ other materials (collectively "Installable Software"). This
+capability is provided with the intent of allowing such users to
+ install, extend and update Eclipse-based products. Information about
+packaging Installable Software is available at <a href="http://eclipse.org/equinox/p2/repository_packaging.html">http://eclipse.org/equinox/p2/repository_packaging.html</a>
+ ("Specification").</p>
+
+<p>You may use Provisioning Technology to allow other parties to install
+ Installable Software. You shall be responsible for enabling the
+ applicable license agreements relating to the Installable Software to
+ be presented to, and accepted by, the users of the Provisioning
+Technology
+ in accordance with the Specification. By using Provisioning
+Technology in such a manner and making it available in accordance with
+the
+ Specification, you further acknowledge your agreement to, and the
+acquisition of all necessary rights to permit the following:</p>
+
+<ol>
+ <li>A series of actions may occur ("Provisioning Process") in
+which a user may execute the Provisioning Technology
+ on a machine ("Target Machine") with the intent of installing,
+extending or updating the functionality of an Eclipse-based
+ product.</li>
+ <li>During the Provisioning Process, the Provisioning Technology
+may cause third party Installable Software or a portion thereof to be
+ accessed and copied to the Target Machine.</li>
+ <li>Pursuant to the Specification, you will provide to the user
+the terms and conditions that govern the use of the Installable
+ Software ("Installable Software Agreement") and such Installable
+Software Agreement shall be accessed from the Target
+ Machine in accordance with the Specification. Such Installable
+Software Agreement must inform the user of the terms and conditions that
+ govern
+ the Installable Software and must solicit acceptance by the end
+user in the manner prescribed in such Installable Software Agreement.
+Upon such
+ indication of agreement by the user, the provisioning Technology
+will complete installation of the Installable Software.</li>
+</ol>
+
+<h3>Cryptography</h3>
+
+<p>Content may contain encryption software. The country in which you are
+ currently may have restrictions on the import, possession, and use,
+and/or re-export to
+ another country, of encryption software. BEFORE using any encryption
+software, please check the country's laws, regulations and policies
+concerning the import,
+ possession, or use, and re-export of encryption software, to see if
+this is permitted.</p>
+
+<p><small>Java and all Java-based trademarks are trademarks of Oracle Corporation in the United States, other countries, or both.</small></p>
+
+
+</body></html>
\ No newline at end of file
diff --git a/org.eclipse.osbp.ecview.extension.presentation.vaadin.tests/notice.html b/org.eclipse.osbp.ecview.extension.presentation.vaadin.tests/notice.html
new file mode 100644
index 0000000..c3d34c3
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.presentation.vaadin.tests/notice.html
@@ -0,0 +1,107 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
+<title>Eclipse Foundation Software User Agreement</title>
+</head>
+
+<body lang="EN-US">
+<h2>Eclipse Foundation Software User Agreement</h2>
+<p>April 9, 2014</p>
+
+<h3>Usage Of Content</h3>
+
+<p>THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR OTHER MATERIALS FOR OPEN SOURCE PROJECTS
+ (COLLECTIVELY "CONTENT"). USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS AGREEMENT AND/OR THE TERMS AND
+ CONDITIONS OF LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU AGREE THAT YOUR USE
+ OF THE CONTENT IS GOVERNED BY THIS AGREEMENT AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR
+ NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND
+ CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW, THEN YOU MAY NOT USE THE CONTENT.</p>
+
+<h3>Applicable Licenses</h3>
+
+<p>Unless otherwise indicated, all Content made available by the Eclipse Foundation is provided to you under the terms and conditions of the Eclipse Public License Version 1.0
+ ("EPL"). A copy of the EPL is provided with this Content and is also available at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
+ For purposes of the EPL, "Program" will mean the Content.</p>
+
+<p>Content includes, but is not limited to, source code, object code, documentation and other files maintained in the Eclipse Foundation source code
+ repository ("Repository") in software modules ("Modules") and made available as downloadable archives ("Downloads").</p>
+
+<ul>
+ <li>Content may be structured and packaged into modules to facilitate delivering, extending, and upgrading the Content. Typical modules may include plug-ins ("Plug-ins"), plug-in fragments ("Fragments"), and features ("Features").</li>
+ <li>Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java™ ARchive) in a directory named "plugins".</li>
+ <li>A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material. Each Feature may be packaged as a sub-directory in a directory named "features". Within a Feature, files named "feature.xml" may contain a list of the names and version numbers of the Plug-ins
+ and/or Fragments associated with that Feature.</li>
+ <li>Features may also include other Features ("Included Features"). Within a Feature, files named "feature.xml" may contain a list of the names and version numbers of Included Features.</li>
+</ul>
+
+<p>The terms and conditions governing Plug-ins and Fragments should be contained in files named "about.html" ("Abouts"). The terms and conditions governing Features and
+Included Features should be contained in files named "license.html" ("Feature Licenses"). Abouts and Feature Licenses may be located in any directory of a Download or Module
+including, but not limited to the following locations:</p>
+
+<ul>
+ <li>The top-level (root) directory</li>
+ <li>Plug-in and Fragment directories</li>
+ <li>Inside Plug-ins and Fragments packaged as JARs</li>
+ <li>Sub-directories of the directory named "src" of certain Plug-ins</li>
+ <li>Feature directories</li>
+</ul>
+
+<p>Note: if a Feature made available by the Eclipse Foundation is installed using the Provisioning Technology (as defined below), you must agree to a license ("Feature Update License") during the
+installation process. If the Feature contains Included Features, the Feature Update License should either provide you with the terms and conditions governing the Included Features or
+inform you where you can locate them. Feature Update Licenses may be found in the "license" property of files named "feature.properties" found within a Feature.
+Such Abouts, Feature Licenses, and Feature Update Licenses contain the terms and conditions (or references to such terms and conditions) that govern your use of the associated Content in
+that directory.</p>
+
+<p>THE ABOUTS, FEATURE LICENSES, AND FEATURE UPDATE LICENSES MAY REFER TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS. SOME OF THESE
+OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):</p>
+
+<ul>
+ <li>Eclipse Distribution License Version 1.0 (available at <a href="http://www.eclipse.org/licenses/edl-v10.html">http://www.eclipse.org/licenses/edl-v1.0.html</a>)</li>
+ <li>Common Public License Version 1.0 (available at <a href="http://www.eclipse.org/legal/cpl-v10.html">http://www.eclipse.org/legal/cpl-v10.html</a>)</li>
+ <li>Apache Software License 1.1 (available at <a href="http://www.apache.org/licenses/LICENSE">http://www.apache.org/licenses/LICENSE</a>)</li>
+ <li>Apache Software License 2.0 (available at <a href="http://www.apache.org/licenses/LICENSE-2.0">http://www.apache.org/licenses/LICENSE-2.0</a>)</li>
+ <li>Mozilla Public License Version 1.1 (available at <a href="http://www.mozilla.org/MPL/MPL-1.1.html">http://www.mozilla.org/MPL/MPL-1.1.html</a>)</li>
+</ul>
+
+<p>IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR TO USE OF THE CONTENT. If no About, Feature License, or Feature Update License is provided, please
+contact the Eclipse Foundation to determine what terms and conditions govern that particular Content.</p>
+
+
+<h3>Use of Provisioning Technology</h3>
+
+<p>The Eclipse Foundation makes available provisioning software, examples of which include, but are not limited to, p2 and the Eclipse
+ Update Manager ("Provisioning Technology") for the purpose of allowing users to install software, documentation, information and/or
+ other materials (collectively "Installable Software"). This capability is provided with the intent of allowing such users to
+ install, extend and update Eclipse-based products. Information about packaging Installable Software is available at <a
+ href="http://eclipse.org/equinox/p2/repository_packaging.html">http://eclipse.org/equinox/p2/repository_packaging.html</a>
+ ("Specification").</p>
+
+<p>You may use Provisioning Technology to allow other parties to install Installable Software. You shall be responsible for enabling the
+ applicable license agreements relating to the Installable Software to be presented to, and accepted by, the users of the Provisioning Technology
+ in accordance with the Specification. By using Provisioning Technology in such a manner and making it available in accordance with the
+ Specification, you further acknowledge your agreement to, and the acquisition of all necessary rights to permit the following:</p>
+
+<ol>
+ <li>A series of actions may occur ("Provisioning Process") in which a user may execute the Provisioning Technology
+ on a machine ("Target Machine") with the intent of installing, extending or updating the functionality of an Eclipse-based
+ product.</li>
+ <li>During the Provisioning Process, the Provisioning Technology may cause third party Installable Software or a portion thereof to be
+ accessed and copied to the Target Machine.</li>
+ <li>Pursuant to the Specification, you will provide to the user the terms and conditions that govern the use of the Installable
+ Software ("Installable Software Agreement") and such Installable Software Agreement shall be accessed from the Target
+ Machine in accordance with the Specification. Such Installable Software Agreement must inform the user of the terms and conditions that govern
+ the Installable Software and must solicit acceptance by the end user in the manner prescribed in such Installable Software Agreement. Upon such
+ indication of agreement by the user, the provisioning Technology will complete installation of the Installable Software.</li>
+</ol>
+
+<h3>Cryptography</h3>
+
+<p>Content may contain encryption software. The country in which you are currently may have restrictions on the import, possession, and use, and/or re-export to
+ another country, of encryption software. BEFORE using any encryption software, please check the country's laws, regulations and policies concerning the import,
+ possession, or use, and re-export of encryption software, to see if this is permitted.</p>
+
+<p><small>Java and all Java-based trademarks are trademarks of Oracle Corporation in the United States, other countries, or both.</small></p>
+</body>
+</html>
diff --git a/org.eclipse.osbp.ecview.extension.presentation.vaadin.tests/pom.xml b/org.eclipse.osbp.ecview.extension.presentation.vaadin.tests/pom.xml
new file mode 100644
index 0000000..103391e
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.presentation.vaadin.tests/pom.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--#======================================================================= -->
+<!--# Copyright (c) 2011, 2016 - Loetz GmbH&Co.KG (69115 Heidelberg, Germany). -->
+<!--# All rights reserved. This program and the accompanying materials -->
+<!--# are made available under the terms of the Eclipse Public License v1.0 -->
+<!--# which accompanies this distribution, and is available at -->
+<!--# http://www.eclipse.org/legal/epl-v10.html -->
+<!--# -->
+<!--# Contributors: -->
+<!--# Cristiano Gavi??o - initial API and implementation -->
+<!--#======================================================================= -->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.eclipse.osbp.ecview.extension</groupId>
+ <artifactId>org.eclipse.osbp.ecview.extension.aggregator</artifactId>
+ <version>0.9.0-SNAPSHOT</version>
+ <relativePath>..</relativePath>
+ </parent>
+ <artifactId>org.eclipse.osbp.ecview.extension.presentation.vaadin.tests</artifactId>
+ <packaging>eclipse-plugin</packaging>
+ <description>Vaadin presentation layer for OSBP ECView extension</description>
+
+</project>
diff --git a/org.eclipse.osbp.ecview.extension.presentation.vaadin.tests/service/dtos.services b/org.eclipse.osbp.ecview.extension.presentation.vaadin.tests/service/dtos.services
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.presentation.vaadin.tests/service/dtos.services
diff --git a/org.eclipse.osbp.ecview.extension.sample/src-gen/org/eclipse/osbp/ecview/extension/tests/dtos/Person.java b/org.eclipse.osbp.ecview.extension.presentation.vaadin.tests/src-gen/de/compex/ecview/extension/tests/dtos/Person.java
similarity index 89%
rename from org.eclipse.osbp.ecview.extension.sample/src-gen/org/eclipse/osbp/ecview/extension/tests/dtos/Person.java
rename to org.eclipse.osbp.ecview.extension.presentation.vaadin.tests/src-gen/de/compex/ecview/extension/tests/dtos/Person.java
index f924c48..b9d144b 100644
--- a/org.eclipse.osbp.ecview.extension.sample/src-gen/org/eclipse/osbp/ecview/extension/tests/dtos/Person.java
+++ b/org.eclipse.osbp.ecview.extension.presentation.vaadin.tests/src-gen/de/compex/ecview/extension/tests/dtos/Person.java
@@ -1,10 +1,4 @@
-/**
- * All rights reserved by Loetz KG Heidelberg 2015.
- *
- * Contributors:
- * Florian Pirchner - initial API and implementation
- */
-package org.eclipse.osbp.ecview.extension.tests.dtos;
+package de.compex.ecview.extension.tests.dtos;
import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeSupport;
@@ -22,9 +16,7 @@
@Dispose
private boolean disposed;
- private String id = java.util.UUID.randomUUID().toString();
-
- private String name;
+ private String name = java.util.UUID.randomUUID().toString();
private String name2;
@@ -112,25 +104,6 @@
}
/**
- * Returns the id property or <code>null</code> if not present.
- */
- public String getId() {
- return this.id;
- }
-
- /**
- * Sets the <code>id</code> property to this instance.
- *
- * @param id - the property
- * @throws RuntimeException if instance is <code>disposed</code>
- *
- */
- public void setId(final String id) {
- firePropertyChange("id", this.id, this.id = id );
- installLazyCollections();
- }
-
- /**
* Returns the name property or <code>null</code> if not present.
*/
public String getName() {
@@ -146,6 +119,7 @@
*/
public void setName(final String name) {
firePropertyChange("name", this.name, this.name = name );
+ installLazyCollections();
}
/**
@@ -211,10 +185,10 @@
if (getClass() != obj.getClass())
return false;
Person other = (Person) obj;
- if (this.id == null) {
- if (other.id != null)
+ if (this.name == null) {
+ if (other.name != null)
return false;
- } else if (!this.id.equals(other.id))
+ } else if (!this.name.equals(other.name))
return false;
return true;
}
@@ -223,7 +197,7 @@
public int hashCode() {
int prime = 31;
int result = 1;
- result = prime * result + ((this.id== null) ? 0 : this.id.hashCode());
+ result = prime * result + ((this.name== null) ? 0 : this.name.hashCode());
return result;
}
@@ -277,8 +251,6 @@
// copy attributes and beans (beans if derived from entity model)
- // copy id
- newDto.setId(getId());
// copy name
newDto.setName(getName());
// copy name2
diff --git a/org.eclipse.osbp.ecview.extension.sample/src-gen/org/eclipse/osbp/ecview/extension/tests/dtos/TestsDtosTranslator.java b/org.eclipse.osbp.ecview.extension.presentation.vaadin.tests/src-gen/de/compex/ecview/extension/tests/dtos/TestsDtosTranslator.java
similarity index 77%
rename from org.eclipse.osbp.ecview.extension.sample/src-gen/org/eclipse/osbp/ecview/extension/tests/dtos/TestsDtosTranslator.java
rename to org.eclipse.osbp.ecview.extension.presentation.vaadin.tests/src-gen/de/compex/ecview/extension/tests/dtos/TestsDtosTranslator.java
index f7a981d..7c2711e 100644
--- a/org.eclipse.osbp.ecview.extension.sample/src-gen/org/eclipse/osbp/ecview/extension/tests/dtos/TestsDtosTranslator.java
+++ b/org.eclipse.osbp.ecview.extension.presentation.vaadin.tests/src-gen/de/compex/ecview/extension/tests/dtos/TestsDtosTranslator.java
@@ -1,4 +1,4 @@
-package org.eclipse.osbp.ecview.extension.tests.dtos;
+package de.compex.ecview.extension.tests.dtos;
import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeSupport;
@@ -22,7 +22,7 @@
public static TestsDtosTranslator getInstance(final Locale locale) {
if(instance == null) {
- instance = new org.eclipse.osbp.ecview.extension.tests.dtos.TestsDtosTranslator();
+ instance = new de.compex.ecview.extension.tests.dtos.TestsDtosTranslator();
if (lastLocale == null) {
instance.changeLocale(locale);
}
@@ -49,14 +49,14 @@
public void changeLocale(final Locale locale) {
// avoid unnecessary settings
if (locale == null) {
- if (log.isDebugEnabled()) log.debug("locale for org.eclipse.osbp.ecview.extension.tests.dtos is null.");
+ if (log.isDebugEnabled()) log.debug("locale for de.compex.ecview.extension.tests.dtos is null.");
return;
}
if (locale.equals(lastLocale)) {
- if (log.isDebugEnabled()) log.debug("locale for org.eclipse.osbp.ecview.extension.tests.dtos already set to "+locale.getDisplayLanguage());
+ if (log.isDebugEnabled()) log.debug("locale for de.compex.ecview.extension.tests.dtos already set to "+locale.getDisplayLanguage());
return;
}
- if (log.isDebugEnabled()) log.debug("locale for org.eclipse.osbp.ecview.extension.tests.dtos set to "+locale.getDisplayLanguage());
+ if (log.isDebugEnabled()) log.debug("locale for de.compex.ecview.extension.tests.dtos set to "+locale.getDisplayLanguage());
lastLocale = locale;
// call the imported translators change locale method
try {
diff --git a/org.eclipse.osbp.ecview.extension.presentation.vaadin.tests/src/org/eclipse/osbp/ecview/extension/presentation/tests/Activator.java b/org.eclipse.osbp.ecview.extension.presentation.vaadin.tests/src/org/eclipse/osbp/ecview/extension/presentation/tests/Activator.java
new file mode 100644
index 0000000..ffd52fb
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.presentation.vaadin.tests/src/org/eclipse/osbp/ecview/extension/presentation/tests/Activator.java
@@ -0,0 +1,68 @@
+/**
+ *
+ * Copyright (c) 2011, 2016 - Loetz GmbH&Co.KG (69115 Heidelberg, Germany)
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Christophe Loetz (Loetz GmbH&Co.KG) - initial implementation
+ *
+ */
+ package org.eclipse.osbp.ecview.extension.presentation.tests;
+
+import org.knowhowlab.osgi.testing.assertions.BundleAssert;
+import org.knowhowlab.osgi.testing.assertions.ServiceAssert;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+
+public class Activator implements BundleActivator {
+
+ static BundleContext context;
+
+ static BundleContext getContext() {
+ return context;
+ }
+
+ /**
+ * Returns the bundle with the given id.
+ *
+ * @param id
+ * @return
+ */
+ public static Bundle findBundle(String id) {
+ for (Bundle bundle : context.getBundles()) {
+ if (bundle.getSymbolicName().equals(id)) {
+ return bundle;
+ }
+ }
+ return null;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext)
+ */
+ public void start(BundleContext bundleContext) throws Exception {
+ Activator.context = bundleContext;
+
+
+ BundleAssert.setDefaultBundleContext(context);
+ ServiceAssert.setDefaultBundleContext(context);
+
+ BundleHelper.ensureNeededBundlesAvailable();
+ BundleHelper.ensureNeededServicesAvailable();
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext)
+ */
+ public void stop(BundleContext bundleContext) throws Exception {
+ Activator.context = null;
+ }
+
+}
diff --git a/org.eclipse.osbp.ecview.extension.presentation.vaadin.tests/src/org/eclipse/osbp/ecview/extension/presentation/tests/BundleHelper.java b/org.eclipse.osbp.ecview.extension.presentation.vaadin.tests/src/org/eclipse/osbp/ecview/extension/presentation/tests/BundleHelper.java
new file mode 100644
index 0000000..38a6b16
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.presentation.vaadin.tests/src/org/eclipse/osbp/ecview/extension/presentation/tests/BundleHelper.java
@@ -0,0 +1,100 @@
+/**
+ *
+ * Copyright (c) 2011, 2016 - Loetz GmbH&Co.KG (69115 Heidelberg, Germany)
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Christophe Loetz (Loetz GmbH&Co.KG) - initial implementation
+ *
+ */
+ package org.eclipse.osbp.ecview.extension.presentation.tests;
+
+import static org.knowhowlab.osgi.testing.assertions.BundleAssert.assertBundleAvailable;
+import static org.knowhowlab.osgi.testing.assertions.ServiceAssert.assertServiceAvailable;
+
+import org.eclipse.osbp.runtime.common.event.IEventBroker;
+import org.knowhowlab.osgi.testing.utils.BundleUtils;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleException;
+
+/**
+ * Helps checking required bundles
+ *
+ * @author admin
+ *
+ */
+public class BundleHelper {
+
+ public static void ensureSetup() throws BundleException {
+ ensureNeededBundlesAvailable();
+ ensureNeededServicesAvailable();
+ }
+
+ public static void ensureNeededBundlesAvailable() throws BundleException {
+
+ // check bundles available
+ assertBundleAvailable("org.eclipse.equinox.ds");
+ assertBundleAvailable("org.eclipse.equinox.event");
+ assertBundleAvailable("org.eclipse.equinox.util");
+ assertBundleAvailable("org.eclipse.osbp.runtime.event");
+ assertBundleAvailable("org.eclipse.osbp.xtext.functionlibrarydsl.provider");
+
+ // assertBundleAvailable("org.eclipse.equinox.cm");
+
+ // start ds
+ Bundle ds = BundleUtils.findBundle(Activator.context,
+ "org.eclipse.equinox.ds");
+ if (ds == null) {
+ throw new IllegalStateException(
+ "Bundle org.eclipse.equinox.ds is missing!");
+ }
+ if (ds.getState() != Bundle.STARTING && ds.getState() != Bundle.ACTIVE) {
+ ds.start();
+ }
+
+ // start eqEvent
+ Bundle eqEvent = BundleUtils.findBundle(Activator.context,
+ "org.eclipse.equinox.event");
+ if (eqEvent == null) {
+ throw new IllegalStateException(
+ "Bundle org.eclipse.equinox.event is missing!");
+ }
+ if (eqEvent.getState() != Bundle.STARTING
+ && eqEvent.getState() != Bundle.ACTIVE) {
+ eqEvent.start();
+ }
+
+ // start event
+ Bundle event = BundleUtils.findBundle(Activator.context,
+ "org.eclipse.osbp.runtime.event");
+ if (event == null) {
+ throw new IllegalStateException(
+ "Bundle org.eclipse.osbp.runtime.event is missing!");
+ }
+ if (event.getState() != Bundle.STARTING
+ && event.getState() != Bundle.ACTIVE) {
+ event.start();
+ }
+
+ // start event
+ Bundle function = BundleUtils.findBundle(Activator.context,
+ "org.eclipse.osbp.xtext.functionlibrarydsl.provider");
+ if (function == null) {
+ throw new IllegalStateException(
+ "Bundle org.eclipse.osbp.xtext.functionlibrarydsl.provider is missing!");
+ }
+ if (function.getState() != Bundle.STARTING
+ && function.getState() != Bundle.ACTIVE) {
+ function.start();
+ }
+ }
+
+ public static void ensureNeededServicesAvailable() throws BundleException {
+ assertServiceAvailable(IEventBroker.class, 1000);
+ }
+
+}
diff --git a/org.eclipse.osbp.ecview.extension.presentation.vaadin.tests/src/org/eclipse/osbp/ecview/extension/presentation/tests/DefaultUI.java b/org.eclipse.osbp.ecview.extension.presentation.vaadin.tests/src/org/eclipse/osbp/ecview/extension/presentation/tests/DefaultUI.java
new file mode 100644
index 0000000..2a6d6ca
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.presentation.vaadin.tests/src/org/eclipse/osbp/ecview/extension/presentation/tests/DefaultUI.java
@@ -0,0 +1,153 @@
+/**
+ *
+ * Copyright (c) 2011, 2016 - Loetz GmbH&Co.KG (69115 Heidelberg, Germany)
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Christophe Loetz (Loetz GmbH&Co.KG) - initial implementation
+ *
+ */
+package org.eclipse.osbp.ecview.extension.presentation.tests;
+
+import java.util.Properties;
+import java.util.concurrent.locks.Lock;
+import java.util.concurrent.locks.ReentrantLock;
+
+import com.vaadin.server.DeploymentConfiguration;
+import com.vaadin.server.ServiceException;
+import com.vaadin.server.VaadinRequest;
+import com.vaadin.server.VaadinService;
+import com.vaadin.server.VaadinServletService;
+import com.vaadin.server.VaadinSession;
+import com.vaadin.shared.communication.PushMode;
+import com.vaadin.ui.UI;
+
+@SuppressWarnings("serial")
+public class DefaultUI extends UI {
+
+ public DefaultUI() {
+ try {
+ VaadinSession session = new CustomVaadinSession(
+ new VaadinServletService(null,
+ new CustomDeploymentConfiguration()));
+ setSession(session);
+
+ VaadinSession.setCurrent(session);
+
+ } catch (ServiceException e) {
+ throw new IllegalArgumentException(e);
+ }
+ }
+
+ @Override
+ protected void init(VaadinRequest request) {
+
+ }
+
+ private class CustomVaadinSession extends VaadinSession {
+
+ Lock lock = new ReentrantLock();
+
+ public CustomVaadinSession(VaadinService service) {
+ super(service);
+ }
+
+ @Override
+ public Lock getLockInstance() {
+ return lock;
+ }
+
+ }
+
+ private static class CustomDeploymentConfiguration implements
+ DeploymentConfiguration {
+
+ @Override
+ public boolean isProductionMode() {
+ return false;
+ }
+
+ @Override
+ public boolean isXsrfProtectionEnabled() {
+ return false;
+ }
+
+ @Override
+ public boolean isSyncIdCheckEnabled() {
+ return false;
+ }
+
+ @Override
+ public int getResourceCacheTime() {
+ return 0;
+ }
+
+ @Override
+ public int getHeartbeatInterval() {
+ return 0;
+ }
+
+ @Override
+ public boolean isCloseIdleSessions() {
+ return false;
+ }
+
+ @Override
+ public PushMode getPushMode() {
+ return PushMode.DISABLED;
+ }
+
+ @Override
+ public Properties getInitParameters() {
+ return new Properties();
+ }
+
+ @Override
+ public String getApplicationOrSystemProperty(String propertyName,
+ String defaultValue) {
+ return null;
+ }
+
+ @SuppressWarnings("deprecation")
+ @Override
+ public LegacyProperyToStringMode getLegacyPropertyToStringMode() {
+ return LegacyProperyToStringMode.DISABLED;
+ }
+
+ @Override
+ public boolean isSendUrlsAsParameters() {
+ return false;
+ }
+
+ @Override
+ public String getUIClassName() {
+ return null;
+ }
+
+ @Override
+ public String getUIProviderClassName() {
+ return null;
+ }
+
+ @Override
+ public String getWidgetset(String defaultValue) {
+ return null;
+ }
+
+ @Override
+ public String getResourcesPath() {
+ return null;
+ }
+
+ @Override
+ public String getClassLoaderName() {
+ return null;
+ }
+
+ }
+
+}
diff --git a/org.eclipse.osbp.ecview.extension.presentation.vaadin.tests/src/org/eclipse/osbp/ecview/extension/presentation/tests/FunctionTests.java b/org.eclipse.osbp.ecview.extension.presentation.vaadin.tests/src/org/eclipse/osbp/ecview/extension/presentation/tests/FunctionTests.java
new file mode 100644
index 0000000..6579a1e
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.presentation.vaadin.tests/src/org/eclipse/osbp/ecview/extension/presentation/tests/FunctionTests.java
@@ -0,0 +1,276 @@
+/**
+ *
+ * Copyright (c) 2011, 2016 - Loetz GmbH&Co.KG (69115 Heidelberg, Germany)
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Christophe Loetz (Loetz GmbH&Co.KG) - initial implementation
+ *
+ */
+ package org.eclipse.osbp.ecview.extension.presentation.tests;
+
+import static org.junit.Assert.assertFalse;
+
+import java.text.DecimalFormat;
+import java.text.ParseException;
+import java.util.Locale;
+import java.util.Map.Entry;
+
+import org.eclipse.emf.common.util.BasicEMap;
+import org.eclipse.emf.common.util.EMap;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.knowhowlab.osgi.testing.assertions.BundleAssert;
+import org.knowhowlab.osgi.testing.utils.BundleUtils;
+import org.eclipse.osbp.ecview.core.common.context.IViewContext;
+import org.eclipse.osbp.ecview.core.common.editpart.DelegatingEditPartManager;
+import org.eclipse.osbp.ecview.core.common.editpart.IConverterEditpart;
+import org.eclipse.osbp.ecview.core.common.editpart.IElementEditpart;
+import org.eclipse.osbp.ecview.core.common.editpart.IEmbeddableEditpart;
+import org.eclipse.osbp.ecview.core.common.editpart.IViewEditpart;
+import org.eclipse.osbp.ecview.core.common.model.core.YElement;
+import org.eclipse.osbp.ecview.core.common.presentation.DelegatingConverterFactory;
+import org.eclipse.osbp.ecview.core.common.presentation.IConverterFactory;
+import org.eclipse.osbp.ecview.core.common.presentation.IWidgetPresentation;
+import org.eclipse.osbp.runtime.web.ecview.presentation.vaadin.internal.TextFieldPresentation;
+import org.eclipse.osbp.utils.functionnormalizer.api.FunctionTypingAPI;
+import org.eclipse.osbp.xtext.functionlibrary.common.api.IFunctionLibraryService;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.BundleException;
+import org.osgi.framework.FrameworkUtil;
+import org.osgi.framework.ServiceReference;
+import org.osgi.service.cm.ConfigurationException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import com.vaadin.data.util.converter.Converter;
+import com.vaadin.ui.Component;
+import com.vaadin.ui.CssLayout;
+import com.vaadin.ui.UI;
+
+import org.eclipse.osbp.ecview.extension.model.converter.YCustomDecimalConverter;
+import org.eclipse.osbp.ecview.extension.model.util.SimpleECviewExtensionModelFactory;
+import org.eclipse.osbp.ecview.extension.presentation.vaadin.converter.CustomDecimalConverter;
+import org.eclipse.osbp.ecview.extension.vaadin.components.utils.FunctionWrapper;
+
+/**
+ * Tests the {@link TextFieldPresentation}.
+ */
+@SuppressWarnings("restriction")
+public class FunctionTests {
+
+ private static final Logger LOGGER = LoggerFactory
+ .getLogger(FunctionTests.class);
+ private final DecimalFormat defaultDecimalFormat = new DecimalFormat(
+ "##,##0.00");
+
+ private SimpleECviewExtensionModelFactory factory = new SimpleECviewExtensionModelFactory();
+ private CssLayout rootLayout = new CssLayout();
+ private EMap<String, String> properties = new BasicEMap();
+ private BundleContext bc;
+
+ protected static String CUSTOM_DECIMAL_CONVERTER = "CUSTOM_DECIMAL_CONVERTER";
+
+ /**
+ * Setup tests.
+ *
+ * @throws ConfigurationException
+ * @throws BundleException
+ */
+ @Before
+ public void setup() throws ConfigurationException, BundleException {
+ UI.setCurrent(new DefaultUI());
+ UI.getCurrent().setContent(rootLayout);
+
+ bc = FrameworkUtil.getBundle(getClass()).getBundleContext();
+
+ BundleUtils.startBundleAsync(bc,
+ "org.eclipse.osbp.xtext.functionlibrarydsl.provider");
+
+ properties
+ .put("functionToModelFormat",
+ "org.eclipse.osbp.ecview.extension.presentation.tests.utils.Formatter.lengthToModelConverter");
+ properties.put("functionBaseUnit", "cm");
+ }
+
+ @After
+ public void after() {
+ DelegatingConverterFactory.getInstance().clear();
+ }
+
+ /**
+ * Tests rendering issues.
+ *
+ * @throws Exception
+ */
+ @Test
+ // BEGIN SUPRESS CATCH EXCEPTION
+ public void convertLengthStringToDouble() throws Exception {
+ // END SUPRESS CATCH EXCEPTION
+ // build the view model
+ // ...> yView
+ // ......> yGridLayout
+ // .........> yText
+ // YView yView = factory.createView();
+ // YGridLayout yGridlayout = factory.createGridLayout();
+ // yView.setContent(yGridlayout);
+ // YDecimalField yDecimal = factory.createDecimalField();
+ // YCustomDecimalConverter yConverter =
+ // YConverterFactory.eINSTANCE.createYCustomDecimalConverter();
+ // yDecimal.setConverter(yConverter);
+ // yGridlayout.getElements().add(yDecimal);
+ //
+ // DelegatingConverterFactory.getInstance().addDelegate(
+ // new ConverterFactory(CUSTOM_DECIMAL_CONVERTER));
+ //
+ // VaadinRenderer renderer = new VaadinRenderer();
+ // renderer.render(rootLayout, yView, null);
+ //
+ // IDecimalFieldEditpart decimalEditpart = DelegatingEditPartManager
+ // .getInstance().getEditpart(yDecimal);
+ // IWidgetPresentation<Component> presentation = decimalEditpart
+ // .getPresentation();
+ // DecimalField decimal = (DecimalField) presentation.getWidget();
+ //
+ // yDecimal.setValue(10);
+ // assertEquals(10, yDecimal.getValue(), 0);
+ // assertEquals("10,00 cm", decimal.getValue());
+ //
+ // decimal.setValue("10,00 cm");
+ // assertEquals(10, yDecimal.getValue(), 0);
+ // assertEquals("10,00 cm", decimal.getValue());
+ //
+
+ BundleAssert.assertBundleState(Bundle.ACTIVE,
+ "org.eclipse.osbp.xtext.functionlibrarydsl.provider");
+
+ String value = "10,00 cm";
+ Locale locale = Locale.GERMANY;
+
+ Number n;
+ try {
+ n = defaultDecimalFormat.parse(value);
+ Double dbl = new Double(n.doubleValue());
+ String dblStr = defaultDecimalFormat.format(dbl);
+ int idx = dblStr.toString().length();
+ String suffix = value.substring(idx).trim();
+ String baseSuffix = null;
+ FunctionTypingAPI functionTypingAPI = new FunctionTypingAPI();
+// for (Entry<String, String> entry : getProperties()) {
+// if (functionTypingAPI.getFunctionBaseUnitTypeName().equals(
+// entry.getKey())) {
+// baseSuffix = entry.getValue();
+// }
+// }
+ for (Entry<String, String> entry : getProperties()) {
+ if (functionTypingAPI.getFunctionConverterTypeName()
+ .equals(entry.getKey())) {
+ n = handleToModelFormat(entry.getValue(), n.doubleValue(),
+ locale, baseSuffix, suffix);
+ }
+ }
+ } catch (ParseException e) {
+ assertFalse(true);
+ }
+
+ }
+
+ private static class ConverterFactory implements IConverterFactory {
+
+ private String converterName;
+
+ public ConverterFactory(String converterName) {
+ super();
+ this.converterName = converterName;
+ }
+
+ public ConverterFactory() {
+ super();
+ }
+
+ @Override
+ public boolean isFor(IViewContext uiContext, IConverterEditpart editpart) {
+ return true;
+ }
+
+ @Override
+ public Object createConverter(IViewContext uiContext,
+ IConverterEditpart editpart) throws IllegalArgumentException {
+ if (FunctionTests.CUSTOM_DECIMAL_CONVERTER.equals(converterName)) {
+ return new CustomDecimalConverter(uiContext,
+ (YCustomDecimalConverter) editpart.getModel());
+ }
+ return new TextToTextConverter();
+ }
+ }
+
+ /**
+ * Converters "Test" to "Test $" and "Test $" to "Test"
+ */
+ @SuppressWarnings("serial")
+ private static class TextToTextConverter implements
+ Converter<String, String> {
+
+ @Override
+ public String convertToModel(String value,
+ Class<? extends String> targetType, Locale locale)
+ throws com.vaadin.data.util.converter.Converter.ConversionException {
+ return value == null ? "" : value.replaceAll(" XX", "");
+ }
+
+ @Override
+ public String convertToPresentation(String value,
+ Class<? extends String> targetType, Locale locale)
+ throws com.vaadin.data.util.converter.Converter.ConversionException {
+ return value == null ? " XX" : value + " XX";
+ }
+
+ @Override
+ public Class<String> getModelType() {
+ return String.class;
+ }
+
+ @Override
+ public Class<String> getPresentationType() {
+ return String.class;
+ }
+
+ }
+
+ // HELPER METHODS
+
+ private Double handleToModelFormat(String functionFqn, Double value,
+ Locale locale, String baseSuffix, String suffix) {
+
+ ServiceReference<IFunctionLibraryService> ref = bc
+ .getServiceReference(IFunctionLibraryService.class);
+ IFunctionLibraryService service = bc.getService(ref);
+
+ FunctionWrapper wrapper = new FunctionWrapper(functionFqn);
+ try {
+ if (locale != null) {
+ Double callResult = (Double) service.callFunctionLibrary(
+ wrapper.getClassName(), wrapper.getMethodName(), value,
+ locale, baseSuffix, suffix);
+ return callResult;
+ }
+ } catch (ClassCastException ex) {
+ // TODO (JCD): Translation
+ LOGGER.error("Return type of the function call '" + functionFqn
+ + "' is not a " + Double.class.getSimpleName() + "!");
+ }
+ return value;
+ }
+
+ // GETTER
+ public EMap<String, String> getProperties() {
+ return properties;
+ }
+
+}
diff --git a/org.eclipse.osbp.ecview.extension.presentation.vaadin.tests/src/org/eclipse/osbp/ecview/extension/presentation/tests/PresentationTests.java b/org.eclipse.osbp.ecview.extension.presentation.vaadin.tests/src/org/eclipse/osbp/ecview/extension/presentation/tests/PresentationTests.java
new file mode 100644
index 0000000..3c4915c
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.presentation.vaadin.tests/src/org/eclipse/osbp/ecview/extension/presentation/tests/PresentationTests.java
@@ -0,0 +1,318 @@
+/**
+ *
+ * Copyright (c) 2011, 2016 - Loetz GmbH&Co.KG (69115 Heidelberg, Germany)
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Christophe Loetz (Loetz GmbH&Co.KG) - initial implementation
+ *
+ */
+ package org.eclipse.osbp.ecview.extension.presentation.tests;
+
+import static org.junit.Assert.assertEquals;
+
+import java.util.Locale;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.eclipse.osbp.ecview.core.common.context.IViewContext;
+import org.eclipse.osbp.ecview.core.common.editpart.DelegatingEditPartManager;
+import org.eclipse.osbp.ecview.core.common.editpart.IConverterEditpart;
+import org.eclipse.osbp.ecview.core.common.editpart.IElementEditpart;
+import org.eclipse.osbp.ecview.core.common.editpart.IEmbeddableEditpart;
+import org.eclipse.osbp.ecview.core.common.editpart.IViewEditpart;
+import org.eclipse.osbp.ecview.core.common.model.core.CoreModelFactory;
+import org.eclipse.osbp.ecview.core.common.model.core.YDelegateConverter;
+import org.eclipse.osbp.ecview.core.common.model.core.YElement;
+import org.eclipse.osbp.ecview.core.common.model.core.YView;
+import org.eclipse.osbp.ecview.core.common.presentation.DelegatingConverterFactory;
+import org.eclipse.osbp.ecview.core.common.presentation.IConverterFactory;
+import org.eclipse.osbp.ecview.core.common.presentation.IWidgetPresentation;
+import org.eclipse.osbp.ecview.core.extension.model.extension.YDecimalField;
+import org.eclipse.osbp.ecview.core.extension.model.extension.YGridLayout;
+import org.eclipse.osbp.ecview.core.extension.model.extension.YNumericField;
+import org.eclipse.osbp.ecview.core.extension.model.extension.YTextField;
+import org.eclipse.osbp.ecview.core.ui.core.editparts.extension.IDecimalFieldEditpart;
+import org.eclipse.osbp.ecview.core.ui.core.editparts.extension.INumericFieldEditpart;
+import org.eclipse.osbp.ecview.core.ui.core.editparts.extension.ITextFieldEditpart;
+import org.eclipse.osbp.runtime.web.ecview.presentation.vaadin.IConstants;
+import org.eclipse.osbp.runtime.web.ecview.presentation.vaadin.VaadinRenderer;
+import org.eclipse.osbp.runtime.web.ecview.presentation.vaadin.internal.TextFieldPresentation;
+import org.eclipse.osbp.runtime.web.vaadin.components.fields.DecimalField;
+import org.eclipse.osbp.runtime.web.vaadin.components.fields.NumericField;
+import org.osgi.framework.BundleException;
+import org.osgi.service.cm.ConfigurationException;
+
+import com.vaadin.data.util.converter.Converter;
+import com.vaadin.ui.Component;
+import com.vaadin.ui.CssLayout;
+import com.vaadin.ui.TextField;
+import com.vaadin.ui.UI;
+
+import org.eclipse.osbp.ecview.extension.editparts.components.ICustomDecimalFieldEditpart;
+import org.eclipse.osbp.ecview.extension.model.YCustomDecimalField;
+import org.eclipse.osbp.ecview.extension.model.converter.YConverterFactory;
+import org.eclipse.osbp.ecview.extension.model.converter.YDecimalToUomoConverter;
+import org.eclipse.osbp.ecview.extension.model.converter.YNumericToUomoConverter;
+import org.eclipse.osbp.ecview.extension.model.util.SimpleECviewExtensionModelFactory;
+import org.eclipse.osbp.ecview.extension.presentation.vaadin.converter.DecimalToUomoConverter;
+import org.eclipse.osbp.ecview.extension.presentation.vaadin.converter.NumericToUomoConverter;
+import org.eclipse.osbp.ecview.extension.vaadin.components.CustomDecimalField;
+
+/**
+ * Tests the {@link TextFieldPresentation}.
+ */
+@SuppressWarnings("restriction")
+public class PresentationTests {
+
+ private SimpleECviewExtensionModelFactory factory = new SimpleECviewExtensionModelFactory();
+ private CssLayout rootLayout = new CssLayout();
+
+ protected static String NUMBER_TO_UOMO_CONVERTER = "NUMBER_TO_UOMO_CONVERTER";
+ protected static String DECIMAL_TO_UOMO_CONVERTER = "DECIMAL_TO_UOMO_CONVERTER";
+
+ /**
+ * Setup tests.
+ *
+ * @throws ConfigurationException
+ * @throws BundleException
+ */
+ @Before
+ public void setup() throws ConfigurationException, BundleException {
+ UI.setCurrent(new DefaultUI());
+ UI.getCurrent().setContent(rootLayout);
+ }
+
+ @After
+ public void after() {
+ DelegatingConverterFactory.getInstance().clear();
+ }
+
+ /**
+ * Tests rendering issues.
+ *
+ * @throws Exception
+ */
+ @Test
+ // BEGIN SUPRESS CATCH EXCEPTION
+ public void test_DecimalCustomEnd() throws Exception {
+ // END SUPRESS CATCH EXCEPTION
+ // build the view model
+ // ...> yView
+ // ......> yGridLayout
+ // .........> yText
+ YView yView = factory.createView();
+ YGridLayout yGridlayout = factory.createGridLayout();
+ yView.setContent(yGridlayout);
+ YCustomDecimalField yCustomDecimal = factory.createCustomDecimalField();
+ yGridlayout.getElements().add(yCustomDecimal);
+
+ VaadinRenderer renderer = new VaadinRenderer();
+ IViewContext context = renderer.render(rootLayout, yView, null);
+
+ ICustomDecimalFieldEditpart customDecimalEditpart = DelegatingEditPartManager
+ .getInstance().getEditpart(context, yCustomDecimal);
+ IWidgetPresentation<Component> presentation = customDecimalEditpart
+ .getPresentation();
+ CustomDecimalField customDecimal = (CustomDecimalField) presentation.getWidget();
+
+ String PRICE_END_VALUE = "cx_price_end_value";
+ yCustomDecimal.setValue(10.98);
+ assertEquals(IConstants.CSS_CLASS_CONTROL + " " + PRICE_END_VALUE, customDecimal.getStyleName());
+ yCustomDecimal.setValue(10.99);
+ assertEquals(IConstants.CSS_CLASS_CONTROL, customDecimal.getStyleName());
+ }
+
+
+ /**
+ * Tests rendering issues.
+ *
+ * @throws Exception
+ */
+ @Test
+ // BEGIN SUPRESS CATCH EXCEPTION
+ public void test_TextToTextConverter() throws Exception {
+ // END SUPRESS CATCH EXCEPTION
+ // build the view model
+ // ...> yView
+ // ......> yGridLayout
+ // .........> yText
+ YView yView = factory.createView();
+ YGridLayout yGridlayout = factory.createGridLayout();
+ yView.setContent(yGridlayout);
+ YTextField yText = factory.createTextField();
+ YDelegateConverter yConverter = CoreModelFactory.eINSTANCE
+ .createYDelegateConverter();
+ yConverter.setConverterId("text.test");
+ yText.setConverter(yConverter);
+ yGridlayout.getElements().add(yText);
+
+ DelegatingConverterFactory.getInstance().addDelegate(
+ new ConverterFactory());
+
+ VaadinRenderer renderer = new VaadinRenderer();
+ IViewContext context = renderer.render(rootLayout, yView, null);
+
+ ITextFieldEditpart textEditpart = DelegatingEditPartManager
+ .getInstance().getEditpart(context, yText);
+ IWidgetPresentation<Component> presentation = textEditpart
+ .getPresentation();
+ TextField text = (TextField) presentation.getWidget();
+
+ yText.setValue("Huhu");
+ assertEquals("Huhu", yText.getValue());
+ assertEquals("Huhu XX", text.getValue());
+
+ text.setValue("Haha XX");
+ assertEquals("Haha", yText.getValue());
+ assertEquals("Haha XX", text.getValue());
+ }
+
+ /**
+ * Tests rendering issues.
+ *
+ * @throws Exception
+ */
+ @Test
+ // BEGIN SUPRESS CATCH EXCEPTION
+ public void test_DecimalToUomoConverter() throws Exception {
+ // END SUPRESS CATCH EXCEPTION
+ // build the view model
+ // ...> yView
+ // ......> yGridLayout
+ // .........> yText
+ YView yView = factory.createView();
+ YGridLayout yGridlayout = factory.createGridLayout();
+ yView.setContent(yGridlayout);
+ YDecimalField yDecimal = factory.createDecimalField();
+ YDecimalToUomoConverter yConverter = YConverterFactory.eINSTANCE.createYDecimalToUomoConverter();
+ yDecimal.setConverter(yConverter);
+ yGridlayout.getElements().add(yDecimal);
+
+ DelegatingConverterFactory.getInstance().addDelegate(
+ new ConverterFactory(DECIMAL_TO_UOMO_CONVERTER));
+
+ VaadinRenderer renderer = new VaadinRenderer();
+ IViewContext context = renderer.render(rootLayout, yView, null);
+
+ IDecimalFieldEditpart decimalEditpart = DelegatingEditPartManager
+ .getInstance().getEditpart(context, yDecimal);
+ IWidgetPresentation<Component> presentation = decimalEditpart
+ .getPresentation();
+ DecimalField decimal = (DecimalField) presentation.getWidget();
+
+ yDecimal.setValue(10);
+ assertEquals(10, yDecimal.getValue(), 0);
+ assertEquals("10,00 cm", decimal.getValue());
+
+ decimal.setValue("10,00 cm");
+ assertEquals(10, yDecimal.getValue(), 0);
+ assertEquals("10,00 cm", decimal.getValue());
+ }
+
+ @Test
+ // BEGIN SUPRESS CATCH EXCEPTION
+ public void test_NumericToUomoConverter() throws Exception {
+ // END SUPRESS CATCH EXCEPTION
+ // build the view model
+ // ...> yView
+ // ......> yGridLayout
+ // .........> yText
+ YView yView = factory.createView();
+ YGridLayout yGridlayout = factory.createGridLayout();
+ yView.setContent(yGridlayout);
+ YNumericField yNumber = factory.createNumericField();
+ YNumericToUomoConverter yConverter = YConverterFactory.eINSTANCE.createYNumericToUomoConverter();
+ yNumber.setConverter(yConverter);
+ yGridlayout.getElements().add(yNumber);
+
+ DelegatingConverterFactory.getInstance().addDelegate(
+ new ConverterFactory(NUMBER_TO_UOMO_CONVERTER));
+
+ VaadinRenderer renderer = new VaadinRenderer();
+ IViewContext context = renderer.render(rootLayout, yView, null);
+
+ INumericFieldEditpart numericEditpart = DelegatingEditPartManager
+ .getInstance().getEditpart(context, yNumber);
+ IWidgetPresentation<Component> presentation = numericEditpart
+ .getPresentation();
+ NumericField number = (NumericField) presentation.getWidget();
+
+ yNumber.setValue(10);
+ assertEquals(10, yNumber.getValue(), 0);
+ assertEquals("10 cm", number.getValue());
+
+ number.setValue("10 cm");
+ assertEquals(10, yNumber.getValue(), 0);
+ assertEquals("10 cm", number.getValue());
+ }
+
+ private static class ConverterFactory implements IConverterFactory {
+
+ private String converterName;
+
+
+ public ConverterFactory(String converterName) {
+ super();
+ this.converterName = converterName;
+ }
+
+ public ConverterFactory() {
+ super();
+ }
+
+ @Override
+ public boolean isFor(IViewContext uiContext, IConverterEditpart editpart) {
+ return true;
+ }
+
+ @Override
+ public Object createConverter(IViewContext uiContext,
+ IConverterEditpart editpart) throws IllegalArgumentException {
+ if (PresentationTests.NUMBER_TO_UOMO_CONVERTER.equals(converterName)){
+ return new NumericToUomoConverter(uiContext, (YNumericToUomoConverter) editpart.getModel());
+ } else if (PresentationTests.DECIMAL_TO_UOMO_CONVERTER.equals(converterName)){
+ return new DecimalToUomoConverter(uiContext, (YDecimalToUomoConverter) editpart.getModel());
+ }
+ return new TextToTextConverter();
+ }
+ }
+
+ /**
+ * Converters "Test" to "Test $" and "Test $" to "Test"
+ */
+ @SuppressWarnings("serial")
+ private static class TextToTextConverter implements
+ Converter<String, String> {
+
+ @Override
+ public String convertToModel(String value,
+ Class<? extends String> targetType, Locale locale)
+ throws com.vaadin.data.util.converter.Converter.ConversionException {
+ return value == null ? "" : value.replaceAll(" XX", "");
+ }
+
+ @Override
+ public String convertToPresentation(String value,
+ Class<? extends String> targetType, Locale locale)
+ throws com.vaadin.data.util.converter.Converter.ConversionException {
+ return value == null ? " XX" : value + " XX";
+ }
+
+ @Override
+ public Class<String> getModelType() {
+ return String.class;
+ }
+
+ @Override
+ public Class<String> getPresentationType() {
+ return String.class;
+ }
+
+ }
+}
diff --git a/org.eclipse.osbp.ecview.extension.presentation.vaadin.tests/src/org/eclipse/osbp/ecview/extension/presentation/tests/strategy/AbstractBean.java b/org.eclipse.osbp.ecview.extension.presentation.vaadin.tests/src/org/eclipse/osbp/ecview/extension/presentation/tests/strategy/AbstractBean.java
new file mode 100644
index 0000000..1ca138c
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.presentation.vaadin.tests/src/org/eclipse/osbp/ecview/extension/presentation/tests/strategy/AbstractBean.java
@@ -0,0 +1,95 @@
+/**
+ * Copyright (c) 2012 Lunifera GmbH (Austria) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Florian Pirchner - initial API and implementation
+ */
+package org.eclipse.osbp.ecview.extension.presentation.tests.strategy;
+
+import java.beans.PropertyChangeListener;
+import java.beans.PropertyChangeSupport;
+
+/**
+ * Default implementation of value bean. Offerns {@link PropertyChangeSupport}.
+ */
+public class AbstractBean {
+ private final PropertyChangeSupport changeSupport = new PropertyChangeSupport(
+ this);
+
+ public AbstractBean() {
+ }
+
+ /**
+ * Adds the given property change listener to the change support.
+ *
+ * @param listener
+ * Listener to be added
+ * @see java.beans.PropertyChangeSupport#addPropertyChangeListener(java.beans.PropertyChangeListener)
+ */
+ public void addPropertyChangeListener(PropertyChangeListener listener) {
+ changeSupport.addPropertyChangeListener(listener);
+ }
+
+ /**
+ * Adds the given property change listener to the change support.
+ *
+ * @param property
+ * Name of the property
+ * @param listener
+ * Listener to be added
+ * @see java.beans.PropertyChangeSupport#addPropertyChangeListener(java.lang.String,
+ * java.beans.PropertyChangeListener)
+ */
+ public void addPropertyChangeListener(String property,
+ PropertyChangeListener listener) {
+ changeSupport.addPropertyChangeListener(property, listener);
+ }
+
+ /**
+ * Removes the given property change listener from the change support.
+ *
+ * @param listener
+ * Listener to be removed
+ * @see java.beans.PropertyChangeSupport#removePropertyChangeListener(java.beans.PropertyChangeListener)
+ */
+ public void removePropertyChangeListener(PropertyChangeListener listener) {
+ changeSupport.removePropertyChangeListener(listener);
+ }
+
+ /**
+ * Removes the given property change listener from the change support.
+ *
+ * @param property
+ * Name of the property
+ * @param listener
+ * Listener to be removed
+ * @see java.beans.PropertyChangeSupport#removePropertyChangeListener(java.lang.String,
+ * java.beans.PropertyChangeListener)
+ */
+ public void removePropertyChangeListener(String property,
+ PropertyChangeListener listener) {
+ changeSupport.removePropertyChangeListener(property, listener);
+ }
+
+ /**
+ * Fires the property changed event.
+ *
+ * @param property
+ * Name of the property
+ * @param oldValue
+ * The old value
+ * @param newValue
+ * The new value
+ * @see java.beans.PropertyChangeSupport#firePropertyChange(String, Object,
+ * Object)
+ */
+ protected void firePropertyChanged(String property, Object oldValue,
+ Object newValue) {
+ changeSupport.firePropertyChange(property, oldValue, newValue);
+ }
+
+}
diff --git a/org.eclipse.osbp.ecview.extension.presentation.vaadin.tests/src/org/eclipse/osbp/ecview/extension/presentation/tests/strategy/Bar.java b/org.eclipse.osbp.ecview.extension.presentation.vaadin.tests/src/org/eclipse/osbp/ecview/extension/presentation/tests/strategy/Bar.java
new file mode 100644
index 0000000..a9f69eb
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.presentation.vaadin.tests/src/org/eclipse/osbp/ecview/extension/presentation/tests/strategy/Bar.java
@@ -0,0 +1,168 @@
+/**
+ *
+ * Copyright (c) 2015 - 2016 - Loetz GmbH&Co.KG, 69115 Heidelberg, Germany
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Loetz GmbH&Co.KG - Initial implementation
+ *
+ */
+ package org.eclipse.osbp.ecview.extension.presentation.tests.strategy;
+
+import java.beans.PropertyChangeListener;
+import java.beans.PropertyChangeSupport;
+import java.io.Serializable;
+
+@SuppressWarnings("serial")
+public class Bar implements Serializable {
+ private PropertyChangeSupport propertyChangeSupport = new PropertyChangeSupport(
+ this);
+
+ private boolean disposed;
+
+ private String name;
+
+ private Foo myfoo;
+
+ /**
+ * Returns true, if the object is disposed. Disposed means, that it is
+ * prepared for garbage collection and may not be used anymore. Accessing
+ * objects that are already disposed will cause runtime exceptions.
+ */
+ public boolean isDisposed() {
+ return this.disposed;
+ }
+
+ /**
+ * @see PropertyChangeSupport#addPropertyChangeListener(PropertyChangeListener)
+ */
+ public void addPropertyChangeListener(final PropertyChangeListener listener) {
+ propertyChangeSupport.addPropertyChangeListener(listener);
+ }
+
+ /**
+ * @see PropertyChangeSupport#addPropertyChangeListener(String,
+ * PropertyChangeListener)
+ */
+ public void addPropertyChangeListener(final String propertyName,
+ final PropertyChangeListener listener) {
+ propertyChangeSupport.addPropertyChangeListener(propertyName, listener);
+ }
+
+ /**
+ * @see PropertyChangeSupport#removePropertyChangeListener(PropertyChangeListener)
+ */
+ public void removePropertyChangeListener(
+ final PropertyChangeListener listener) {
+ propertyChangeSupport.removePropertyChangeListener(listener);
+ }
+
+ /**
+ * @see PropertyChangeSupport#removePropertyChangeListener(String,
+ * PropertyChangeListener)
+ */
+ public void removePropertyChangeListener(final String propertyName,
+ final PropertyChangeListener listener) {
+ propertyChangeSupport.removePropertyChangeListener(propertyName,
+ listener);
+ }
+
+ /**
+ * @see PropertyChangeSupport#firePropertyChange(String, Object, Object)
+ */
+ public void firePropertyChange(final String propertyName,
+ final Object oldValue, final Object newValue) {
+ propertyChangeSupport.firePropertyChange(propertyName, oldValue,
+ newValue);
+ }
+
+ /**
+ * Checks whether the object is disposed.
+ *
+ * @throws RuntimeException
+ * if the object is disposed.
+ */
+ private void checkDisposed() {
+ if (isDisposed()) {
+ throw new RuntimeException("Object already disposed: " + this);
+ }
+ }
+
+ /**
+ * Calling dispose will destroy that instance. The internal state will be
+ * set to 'disposed' and methods of that object must not be used anymore.
+ * Each call will result in runtime exceptions.
+ * If this object keeps composition containments, these will be disposed
+ * too. So the whole composition containment tree will be disposed on
+ * calling this method.
+ */
+ public void dispose() {
+ if (isDisposed()) {
+ return;
+ }
+ disposed = true;
+ }
+
+ /**
+ * Returns the name property or <code>null</code> if not present.
+ */
+ public String getName() {
+ checkDisposed();
+ return this.name;
+ }
+
+ /**
+ * Sets the <code>name</code> property to this instance.
+ *
+ * @param name
+ * - the property
+ * @throws RuntimeException
+ * if instance is <code>disposed</code>
+ *
+ */
+ public void setName(final String name) {
+ firePropertyChange("name", this.name, this.name = name);
+ }
+
+ /**
+ * Returns the myfoo property or <code>null</code> if not present.
+ */
+ public Foo getMyfoo() {
+ checkDisposed();
+ return this.myfoo;
+ }
+
+/**
+ * Sets the <code>myfoo</code> property to this instance.
+ * Since the reference has an opposite reference, the opposite <code>foo#
+ * mybars</code> of the <code>myfoo</code> will be handled automatically and no
+ * further coding is required to keep them in sync.<p>
+ * See {@link foo#setMybars(foo)
+ *
+ * @param myfoo - the property
+ * @throws RuntimeException if instance is <code>disposed</code>
+ *
+ */
+ public void setMyfoo(final Foo myfoo) {
+ checkDisposed();
+ if (this.myfoo != null) {
+ this.myfoo.internalRemoveFromMybars(this);
+ }
+ internalSetMyfoo(myfoo);
+ if (this.myfoo != null) {
+ this.myfoo.internalAddToMybars(this);
+ }
+
+ }
+
+ /**
+ * For internal use only!
+ */
+ public void internalSetMyfoo(final Foo myfoo) {
+ firePropertyChange("myfoo", this.myfoo, this.myfoo = myfoo);
+ }
+}
diff --git a/org.eclipse.osbp.ecview.extension.presentation.vaadin.tests/src/org/eclipse/osbp/ecview/extension/presentation/tests/strategy/BarHashById.java b/org.eclipse.osbp.ecview.extension.presentation.vaadin.tests/src/org/eclipse/osbp/ecview/extension/presentation/tests/strategy/BarHashById.java
new file mode 100644
index 0000000..88e3654
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.presentation.vaadin.tests/src/org/eclipse/osbp/ecview/extension/presentation/tests/strategy/BarHashById.java
@@ -0,0 +1,168 @@
+/**
+ *
+ * Copyright (c) 2015 - 2016 - Loetz GmbH&Co.KG, 69115 Heidelberg, Germany
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Loetz GmbH&Co.KG - Initial implementation
+ *
+ */
+ package org.eclipse.osbp.ecview.extension.presentation.tests.strategy;
+
+import java.beans.PropertyChangeListener;
+import java.beans.PropertyChangeSupport;
+import java.io.Serializable;
+
+@SuppressWarnings("serial")
+public class BarHashById implements Serializable {
+ private PropertyChangeSupport propertyChangeSupport = new PropertyChangeSupport(
+ this);
+
+ private final String id;
+
+ private boolean disposed;
+
+ private String name;
+
+ public BarHashById(String id) {
+ super();
+ this.id = id;
+ }
+
+ /**
+ * Returns true, if the object is disposed. Disposed means, that it is
+ * prepared for garbage collection and may not be used anymore. Accessing
+ * objects that are already disposed will cause runtime exceptions.
+ */
+ public boolean isDisposed() {
+ return this.disposed;
+ }
+
+ /**
+ * @see PropertyChangeSupport#addPropertyChangeListener(PropertyChangeListener)
+ */
+ public void addPropertyChangeListener(final PropertyChangeListener listener) {
+ propertyChangeSupport.addPropertyChangeListener(listener);
+ }
+
+ /**
+ * @see PropertyChangeSupport#addPropertyChangeListener(String,
+ * PropertyChangeListener)
+ */
+ public void addPropertyChangeListener(final String propertyName,
+ final PropertyChangeListener listener) {
+ propertyChangeSupport.addPropertyChangeListener(propertyName, listener);
+ }
+
+ /**
+ * @see PropertyChangeSupport#removePropertyChangeListener(PropertyChangeListener)
+ */
+ public void removePropertyChangeListener(
+ final PropertyChangeListener listener) {
+ propertyChangeSupport.removePropertyChangeListener(listener);
+ }
+
+ /**
+ * @see PropertyChangeSupport#removePropertyChangeListener(String,
+ * PropertyChangeListener)
+ */
+ public void removePropertyChangeListener(final String propertyName,
+ final PropertyChangeListener listener) {
+ propertyChangeSupport.removePropertyChangeListener(propertyName,
+ listener);
+ }
+
+ /**
+ * @see PropertyChangeSupport#firePropertyChange(String, Object, Object)
+ */
+ public void firePropertyChange(final String propertyName,
+ final Object oldValue, final Object newValue) {
+ propertyChangeSupport.firePropertyChange(propertyName, oldValue,
+ newValue);
+ }
+
+ /**
+ * Checks whether the object is disposed.
+ *
+ * @throws RuntimeException
+ * if the object is disposed.
+ */
+ private void checkDisposed() {
+ if (isDisposed()) {
+ throw new RuntimeException("Object already disposed: " + this);
+ }
+ }
+
+ /**
+ * Calling dispose will destroy that instance. The internal state will be
+ * set to 'disposed' and methods of that object must not be used anymore.
+ * Each call will result in runtime exceptions.
+ * If this object keeps composition containments, these will be disposed
+ * too. So the whole composition containment tree will be disposed on
+ * calling this method.
+ */
+ public void dispose() {
+ if (isDisposed()) {
+ return;
+ }
+ disposed = true;
+ }
+
+ /**
+ * Returns the name property or <code>null</code> if not present.
+ */
+ public String getName() {
+ checkDisposed();
+ return this.name;
+ }
+
+ /**
+ * Sets the <code>name</code> property to this instance.
+ *
+ * @param name
+ * - the property
+ * @throws RuntimeException
+ * if instance is <code>disposed</code>
+ *
+ */
+ public void setName(final String name) {
+ firePropertyChange("name", this.name, this.name = name);
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((id == null) ? 0 : id.hashCode());
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ BarHashById other = (BarHashById) obj;
+ if (disposed != other.disposed)
+ return false;
+ if (id == null) {
+ if (other.id != null)
+ return false;
+ } else if (!id.equals(other.id))
+ return false;
+ if (name == null) {
+ if (other.name != null)
+ return false;
+ } else if (!name.equals(other.name))
+ return false;
+ return true;
+ }
+
+}
diff --git a/org.eclipse.osbp.ecview.extension.presentation.vaadin.tests/src/org/eclipse/osbp/ecview/extension/presentation/tests/strategy/DefaultUI.java b/org.eclipse.osbp.ecview.extension.presentation.vaadin.tests/src/org/eclipse/osbp/ecview/extension/presentation/tests/strategy/DefaultUI.java
new file mode 100644
index 0000000..9045bdb
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.presentation.vaadin.tests/src/org/eclipse/osbp/ecview/extension/presentation/tests/strategy/DefaultUI.java
@@ -0,0 +1,74 @@
+/**
+ *
+ * Copyright (c) 2011, 2016 - Loetz GmbH&Co.KG (69115 Heidelberg, Germany)
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Christophe Loetz (Loetz GmbH&Co.KG) - initial implementation
+ *
+ */
+ package org.eclipse.osbp.ecview.extension.presentation.tests.strategy;
+
+import java.util.concurrent.ExecutionException;
+import java.util.concurrent.Future;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.TimeoutException;
+
+import com.vaadin.server.VaadinRequest;
+import com.vaadin.ui.UI;
+import com.vaadin.ui.UIDetachedException;
+
+@SuppressWarnings("serial")
+public class DefaultUI extends UI {
+
+ @Override
+ protected void init(VaadinRequest request) {
+
+ }
+
+ @Override
+ public void accessSynchronously(Runnable runnable)
+ throws UIDetachedException {
+ runnable.run();
+ }
+
+ @Override
+ public Future<Void> access(Runnable runnable) {
+ runnable.run();
+ return new InternalFuture();
+ }
+
+ private static class InternalFuture implements Future<Void> {
+
+ @Override
+ public boolean cancel(boolean mayInterruptIfRunning) {
+ return false;
+ }
+
+ @Override
+ public boolean isCancelled() {
+ return false;
+ }
+
+ @Override
+ public boolean isDone() {
+ return true;
+ }
+
+ @Override
+ public Void get() throws InterruptedException, ExecutionException {
+ return null;
+ }
+
+ @Override
+ public Void get(long timeout, TimeUnit unit)
+ throws InterruptedException, ExecutionException,
+ TimeoutException {
+ return null;
+ }
+ }
+}
diff --git a/org.eclipse.osbp.ecview.extension.presentation.vaadin.tests/src/org/eclipse/osbp/ecview/extension/presentation/tests/strategy/DefaultViewContext.java b/org.eclipse.osbp.ecview.extension.presentation.vaadin.tests/src/org/eclipse/osbp/ecview/extension/presentation/tests/strategy/DefaultViewContext.java
new file mode 100644
index 0000000..579ac43
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.presentation.vaadin.tests/src/org/eclipse/osbp/ecview/extension/presentation/tests/strategy/DefaultViewContext.java
@@ -0,0 +1,23 @@
+/**
+ *
+ * Copyright (c) 2011, 2016 - Loetz GmbH&Co.KG (69115 Heidelberg, Germany)
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Christophe Loetz (Loetz GmbH&Co.KG) - initial implementation
+ *
+ */
+ package org.eclipse.osbp.ecview.extension.presentation.tests.strategy;
+
+import org.eclipse.osbp.ecview.core.common.context.ViewContext;
+
+public class DefaultViewContext extends ViewContext {
+
+ public DefaultViewContext(){
+
+ }
+}
diff --git a/org.eclipse.osbp.ecview.extension.presentation.vaadin.tests/src/org/eclipse/osbp/ecview/extension/presentation/tests/strategy/Foo.java b/org.eclipse.osbp.ecview.extension.presentation.vaadin.tests/src/org/eclipse/osbp/ecview/extension/presentation/tests/strategy/Foo.java
new file mode 100644
index 0000000..0310ea9
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.presentation.vaadin.tests/src/org/eclipse/osbp/ecview/extension/presentation/tests/strategy/Foo.java
@@ -0,0 +1,218 @@
+/**
+ *
+ * Copyright (c) 2015 - 2016 - Loetz GmbH&Co.KG, 69115 Heidelberg, Germany
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Loetz GmbH&Co.KG - Initial implementation
+ *
+ */
+ package org.eclipse.osbp.ecview.extension.presentation.tests.strategy;
+
+import java.beans.PropertyChangeListener;
+import java.beans.PropertyChangeSupport;
+import java.io.Serializable;
+import java.util.Collections;
+import java.util.List;
+
+@SuppressWarnings("serial")
+public class Foo implements Serializable {
+ private PropertyChangeSupport propertyChangeSupport = new PropertyChangeSupport(
+ this);
+
+ private boolean disposed;
+
+ private String name;
+
+ private List<Bar> mybars;
+
+ /**
+ * Returns true, if the object is disposed. Disposed means, that it is
+ * prepared for garbage collection and may not be used anymore. Accessing
+ * objects that are already disposed will cause runtime exceptions.
+ */
+ public boolean isDisposed() {
+ return this.disposed;
+ }
+
+ /**
+ * @see PropertyChangeSupport#addPropertyChangeListener(PropertyChangeListener)
+ */
+ public void addPropertyChangeListener(final PropertyChangeListener listener) {
+ propertyChangeSupport.addPropertyChangeListener(listener);
+ }
+
+ /**
+ * @see PropertyChangeSupport#addPropertyChangeListener(String,
+ * PropertyChangeListener)
+ */
+ public void addPropertyChangeListener(final String propertyName,
+ final PropertyChangeListener listener) {
+ propertyChangeSupport.addPropertyChangeListener(propertyName, listener);
+ }
+
+ /**
+ * @see PropertyChangeSupport#removePropertyChangeListener(PropertyChangeListener)
+ */
+ public void removePropertyChangeListener(
+ final PropertyChangeListener listener) {
+ propertyChangeSupport.removePropertyChangeListener(listener);
+ }
+
+ /**
+ * @see PropertyChangeSupport#removePropertyChangeListener(String,
+ * PropertyChangeListener)
+ */
+ public void removePropertyChangeListener(final String propertyName,
+ final PropertyChangeListener listener) {
+ propertyChangeSupport.removePropertyChangeListener(propertyName,
+ listener);
+ }
+
+ /**
+ * @see PropertyChangeSupport#firePropertyChange(String, Object, Object)
+ */
+ public void firePropertyChange(final String propertyName,
+ final Object oldValue, final Object newValue) {
+ propertyChangeSupport.firePropertyChange(propertyName, oldValue,
+ newValue);
+ }
+
+ /**
+ * Checks whether the object is disposed.
+ *
+ * @throws RuntimeException
+ * if the object is disposed.
+ */
+ private void checkDisposed() {
+ if (isDisposed()) {
+ throw new RuntimeException("Object already disposed: " + this);
+ }
+ }
+
+ /**
+ * Calling dispose will destroy that instance. The internal state will be
+ * set to 'disposed' and methods of that object must not be used anymore.
+ * Each call will result in runtime exceptions.
+ * If this object keeps composition containments, these will be disposed
+ * too. So the whole composition containment tree will be disposed on
+ * calling this method.
+ */
+ public void dispose() {
+ if (isDisposed()) {
+ return;
+ }
+ try {
+ // Dispose all the composition references.
+ if (this.mybars != null) {
+ for (Bar bar : this.mybars) {
+ bar.dispose();
+ }
+ this.mybars = null;
+ }
+
+ } finally {
+ disposed = true;
+ }
+
+ }
+
+ /**
+ * Returns the name property or <code>null</code> if not present.
+ */
+ public String getName() {
+ checkDisposed();
+ return this.name;
+ }
+
+ /**
+ * Sets the <code>name</code> property to this instance.
+ *
+ * @param name
+ * - the property
+ * @throws RuntimeException
+ * if instance is <code>disposed</code>
+ *
+ */
+ public void setName(final String name) {
+ firePropertyChange("name", this.name, this.name = name);
+ }
+
+ /**
+ * Returns an unmodifiable list of mybars.
+ */
+ public List<Bar> getMybars() {
+ checkDisposed();
+ return Collections.unmodifiableList(internalGetMybars());
+ }
+
+ /**
+ * Returns the list of <code>bar</code>s thereby lazy initializing it. For
+ * internal use only!
+ *
+ * @return list - the resulting list
+ *
+ */
+ private List<Bar> internalGetMybars() {
+ if (this.mybars == null) {
+ this.mybars = new java.util.ArrayList<Bar>();
+ }
+ return this.mybars;
+ }
+
+ /**
+ * Adds the given bar to this object.
+ * <p>
+ * Since the reference is a composition reference, the opposite reference
+ * <code>bar#myfoo</code> of the <code>bar</code> will be handled
+ * automatically and no further coding is required to keep them in sync.
+ * <p>
+ * See {@link bar#setMyfoo(bar)}.
+ *
+ * @param bar
+ * - the property
+ * @throws RuntimeException
+ * if instance is <code>disposed</code>
+ *
+ */
+ public void addToMybars(final Bar bar) {
+ checkDisposed();
+ bar.setMyfoo(this);
+ }
+
+ /**
+ * Removes the given bar from this object.
+ * <p>
+ * Since the reference is a cascading reference, the opposite reference
+ * (bar.myfoo) of the bar will be handled automatically and no further
+ * coding is required to keep them in sync. See {@link bar#setMyfoo(bar)}.
+ *
+ * @param bar
+ * - the property
+ * @throws RuntimeException
+ * if instance is <code>disposed</code>
+ *
+ */
+ public void removeFromMybars(final Bar bar) {
+ checkDisposed();
+ bar.setMyfoo(null);
+ }
+
+ /**
+ * For internal use only!
+ */
+ public void internalAddToMybars(final Bar bar) {
+ internalGetMybars().add(bar);
+ }
+
+ /**
+ * For internal use only!
+ */
+ public void internalRemoveFromMybars(final Bar bar) {
+ internalGetMybars().remove(bar);
+ }
+}
diff --git a/org.eclipse.osbp.ecview.extension.presentation.vaadin.tests/src/org/eclipse/osbp/ecview/extension/presentation/tests/strategy/I18nServiceForTests.java b/org.eclipse.osbp.ecview.extension.presentation.vaadin.tests/src/org/eclipse/osbp/ecview/extension/presentation/tests/strategy/I18nServiceForTests.java
new file mode 100644
index 0000000..dcf0e75
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.presentation.vaadin.tests/src/org/eclipse/osbp/ecview/extension/presentation/tests/strategy/I18nServiceForTests.java
@@ -0,0 +1,70 @@
+/**
+ *
+ * Copyright (c) 2015 - 2016 - Loetz GmbH&Co.KG, 69115 Heidelberg, Germany
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Loetz GmbH&Co.KG - Initial implementation
+ *
+ */
+ package org.eclipse.osbp.ecview.extension.presentation.tests.strategy;
+
+import java.util.Locale;
+
+import org.eclipse.osbp.runtime.common.dispose.AbstractDisposable;
+import org.eclipse.osbp.runtime.common.i18n.II18nService;
+
+/**
+ * A test I18n service.
+ */
+public class I18nServiceForTests extends AbstractDisposable implements
+ II18nService {
+
+ public static final String KEY__NAME = "tests.name";
+ public static final String KEY__AGE = "tests.age";
+ public static final String KEY__VALUE = "tests.value";
+
+ @Override
+ public String getValue(String i18nKey, Locale locale) {
+
+ if (locale == Locale.GERMAN) {
+ return getGerman(i18nKey);
+ } else if (locale == Locale.ENGLISH) {
+ return getEnglish(i18nKey);
+ }
+
+ return getEnglish(i18nKey);
+ }
+
+ private String getEnglish(String i18nKey) {
+ if (i18nKey.equals(KEY__NAME)) {
+ return "Name";
+ } else if (i18nKey.equals(KEY__AGE)) {
+ return "Age";
+ } else if (i18nKey.equals(KEY__VALUE)) {
+ return "Value";
+ } else
+ return "";
+ }
+
+ private String getGerman(String i18nKey) {
+ if (i18nKey.equals(KEY__NAME)) {
+ return "Name";
+ } else if (i18nKey.equals(KEY__AGE)) {
+ return "Alter";
+ } else if (i18nKey.equals(KEY__VALUE)) {
+ return "Wert";
+ } else
+ return "";
+ }
+
+ @Override
+ protected void internalDispose() {
+
+ }
+
+}
diff --git a/org.eclipse.osbp.ecview.extension.presentation.vaadin.tests/src/org/eclipse/osbp/ecview/extension/presentation/tests/strategy/RichTextAreaTests.java b/org.eclipse.osbp.ecview.extension.presentation.vaadin.tests/src/org/eclipse/osbp/ecview/extension/presentation/tests/strategy/RichTextAreaTests.java
new file mode 100644
index 0000000..1948c0f
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.presentation.vaadin.tests/src/org/eclipse/osbp/ecview/extension/presentation/tests/strategy/RichTextAreaTests.java
@@ -0,0 +1,772 @@
+/**
+ *
+ * Copyright (c) 2011, 2016 - Loetz GmbH&Co.KG (69115 Heidelberg, Germany)
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Christophe Loetz (Loetz GmbH&Co.KG) - initial implementation
+ *
+ */
+package org.eclipse.osbp.ecview.extension.presentation.tests.strategy;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
+import java.util.Base64;
+import java.util.Base64.Decoder;
+import java.util.Base64.Encoder;
+import java.util.HashMap;
+import java.util.Locale;
+import java.util.Map;
+
+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.editpart.DelegatingEditPartManager;
+import org.eclipse.osbp.ecview.core.common.editpart.IConverterEditpart;
+import org.eclipse.osbp.ecview.core.common.model.binding.YBeanValueBindingEndpoint;
+import org.eclipse.osbp.ecview.core.common.model.binding.YBindingSet;
+import org.eclipse.osbp.ecview.core.common.model.binding.YBindingUpdateStrategy;
+import org.eclipse.osbp.ecview.core.common.model.core.CoreModelFactory;
+import org.eclipse.osbp.ecview.core.common.model.core.YBeanSlot;
+import org.eclipse.osbp.ecview.core.common.model.core.YBeanSlotValueBindingEndpoint;
+import org.eclipse.osbp.ecview.core.common.model.core.YDelegateConverter;
+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.model.validation.ValidationFactory;
+import org.eclipse.osbp.ecview.core.common.model.validation.YMinLengthValidator;
+import org.eclipse.osbp.ecview.core.common.presentation.DelegatingConverterFactory;
+import org.eclipse.osbp.ecview.core.common.presentation.IConverterFactory;
+import org.eclipse.osbp.ecview.core.common.presentation.IWidgetPresentation;
+import org.eclipse.osbp.ecview.core.extension.model.extension.YGridLayout;
+import org.eclipse.osbp.ecview.core.extension.model.extension.util.SimpleExtensionModelFactory;
+import org.eclipse.osbp.ecview.extension.editparts.IRichTextAreaEditpart;
+import org.eclipse.osbp.ecview.extension.model.YECviewFactory;
+import org.eclipse.osbp.ecview.extension.model.YRichTextArea;
+import org.eclipse.osbp.runtime.common.i18n.II18nService;
+import org.eclipse.osbp.runtime.web.ecview.presentation.vaadin.VaadinRenderer;
+import org.eclipse.osbp.runtime.web.ecview.presentation.vaadin.common.AbstractFieldWidgetPresenter;
+import org.eclipse.osbp.runtime.web.ecview.presentation.vaadin.common.AbstractVaadinWidgetPresenter;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.osgi.framework.BundleException;
+import org.osgi.service.cm.ConfigurationException;
+
+import com.vaadin.data.util.converter.Converter;
+import com.vaadin.ui.Component;
+import com.vaadin.ui.CssLayout;
+import com.vaadin.ui.RichTextArea;
+import com.vaadin.ui.UI;
+
+/**
+ * Tests the {@link RichTextAreaPresentation}.
+ */
+public class RichTextAreaTests {
+
+ private SimpleExtensionModelFactory factory = new SimpleExtensionModelFactory();
+ private YECviewFactory cxFactory = YECviewFactory.eINSTANCE;
+ private CssLayout rootLayout = new CssLayout();
+
+ private Encoder encoder = Base64.getEncoder();
+ private Decoder decoder = Base64.getDecoder();
+
+ /**
+ * Setup tests.
+ *
+ * @throws ConfigurationException
+ * @throws BundleException
+ */
+ @Before
+ public void setup() throws ConfigurationException, BundleException {
+ UI.setCurrent(new DefaultUI());
+ UI.getCurrent().setContent(rootLayout);
+ }
+
+ @After
+ public void after() {
+ DelegatingConverterFactory.getInstance().clear();
+ }
+
+ /**
+ * Tests rendering issues.
+ *
+ * @throws Exception
+ */
+ @Test
+ // BEGIN SUPRESS CATCH EXCEPTION
+ public void test_isRendered_unrender_byModel() throws Exception {
+ // END SUPRESS CATCH EXCEPTION
+ // build the view model
+ // ...> yView
+ // ......> yGridLayout
+ // .........> yText
+ YView yView = factory.createView();
+ YGridLayout yGridlayout = factory.createGridLayout();
+ yView.setContent(yGridlayout);
+ YRichTextArea yText = cxFactory.createYRichTextArea();
+ yGridlayout.getElements().add(yText);
+
+ VaadinRenderer renderer = new VaadinRenderer();
+ IViewContext viewContext = renderer.render(rootLayout, yView, null);
+
+ IRichTextAreaEditpart textEditpart = DelegatingEditPartManager
+ .getInstance().getEditpart(viewContext, yText);
+ IWidgetPresentation<Component> presentation = textEditpart
+ .getPresentation();
+ assertTrue(presentation.isRendered());
+ assertFalse(presentation.isDisposed());
+
+ yGridlayout.getElements().remove(yText);
+ assertFalse(presentation.isRendered());
+ assertFalse(presentation.isDisposed());
+ }
+
+ /**
+ * Tests the internal structure.
+ *
+ * @throws Exception
+ */
+ @Test
+ // BEGIN SUPRESS CATCH EXCEPTION
+ public void test_InternalStructure() throws Exception {
+ // END SUPRESS CATCH EXCEPTION
+ // build the view model
+ // ...> yView
+ // ......> yText
+ YView yView = factory.createView();
+ YRichTextArea yText = cxFactory.createYRichTextArea();
+ yView.setContent(yText);
+
+ VaadinRenderer renderer = new VaadinRenderer();
+ IViewContext viewContext = renderer.render(rootLayout, yView, null);
+
+ IRichTextAreaEditpart textEditpart = DelegatingEditPartManager
+ .getInstance().getEditpart(viewContext, yText);
+ IWidgetPresentation<Component> presentation = textEditpart
+ .getPresentation();
+
+ RichTextArea text = (RichTextArea) presentation.getWidget();
+ ;
+ assertNotNull(text);
+ }
+
+ /**
+ * Test the internal structure based on CSS.
+ *
+ * @throws Exception
+ */
+ @Test
+ // BEGIN SUPRESS CATCH EXCEPTION
+ public void test_InternalStructure__CSS() throws Exception {
+ // END SUPRESS CATCH EXCEPTION
+ // build the view model
+ // ...> yView
+ // ......> yText
+ YView yView = factory.createView();
+ YGridLayout yLayout = factory.createGridLayout();
+ yView.setContent(yLayout);
+ YRichTextArea yText1 = cxFactory.createYRichTextArea();
+ yText1.setCssID("ID_0815");
+ yText1.setCssClass("anyOtherClass");
+ yLayout.getElements().add(yText1);
+ YRichTextArea yText2 = cxFactory.createYRichTextArea();
+ yLayout.getElements().add(yText2);
+
+ VaadinRenderer renderer = new VaadinRenderer();
+ IViewContext viewContext = renderer.render(rootLayout, yView, null);
+
+ IRichTextAreaEditpart text1Editpart = DelegatingEditPartManager
+ .getInstance().getEditpart(viewContext, yText1);
+ IRichTextAreaEditpart text2Editpart = DelegatingEditPartManager
+ .getInstance().getEditpart(viewContext, yText2);
+ IWidgetPresentation<Component> text1Presentation = text1Editpart
+ .getPresentation();
+ IWidgetPresentation<Component> text2Presentation = text2Editpart
+ .getPresentation();
+
+ RichTextArea text1 = (RichTextArea) text1Presentation.getWidget();
+ RichTextArea text2 = (RichTextArea) text2Presentation.getWidget();
+
+ // assert css class
+
+ assertTrue(text1.getStyleName().contains("anyOtherClass"));
+ assertTrue(text2.getStyleName().contains(
+ AbstractVaadinWidgetPresenter.CSS_CLASS_CONTROL));
+
+ // assert css id
+ assertEquals("ID_0815", text1.getId());
+ assertEquals(text2Editpart.getId(), text2.getId());
+ }
+
+ /**
+ * Test the internal structure based on CSS.
+ *
+ * @throws Exception
+ */
+ @Test
+ // BEGIN SUPRESS CATCH EXCEPTION
+ public void test_Bindings() throws Exception {
+ // END SUPRESS CATCH EXCEPTION
+ // build the view model
+ // ...> yView
+ // ......> yText
+ YView yView = factory.createView();
+ YGridLayout yLayout = factory.createGridLayout();
+ yView.setContent(yLayout);
+ YRichTextArea yText1 = cxFactory.createYRichTextArea();
+ yLayout.getElements().add(yText1);
+ YRichTextArea yText2 = cxFactory.createYRichTextArea();
+ yLayout.getElements().add(yText2);
+
+ VaadinRenderer renderer = new VaadinRenderer();
+ IViewContext viewContext = renderer.render(rootLayout, yView, null);
+
+ IRichTextAreaEditpart text1Editpart = DelegatingEditPartManager
+ .getInstance().getEditpart(viewContext, yText1);
+ IRichTextAreaEditpart text2Editpart = DelegatingEditPartManager
+ .getInstance().getEditpart(viewContext, yText2);
+ IWidgetPresentation<Component> text1Presentation = text1Editpart
+ .getPresentation();
+ IWidgetPresentation<Component> text2Presentation = text2Editpart
+ .getPresentation();
+ RichTextArea text1 = (RichTextArea) text1Presentation.getWidget();
+ ;
+ RichTextArea text2 = (RichTextArea) text2Presentation.getWidget();
+ ;
+
+ // start tests
+ //
+ yText1.setValue("");
+ yText2.setValue("");
+
+ assertTrue(text1.isVisible());
+ assertTrue(text1.isEnabled());
+ assertFalse(text1.isReadOnly());
+ assertEquals("", text1.getValue());
+
+ assertTrue(text2.isVisible());
+ assertTrue(text2.isEnabled());
+ assertFalse(text2.isReadOnly());
+ assertEquals("", text2.getValue());
+
+ yText1.setVisible(false);
+ assertFalse(text1.isVisible());
+
+ yText1.setEnabled(false);
+ assertFalse(text1.isEnabled());
+
+ yText1.setEditable(false);
+ assertTrue(text1.isReadOnly());
+
+ // target to model
+ text1.setReadOnly(false);
+ assertTrue(yText1.isEditable());
+
+ yText1.setValue("huhu");
+ yText2.setValue("haha");
+ assertEquals("huhu", text1.getValue());
+ assertEquals("haha", text2.getValue());
+
+ }
+
+ @Test
+ // BEGIN SUPRESS CATCH EXCEPTION
+ public void test_Readonly_Binding() throws Exception {
+ // END SUPRESS CATCH EXCEPTION
+ // build the view model
+ YView yView = factory.createView();
+ YGridLayout yLayout = factory.createGridLayout();
+ yView.setContent(yLayout);
+ YRichTextArea yText = cxFactory.createYRichTextArea();
+ yLayout.getElements().add(yText);
+
+ VaadinRenderer renderer = new VaadinRenderer();
+ IViewContext viewContext = renderer.render(rootLayout, yView, null);
+
+ IRichTextAreaEditpart textEditpart = DelegatingEditPartManager
+ .getInstance().getEditpart(viewContext, yText);
+ IWidgetPresentation<Component> textPresentation = textEditpart
+ .getPresentation();
+ RichTextArea text = (RichTextArea) textPresentation.getWidget();
+
+ ValueBean bean = new ValueBean(false);
+ YBeanValueBindingEndpoint yBeanBinding = factory
+ .createBeanBindingEndpoint();
+ yBeanBinding.setBean(bean);
+ yBeanBinding.setPropertyPath("boolValue");
+ YBindingSet yBindingSet = yView.getOrCreateBindingSet();
+ yBindingSet.addBinding(yText.createEditableEndpoint(), yBeanBinding);
+
+ // test binding
+ assertFalse(yText.isEditable());
+ assertFalse(!text.isReadOnly());
+ assertFalse(bean.isBoolValue());
+
+ bean.setBoolValue(true);
+ assertTrue(yText.isEditable());
+ assertTrue(!text.isReadOnly());
+ assertTrue(bean.isBoolValue());
+ }
+
+ @Test
+ // BEGIN SUPRESS CATCH EXCEPTION
+ public void test_Visible_Binding() throws Exception {
+ // END SUPRESS CATCH EXCEPTION
+ // build the view model
+ YView yView = factory.createView();
+ YGridLayout yLayout = factory.createGridLayout();
+ yView.setContent(yLayout);
+ YRichTextArea yText = cxFactory.createYRichTextArea();
+ yLayout.getElements().add(yText);
+
+ VaadinRenderer renderer = new VaadinRenderer();
+ IViewContext viewContext = renderer.render(rootLayout, yView, null);
+
+ IRichTextAreaEditpart textEditpart = DelegatingEditPartManager
+ .getInstance().getEditpart(viewContext, yText);
+ IWidgetPresentation<Component> textPresentation = textEditpart
+ .getPresentation();
+ RichTextArea text = (RichTextArea) textPresentation.getWidget();
+
+ ValueBean bean = new ValueBean(false);
+ YBeanValueBindingEndpoint yBeanBinding = factory
+ .createBeanBindingEndpoint();
+ yBeanBinding.setBean(bean);
+ yBeanBinding.setPropertyPath("boolValue");
+ YBindingSet yBindingSet = yView.getOrCreateBindingSet();
+ yBindingSet.addBinding(yText.createVisibleEndpoint(), yBeanBinding);
+
+ // test binding
+ assertFalse(yText.isVisible());
+ assertFalse(text.isVisible());
+ assertFalse(bean.isBoolValue());
+
+ bean.setBoolValue(true);
+ assertTrue(yText.isVisible());
+ assertTrue(text.isVisible());
+ assertTrue(bean.isBoolValue());
+ }
+
+ @Test
+ // BEGIN SUPRESS CATCH EXCEPTION
+ public void test_Enabled_Binding() throws Exception {
+ // END SUPRESS CATCH EXCEPTION
+ // build the view model
+ YView yView = factory.createView();
+ YGridLayout yLayout = factory.createGridLayout();
+ yView.setContent(yLayout);
+ YRichTextArea yText = cxFactory.createYRichTextArea();
+ yLayout.getElements().add(yText);
+
+ VaadinRenderer renderer = new VaadinRenderer();
+ IViewContext viewContext = renderer.render(rootLayout, yView, null);
+
+ IRichTextAreaEditpart textEditpart = DelegatingEditPartManager
+ .getInstance().getEditpart(viewContext, yText);
+ IWidgetPresentation<Component> textPresentation = textEditpart
+ .getPresentation();
+ RichTextArea text = (RichTextArea) textPresentation.getWidget();
+
+ ValueBean bean = new ValueBean(false);
+ YBeanValueBindingEndpoint yBeanBinding = factory
+ .createBeanBindingEndpoint();
+ yBeanBinding.setBean(bean);
+ yBeanBinding.setPropertyPath("boolValue");
+ YBindingSet yBindingSet = yView.getOrCreateBindingSet();
+ yBindingSet.addBinding(yText.createEnabledEndpoint(), yBeanBinding);
+
+ // test binding
+ assertFalse(yText.isEnabled());
+ assertFalse(text.isEnabled());
+ assertFalse(bean.isBoolValue());
+
+ bean.setBoolValue(true);
+ assertTrue(yText.isEnabled());
+ assertTrue(text.isEnabled());
+ assertTrue(bean.isBoolValue());
+ }
+
+ @Test
+ // BEGIN SUPRESS CATCH EXCEPTION
+ public void test_ValueBinding() throws Exception {
+ // END SUPRESS CATCH EXCEPTION
+ // build the view model
+ // ...> yView
+ // ......> yText
+ YView yView = factory.createView();
+ YGridLayout yLayout = factory.createGridLayout();
+ yView.setContent(yLayout);
+ YRichTextArea yText1 = cxFactory.createYRichTextArea();
+ yLayout.getElements().add(yText1);
+
+ VaadinRenderer renderer = new VaadinRenderer();
+ IViewContext viewContext = renderer.render(rootLayout, yView, null);
+
+ IRichTextAreaEditpart text1Editpart = DelegatingEditPartManager
+ .getInstance().getEditpart(viewContext, yText1);
+ IWidgetPresentation<Component> text1Presentation = text1Editpart
+ .getPresentation();
+ RichTextArea text1 = (RichTextArea) text1Presentation.getWidget();
+
+ // start tests
+ //
+ YBindingSet yBindingSet = yView.getOrCreateBindingSet();
+
+ yText1.setValue("");
+ YBeanValueBindingEndpoint beanBinding = factory
+ .createBeanBindingEndpoint();
+ ValueBean bean = new ValueBean("Huhu");
+ beanBinding.setPropertyPath("value");
+ beanBinding.setBean(bean);
+ yBindingSet.addBinding(yText1.createValueEndpoint(), beanBinding);
+ assertEquals("Huhu", text1.getValue());
+ assertEquals("Huhu", yText1.getValue());
+
+ bean.setValue("Haha");
+ assertEquals("Haha", text1.getValue());
+ assertEquals("Haha", yText1.getValue());
+
+ text1.setValue("Haha1");
+ assertEquals("Haha1", bean.getValue());
+ assertEquals("Haha1", yText1.getValue());
+
+ yText1.setValue("Haha2");
+ assertEquals("Haha2", bean.getValue());
+ assertEquals("Haha2", text1.getValue());
+ }
+
+ /**
+ * Test the automatic disposal of bindings
+ *
+ * @throws ContextException
+ */
+ @Test
+ public void testBindingIsDisposed() throws ContextException {
+ YView yView = factory.createView();
+ YGridLayout yGridlayout = factory.createGridLayout();
+ yView.setContent(yGridlayout);
+ YRichTextArea yText = cxFactory.createYRichTextArea();
+ yGridlayout.getElements().add(yText);
+
+ VaadinRenderer renderer = new VaadinRenderer();
+ IViewContext viewContext = renderer.render(rootLayout, yView, null);
+
+ IRichTextAreaEditpart textEditpart = DelegatingEditPartManager
+ .getInstance().getEditpart(viewContext, yText);
+ IWidgetPresentation<Component> presentation = textEditpart
+ .getPresentation();
+ assertTrue(presentation.isRendered());
+ assertFalse(presentation.isDisposed());
+ assertEquals(4, presentation.getUIBindings().size());
+
+ presentation.dispose();
+ assertFalse(presentation.isRendered());
+ assertTrue(presentation.isDisposed());
+ assertEquals(0, presentation.getUIBindings().size());
+ }
+
+ @Test
+ public void test_addRemoveValidatorByModel() throws ContextException {
+ YView yView = factory.createView();
+ YGridLayout yGridlayout = factory.createGridLayout();
+ yView.setContent(yGridlayout);
+ YRichTextArea yText = cxFactory.createYRichTextArea();
+ yGridlayout.getElements().add(yText);
+
+ VaadinRenderer renderer = new VaadinRenderer();
+ IViewContext viewContext = renderer.render(rootLayout, yView, null);
+ IRichTextAreaEditpart textEditpart = DelegatingEditPartManager
+ .getInstance().getEditpart(viewContext, yText);
+ AbstractFieldWidgetPresenter<Component> presentation = textEditpart
+ .getPresentation();
+
+ assertEquals(0, yText.getValidators().size());
+ assertEquals(0, presentation.getValidators().size());
+
+ ValidationFactory vf = ValidationFactory.eINSTANCE;
+ YMinLengthValidator yValidator = vf.createYMinLengthValidator();
+ yText.getValidators().add(yValidator);
+
+ assertEquals(1, presentation.getValidators().size());
+ assertEquals(1, yText.getValidators().size());
+
+ yText.getValidators().remove(yValidator);
+ assertEquals(0, yText.getValidators().size());
+ assertEquals(0, presentation.getValidators().size());
+
+ }
+
+ @Test
+ public void test_addRemoveValidatorByModel_Twice() throws ContextException {
+ YView yView = factory.createView();
+ YGridLayout yGridlayout = factory.createGridLayout();
+ yView.setContent(yGridlayout);
+ YRichTextArea yText = cxFactory.createYRichTextArea();
+ yGridlayout.getElements().add(yText);
+
+ VaadinRenderer renderer = new VaadinRenderer();
+ IViewContext viewContext = renderer.render(rootLayout, yView, null);
+ IRichTextAreaEditpart textEditpart = DelegatingEditPartManager
+ .getInstance().getEditpart(viewContext, yText);
+ AbstractFieldWidgetPresenter<Component> presentation = textEditpart
+ .getPresentation();
+
+ assertEquals(0, yText.getValidators().size());
+ assertEquals(0, presentation.getValidators().size());
+
+ ValidationFactory vf = ValidationFactory.eINSTANCE;
+ YMinLengthValidator yValidator = vf.createYMinLengthValidator();
+ yText.getValidators().add(yValidator);
+ yText.getValidators().add(yValidator);
+
+ assertEquals(1, presentation.getValidators().size());
+ assertEquals(1, yText.getValidators().size());
+
+ yText.getValidators().remove(yValidator);
+ yText.getValidators().remove(yValidator);
+ assertEquals(0, yText.getValidators().size());
+ assertEquals(0, presentation.getValidators().size());
+
+ }
+
+ @Test
+ public void test_i18n() throws ContextException {
+
+ // switch the global locale to german
+ Locale.setDefault(Locale.GERMAN);
+
+ YView yView = factory.createView();
+ YGridLayout yGridlayout = factory.createGridLayout();
+ yView.setContent(yGridlayout);
+ YRichTextArea yText = cxFactory.createYRichTextArea();
+ yGridlayout.getElements().add(yText);
+
+ // set the i18n key
+ yText.setLabelI18nKey(I18nServiceForTests.KEY__AGE);
+
+ // prepare the I18nService and pass it to the renderer
+ Map<String, Object> parameter = new HashMap<String, Object>();
+ Map<String, Object> services = new HashMap<String, Object>();
+ parameter.put(IViewContext.PARAM_SERVICES, services);
+ services.put(II18nService.ID, new I18nServiceForTests());
+
+ VaadinRenderer renderer = new VaadinRenderer();
+ IViewContext viewContext = renderer
+ .render(rootLayout, yView, parameter);
+ IRichTextAreaEditpart textEditpart = DelegatingEditPartManager
+ .getInstance().getEditpart(viewContext, yText);
+ AbstractFieldWidgetPresenter<Component> presentation = textEditpart
+ .getPresentation();
+
+ assertEquals("Alter", presentation.getWidget().getCaption());
+
+ viewContext.setLocale(Locale.ENGLISH);
+ assertEquals("Age", presentation.getWidget().getCaption());
+ }
+
+ /**
+ * If a richTextArea is bound to a beanslot and a new bean with the same
+ * hashcode and values is set to the slot, then the databinding is not
+ * refreshed and the old bean instance is still bound.
+ *
+ * @throws ContextException
+ */
+ @Test
+ public void fix_MP76() throws ContextException {
+ YView yView = factory.createView();
+ YBeanSlot yBeanSlot = factory.createBeanSlot();
+ yBeanSlot.setName("main");
+ yBeanSlot.setValueType(BarHashById.class);
+ yView.getBeanSlots().add(yBeanSlot);
+ YGridLayout yLayout = factory.createGridLayout();
+ yView.setContent(yLayout);
+ YRichTextArea yText = cxFactory.createYRichTextArea();
+ yLayout.getElements().add(yText);
+
+ YBeanSlotValueBindingEndpoint slotEP = yBeanSlot
+ .createBindingEndpoint("name");
+ YEmbeddableValueEndpoint textEP = yText.createValueEndpoint();
+
+ YBindingSet yBindingSet = yView.getOrCreateBindingSet();
+ yBindingSet.addBinding(textEP, slotEP, YBindingUpdateStrategy.UPDATE,
+ YBindingUpdateStrategy.UPDATE);
+
+ VaadinRenderer renderer = new VaadinRenderer();
+ IViewContext viewContext = renderer.render(rootLayout, yView, null);
+
+ IRichTextAreaEditpart textEditpart = DelegatingEditPartManager
+ .getInstance().getEditpart(viewContext, yText);
+ IWidgetPresentation<Component> textPresentation = textEditpart
+ .getPresentation();
+ RichTextArea text = (RichTextArea) textPresentation.getWidget();
+
+ BarHashById bean = new BarHashById("112233");
+ bean.setName("OSBP");
+ viewContext.setBean("main", bean);
+
+ // ensure field is bound to bean
+ assertEquals("OSBP", text.getValue());
+ assertEquals("OSBP", bean.getName());
+
+ BarHashById bean2 = new BarHashById("112233");
+ bean2.setName("OSBP");
+ viewContext.setBean("main", bean2);
+
+ // ensure field is bound to bean2
+ assertEquals("OSBP", bean2.getName());
+ assertEquals("OSBP", text.getValue());
+
+ text.setValue("Huhu");
+ assertEquals("OSBP", bean.getName());
+ assertEquals("Huhu", bean2.getName());
+ assertEquals("Huhu", text.getValue());
+
+ }
+
+ /**
+ * Tests rendering issues.
+ *
+ * @throws Exception
+ */
+ @Test
+ // BEGIN SUPRESS CATCH EXCEPTION
+ public void test_Converter() throws Exception {
+ // END SUPRESS CATCH EXCEPTION
+ // build the view model
+ // ...> yView
+ // ......> yGridLayout
+ // .........> yText
+ YView yView = factory.createView();
+ YGridLayout yGridlayout = factory.createGridLayout();
+ yView.setContent(yGridlayout);
+ YRichTextArea yText = cxFactory.createYRichTextArea();
+ YDelegateConverter yConverter = CoreModelFactory.eINSTANCE
+ .createYDelegateConverter();
+ yConverter.setConverterId("text.test");
+ yText.setConverter(yConverter);
+ yGridlayout.getElements().add(yText);
+
+ DelegatingConverterFactory.getInstance().addDelegate(
+ new ConverterFactory());
+
+ VaadinRenderer renderer = new VaadinRenderer();
+ IViewContext viewContext = renderer.render(rootLayout, yView, null);
+
+ IRichTextAreaEditpart textEditpart = DelegatingEditPartManager
+ .getInstance().getEditpart(viewContext, yText);
+ IWidgetPresentation<Component> presentation = textEditpart
+ .getPresentation();
+ RichTextArea text = (RichTextArea) presentation.getWidget();
+
+ yText.setValue("Huhu");
+ assertEquals("Huhu", yText.getValue());
+ assertEquals("Huhu XX", text.getValue());
+
+ text.setValue("Haha XX");
+ assertEquals("Haha", yText.getValue());
+ assertEquals("Haha XX", text.getValue());
+ }
+
+ @Test
+ // BEGIN SUPRESS CATCH EXCEPTION
+ public void test_BlobValueBinding() throws Exception {
+ // END SUPRESS CATCH EXCEPTION
+ // build the view model
+ // ...> yView
+ // ......> yText
+ YView yView = factory.createView();
+ YGridLayout yLayout = factory.createGridLayout();
+ yView.setContent(yLayout);
+ YRichTextArea yText1 = cxFactory.createYRichTextArea();
+ yText1.setUseBlob(true);
+ yLayout.getElements().add(yText1);
+
+ VaadinRenderer renderer = new VaadinRenderer();
+ IViewContext viewContext = renderer.render(rootLayout, yView, null);
+
+ IRichTextAreaEditpart text1Editpart = DelegatingEditPartManager
+ .getInstance().getEditpart(viewContext, yText1);
+ IWidgetPresentation<Component> text1Presentation = text1Editpart
+ .getPresentation();
+ RichTextArea text1 = (RichTextArea) text1Presentation.getWidget();
+
+ // start tests
+ //
+ YBindingSet yBindingSet = yView.getOrCreateBindingSet();
+
+ yText1.setBlobValue("".getBytes());
+ YBeanValueBindingEndpoint beanBinding = factory
+ .createBeanBindingEndpoint();
+ ValueBean bean = new ValueBean(encoder.encode("Huhu".getBytes()));
+ beanBinding.setPropertyPath("bytesValue");
+ beanBinding.setBean(bean);
+ yBindingSet.addBinding(yText1.createBlobValueEndpoint(), beanBinding);
+ assertEquals("Huhu", text1.getValue());
+ assertEquals("Huhu", new String(decoder.decode(yText1.getBlobValue())));
+
+ bean.setBytesValue(encoder.encode("Haha".getBytes()));
+ assertEquals("Haha", text1.getValue());
+ assertEquals("Haha", new String(decoder.decode(yText1.getBlobValue())));
+
+ text1.setValue("Haha1");
+ assertEquals("Haha1", new String(decoder.decode(bean.getBytesValue())));
+ assertEquals("Haha1", new String(decoder.decode(yText1.getBlobValue())));
+
+ yText1.setBlobValue(encoder.encode("Haha2".getBytes()));
+ assertEquals("Haha2", new String(decoder.decode(bean.getBytesValue())));
+ assertEquals("Haha2", text1.getValue());
+ }
+
+ private static class ConverterFactory implements IConverterFactory {
+
+ @Override
+ public boolean isFor(IViewContext uiContext, IConverterEditpart editpart) {
+ return true;
+ }
+
+ @Override
+ public Object createConverter(IViewContext uiContext,
+ IConverterEditpart editpart) throws IllegalArgumentException {
+ return new HtmlToTextConverter();
+ }
+ }
+
+ /**
+ * Converters "Test" to "Test $" and "Test $" to "Test"
+ */
+ @SuppressWarnings("serial")
+ private static class HtmlToTextConverter implements
+ Converter<String, String> {
+
+ @Override
+ public String convertToModel(String value,
+ Class<? extends String> targetType, Locale locale)
+ throws com.vaadin.data.util.converter.Converter.ConversionException {
+ return value == null ? "" : value.replaceAll(" XX", "");
+ }
+
+ @Override
+ public String convertToPresentation(String value,
+ Class<? extends String> targetType, Locale locale)
+ throws com.vaadin.data.util.converter.Converter.ConversionException {
+ return value == null ? " XX" : value + " XX";
+ }
+
+ @Override
+ public Class<String> getModelType() {
+ return String.class;
+ }
+
+ @Override
+ public Class<String> getPresentationType() {
+ return String.class;
+ }
+
+ }
+}
diff --git a/org.eclipse.osbp.ecview.extension.presentation.vaadin.tests/src/org/eclipse/osbp/ecview/extension/presentation/tests/strategy/StrategyLayoutTests.java b/org.eclipse.osbp.ecview.extension.presentation.vaadin.tests/src/org/eclipse/osbp/ecview/extension/presentation/tests/strategy/StrategyLayoutTests.java
new file mode 100644
index 0000000..6891ad3
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.presentation.vaadin.tests/src/org/eclipse/osbp/ecview/extension/presentation/tests/strategy/StrategyLayoutTests.java
@@ -0,0 +1,2180 @@
+/**
+ *
+ * Copyright (c) 2011, 2016 - Loetz GmbH&Co.KG (69115 Heidelberg, Germany)
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Christophe Loetz (Loetz GmbH&Co.KG) - initial implementation
+ *
+ */
+ package org.eclipse.osbp.ecview.extension.presentation.tests.strategy;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNotSame;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertSame;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.util.ArrayList;
+import java.util.Dictionary;
+import java.util.HashMap;
+import java.util.Hashtable;
+import java.util.Locale;
+import java.util.Map;
+
+import org.eclipse.emf.ecore.util.EcoreUtil;
+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.editpart.DelegatingEditPartManager;
+import org.eclipse.osbp.ecview.core.common.editpart.IEmbeddableEditpart;
+import org.eclipse.osbp.ecview.core.common.editpart.binding.IBindingEditpart;
+import org.eclipse.osbp.ecview.core.common.model.binding.BindingFactory;
+import org.eclipse.osbp.ecview.core.common.model.binding.YBindingEndpoint;
+import org.eclipse.osbp.ecview.core.common.model.binding.YListBinding;
+import org.eclipse.osbp.ecview.core.common.model.binding.YListBindingEndpoint;
+import org.eclipse.osbp.ecview.core.common.model.binding.YValueBinding;
+import org.eclipse.osbp.ecview.core.common.model.binding.YValueBindingEndpoint;
+import org.eclipse.osbp.ecview.core.common.model.core.CoreModelFactory;
+import org.eclipse.osbp.ecview.core.common.model.core.YBeanSlot;
+import org.eclipse.osbp.ecview.core.common.model.core.YCollectionBindable;
+import org.eclipse.osbp.ecview.core.common.model.core.YElement;
+import org.eclipse.osbp.ecview.core.common.model.core.YEmbeddable;
+import org.eclipse.osbp.ecview.core.common.model.core.YEmbeddableCollectionEndpoint;
+import org.eclipse.osbp.ecview.core.common.model.core.YFocusable;
+import org.eclipse.osbp.ecview.core.common.model.core.YKeyCode;
+import org.eclipse.osbp.ecview.core.common.model.core.YKeyStrokeDefinition;
+import org.eclipse.osbp.ecview.core.common.model.core.YLayout;
+import org.eclipse.osbp.ecview.core.common.model.core.YModifierKey;
+import org.eclipse.osbp.ecview.core.common.model.core.YValueBindable;
+import org.eclipse.osbp.ecview.core.common.model.core.YView;
+import org.eclipse.osbp.ecview.core.common.services.IWidgetAssocationsService;
+import org.eclipse.osbp.ecview.core.extension.model.extension.ExtensionModelFactory;
+import org.eclipse.osbp.ecview.core.extension.model.extension.YDecimalField;
+import org.eclipse.osbp.ecview.core.extension.model.extension.YTextField;
+import org.eclipse.osbp.ecview.core.extension.model.extension.YVerticalLayout;
+import org.eclipse.osbp.ecview.core.extension.model.extension.util.SimpleExtensionModelFactory;
+import org.eclipse.osbp.ecview.core.ui.core.editparts.extension.IDecimalFieldEditpart;
+import org.eclipse.osbp.ecview.core.ui.core.editparts.extension.ITextFieldEditpart;
+import org.eclipse.osbp.ecview.core.ui.core.editparts.extension.IVerticalLayoutEditpart;
+import org.eclipse.osbp.ecview.core.util.emf.ModelUtil;
+import org.eclipse.osbp.ecview.extension.api.IFocusingStrategy;
+import org.eclipse.osbp.ecview.extension.api.IFocusingStrategyProvider;
+import org.eclipse.osbp.ecview.extension.api.ILayoutingStrategy;
+import org.eclipse.osbp.ecview.extension.api.ILayoutingStrategyProvider;
+import org.eclipse.osbp.ecview.extension.editparts.ILayoutingInfoEditpart;
+import org.eclipse.osbp.ecview.extension.editparts.IStrategyLayoutEditpart;
+import org.eclipse.osbp.ecview.extension.editparts.ISuspectLayoutingInfoEditpart;
+import org.eclipse.osbp.ecview.extension.editparts.emf.StrategyLayoutEditpart;
+import org.eclipse.osbp.ecview.extension.editparts.emf.strategies.DelegatingFocusingStrategyEditpart;
+import org.eclipse.osbp.ecview.extension.editparts.emf.strategies.LayoutingStrategyEditpart;
+import org.eclipse.osbp.ecview.extension.model.YDelegatingFocusingStrategy;
+import org.eclipse.osbp.ecview.extension.model.YECviewFactory;
+import org.eclipse.osbp.ecview.extension.model.YLayoutingInfo;
+import org.eclipse.osbp.ecview.extension.model.YStrategyLayout;
+import org.eclipse.osbp.ecview.extension.model.YSuspect;
+import org.eclipse.osbp.ecview.extension.model.YSuspectInfo;
+import org.eclipse.osbp.ecview.extension.presentation.vaadin.strategy.StrategyLayoutPresentation;
+import org.eclipse.osbp.runtime.common.event.IEventBroker;
+import org.eclipse.osbp.runtime.common.keystroke.KeyCode;
+import org.eclipse.osbp.runtime.common.keystroke.KeyStrokeCallback;
+import org.eclipse.osbp.runtime.common.keystroke.KeyStrokeDefinition;
+import org.eclipse.osbp.runtime.common.keystroke.ModifierKey;
+import org.eclipse.osbp.runtime.web.ecview.presentation.vaadin.VaadinRenderer;
+import org.eclipse.osbp.runtime.web.vaadin.components.fields.DecimalField;
+import org.eclipse.osbp.runtime.web.vaadin.databinding.VaadinObservables;
+import org.junit.Before;
+import org.junit.Test;
+import org.knowhowlab.osgi.testing.utils.BundleUtils;
+import org.knowhowlab.osgi.testing.utils.ServiceUtils;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.BundleException;
+import org.osgi.framework.FrameworkUtil;
+import org.osgi.service.cm.ConfigurationException;
+
+import com.vaadin.event.ActionManager;
+import com.vaadin.event.ShortcutAction;
+import com.vaadin.ui.AbstractComponent;
+import com.vaadin.ui.Component;
+import com.vaadin.ui.CssLayout;
+import com.vaadin.ui.Panel;
+import com.vaadin.ui.TextField;
+import com.vaadin.ui.UI;
+import com.vaadin.ui.VerticalLayout;
+
+import de.compex.ecview.extension.tests.dtos.Person;
+
+/**
+ * Tests the {@link StrategyLayoutPresentation}.
+ */
+public class StrategyLayoutTests {
+
+ private SimpleExtensionModelFactory factory = new SimpleExtensionModelFactory();
+ private YECviewFactory cxFactory = YECviewFactory.eINSTANCE;
+ private CssLayout rootLayout = new CssLayout();
+ private IViewContext viewContext;
+
+ @SuppressWarnings("unchecked")
+ private static <A> A findEditpart(YElement yElement) {
+ return (A) DelegatingEditPartManager.getInstance().findEditpart(
+ yElement);
+ }
+
+ @SuppressWarnings("unchecked")
+ private <A> A getEditpart(YElement yElement) {
+ return (A) DelegatingEditPartManager.getInstance().getEditpart(
+ viewContext, yElement);
+ }
+
+ /**
+ * Setup tests.
+ *
+ * @throws ConfigurationException
+ * @throws BundleException
+ */
+ @Before
+ public void setup() throws ConfigurationException, BundleException {
+ BundleUtils.startBundleAsync(getBundleContext(),
+ "org.lunifera.runtime.event");
+
+ UI.setCurrent(new DefaultUI());
+ UI.getCurrent().setContent(rootLayout);
+ VaadinObservables.activateRealm(UI.getCurrent());
+
+ Dictionary<String, Object> properties1 = new Hashtable<>();
+ properties1.put("ecview.focusing.id", "default");
+ getBundleContext().registerService(IFocusingStrategyProvider.class, new DefaultFocusingStrategyProvider(), properties1);
+
+ Dictionary<String, Object> properties2 = new Hashtable<>();
+ properties2.put("ecview.layouting.id", "Default");
+ getBundleContext().registerService(ILayoutingStrategyProvider.class, new DefaultLayoutingStrategyProvider(), properties2);
+
+ }
+
+ private BundleContext getBundleContext() {
+ return FrameworkUtil.getBundle(getClass()).getBundleContext();
+ }
+
+ /**
+ * A very simple render without Suspects.
+ *
+ * @throws ContextException
+ */
+ @Test
+ public void test_SimpleRender() throws ContextException {
+
+ // switch the global locale to german
+ Locale.setDefault(Locale.GERMAN);
+
+ // ----------------------------------------------------------
+ // ------------- Create the layout --------------------------
+ // ----------------------------------------------------------
+ YView yView = factory.createView();
+ YStrategyLayout yLayout = cxFactory.createYStrategyLayout();
+ yView.setContent(yLayout);
+
+ // ----------------------------------------------------------
+ // ----------------- Render the UI --------------------------
+ // ----------------------------------------------------------
+ VaadinRenderer renderer = new VaadinRenderer();
+ viewContext = renderer.render(rootLayout, yView, null);
+ IStrategyLayoutEditpart layoutEP = DelegatingEditPartManager
+ .getInstance().getEditpart(viewContext, yLayout);
+ StrategyLayoutPresentation layoutPres = layoutEP.getPresentation();
+
+ assertTrue(layoutPres.isRendered());
+ assertFalse(layoutPres.isDisposed());
+ assertTrue(layoutEP.isRendered());
+ assertFalse(layoutEP.isDisposed());
+
+ layoutEP.requestDispose();
+ assertFalse(layoutPres.isRendered());
+ assertTrue(layoutPres.isDisposed());
+ assertFalse(layoutEP.isRendered());
+ assertTrue(layoutEP.isDisposed());
+ }
+
+ /**
+ * Tests for the default layouter.
+ *
+ * @throws ContextException
+ */
+ @Test
+ public void test_Layouter_Default() throws ContextException {
+
+ // switch the global locale to german
+ Locale.setDefault(Locale.GERMAN);
+
+ // ----------------------------------------------------------
+ // ------------- Create the layout --------------------------
+ // ----------------------------------------------------------
+ YView yView = factory.createView();
+ YBeanSlot yBeanSlot = yView.addBeanSlot("main", Person.class);
+
+ YStrategyLayout yLayout = cxFactory.createYStrategyLayout();
+ yView.setContent(yLayout);
+
+ // create suspects
+ YSuspect nameSuspect = cxFactory.createYSuspect();
+ nameSuspect.setName("name");
+ nameSuspect.getValueBindingEndpoints().add(
+ yBeanSlot.createBindingEndpoint("name"));
+ yLayout.getSuspects().add(nameSuspect);
+ YSuspect ageSuspect = cxFactory.createYSuspect();
+ ageSuspect.setName("age");
+ // ensure a decimal field
+ ageSuspect.getTags().add("decimal");
+ ageSuspect.getValueBindingEndpoints().add(
+ yBeanSlot.createBindingEndpoint("age"));
+ yLayout.getSuspects().add(ageSuspect);
+
+ // ----------------------------------------------------------
+ // ----------------- Render the UI --------------------------
+ // ----------------------------------------------------------
+ VaadinRenderer renderer = new VaadinRenderer();
+ Map<String, Object> params = new HashMap<String, Object>();
+ Map<String, Object> services = new HashMap<String, Object>();
+
+ params.put(IViewContext.PARAM_SERVICES, services);
+ services.put(ILayoutingStrategyProvider.class.getName(),
+ new DefaultLayoutingStrategyProvider());
+ services.put(IFocusingStrategyProvider.class.getName(),
+ new DefaultFocusingStrategyProvider());
+
+ viewContext = renderer.render(rootLayout, yView, params);
+ viewContext.setBean("main", new Person());
+
+ // ----------------------------------------------------------
+ // --------------------- Check bindings ---------------------
+ // ----------------------------------------------------------
+ assertEquals(0, yView.getBindingSet().getBindings().size());
+ assertEquals(2, yView.getBindingSet().getTransientBindings().size());
+
+ IStrategyLayoutEditpart layoutEP = DelegatingEditPartManager
+ .getInstance().getEditpart(viewContext, yLayout);
+ StrategyLayoutPresentation layoutPres = layoutEP.getPresentation();
+
+ // ----------------------------------------------------------
+ // ------------- Read in the created editparts --------------
+ // ----------------------------------------------------------
+ YLayoutingInfo cxLayoutingInfo = yLayout.getLayoutingInfo();
+ ILayoutingInfoEditpart cxLayoutingInfoEP = DelegatingEditPartManager
+ .getInstance().getEditpart(viewContext, cxLayoutingInfo);
+ // ensure that strategy did some layouting
+ YEmbeddable yContent = cxLayoutingInfo.getContent();
+ assertNotNull(yContent);
+
+ // read the suspect layouting infos
+ //
+ YSuspectInfo nameSuspectInfo = cxLayoutingInfo.getActiveSuspectInfos()
+ .get(0);
+ YSuspectInfo ageSuspectInfo = cxLayoutingInfo.getActiveSuspectInfos()
+ .get(1);
+ ISuspectLayoutingInfoEditpart nameSuspectInfoEP = DelegatingEditPartManager
+ .getInstance().getEditpart(viewContext, nameSuspectInfo);
+ ISuspectLayoutingInfoEditpart ageSuspectInfoEP = DelegatingEditPartManager
+ .getInstance().getEditpart(viewContext, ageSuspectInfo);
+
+ IVerticalLayoutEditpart contentEP = DelegatingEditPartManager
+ .getInstance().getEditpart(viewContext, yContent);
+
+ // do asserts
+ //
+ assertTrue(layoutPres.isRendered());
+ assertFalse(layoutPres.isDisposed());
+
+ assertTrue(layoutEP.isRendered());
+ assertFalse(layoutEP.isDisposed());
+ assertTrue(contentEP.isRendered());
+ assertFalse(contentEP.isDisposed());
+ assertFalse(cxLayoutingInfoEP.isDisposed());
+ assertFalse(nameSuspectInfoEP.isDisposed());
+ assertFalse(ageSuspectInfoEP.isDisposed());
+
+ IEmbeddableEditpart child1 = contentEP.getElements().get(0);
+ IEmbeddableEditpart child2 = contentEP.getElements().get(1);
+
+ // ensure, that layout elements have been created and rendered properly
+ assertTrue(child1 instanceof ITextFieldEditpart);
+ assertTrue(child2 instanceof IDecimalFieldEditpart);
+ assertTrue(child1.isRendered());
+ assertFalse(child1.isDisposed());
+ assertTrue(child2.isRendered());
+ assertFalse(child2.isDisposed());
+
+ // ----------------------------------------------------------
+ // ----------------- Dispose the strategy -------------------
+ // ----------------------------------------------------------
+ layoutEP.requestDispose();
+
+ // do further tests
+ //
+ assertFalse(layoutPres.isRendered());
+ assertTrue(layoutPres.isDisposed());
+
+ assertFalse(contentEP.isRendered());
+ assertTrue(contentEP.isDisposed());
+ assertFalse(layoutEP.isRendered());
+ assertTrue(layoutEP.isDisposed());
+ assertTrue(cxLayoutingInfoEP.isDisposed());
+ assertTrue(nameSuspectInfoEP.isDisposed());
+ assertTrue(ageSuspectInfoEP.isDisposed());
+
+ // ensure, that layout elements have been disposed properly
+ assertFalse(child1.isRendered());
+ assertTrue(child1.isDisposed());
+ assertFalse(child2.isRendered());
+ assertTrue(child2.isDisposed());
+
+ // ensure, that editparts have been removed from models
+ assertNull(findEditpart(yLayout));
+ assertNull(findEditpart(nameSuspect));
+ assertNull(findEditpart(ageSuspect));
+ assertNull(findEditpart(cxLayoutingInfo));
+ assertNull(findEditpart(yContent));
+ assertNull(findEditpart(nameSuspectInfo));
+ assertNull(findEditpart(ageSuspectInfo));
+
+ // ensure bindings are removed
+ //
+ assertEquals(0, yView.getBindingSet().getBindings().size());
+ assertEquals(0, yView.getBindingSet().getTransientBindings().size());
+
+ }
+
+ /**
+ * If a new default layout strategy provider is set and published by event
+ * admin, then the layout will update immediately.
+ *
+ * @throws ContextException
+ */
+ @Test
+ public void test_Layouter_DefaultByEventBroker() throws ContextException {
+
+ IEventBroker eventBroker = ServiceUtils.getService(getBundleContext(),
+ IEventBroker.class);
+ assertNotNull(eventBroker);
+
+ // ----------------------------------------------------------
+ // ------------- Create the layout --------------------------
+ // ----------------------------------------------------------
+ // switch the global locale to german
+ Locale.setDefault(Locale.GERMAN);
+
+ YView yView = factory.createView();
+ YBeanSlot yBeanSlot = yView.addBeanSlot("main", Person.class);
+
+ YStrategyLayout yLayout = cxFactory.createYStrategyLayout();
+ yView.setContent(yLayout);
+
+ // create suspects
+ YSuspect nameSuspect = cxFactory.createYSuspect();
+ nameSuspect.setName("name");
+ nameSuspect.getValueBindingEndpoints().add(
+ yBeanSlot.createBindingEndpoint("name"));
+ yLayout.getSuspects().add(nameSuspect);
+ YSuspect ageSuspect = cxFactory.createYSuspect();
+ ageSuspect.setName("age");
+ // ensure a decimal field
+ ageSuspect.getTags().add("decimal");
+ ageSuspect.getValueBindingEndpoints().add(
+ yBeanSlot.createBindingEndpoint("age"));
+ yLayout.getSuspects().add(ageSuspect);
+
+ // ----------------------------------------------------------
+ // ----------------- Render the UI --------------------------
+ // ----------------------------------------------------------
+ VaadinRenderer renderer = new VaadinRenderer();
+ Map<String, Object> params = new HashMap<String, Object>();
+ Map<String, Object> services = new HashMap<String, Object>();
+
+ params.put(IViewContext.PARAM_SERVICES, services);
+ services.put(ILayoutingStrategyProvider.class.getName(),
+ new DefaultLayoutingStrategyProvider());
+ services.put(IFocusingStrategyProvider.class.getName(),
+ new DefaultFocusingStrategyProvider());
+
+ viewContext = renderer.render(rootLayout, yView, params);
+ viewContext.setBean("main", new Person());
+
+ // ensure bindings are activated
+ //
+ assertEquals(2, yView.getBindingSet().getTransientBindings().size());
+
+ // ----------------------------------------------------------
+ // ------------- Read in the created editparts --------------
+ // ----------------------------------------------------------
+ IStrategyLayoutEditpart layoutEP = DelegatingEditPartManager
+ .getInstance().getEditpart(viewContext, yLayout);
+ StrategyLayoutPresentation layoutPres = layoutEP.getPresentation();
+
+ // read the created layouting info
+ //
+ YLayoutingInfo cxLayoutingInfo = yLayout.getLayoutingInfo();
+ ILayoutingInfoEditpart cxLayoutingInfoEP = DelegatingEditPartManager
+ .getInstance().getEditpart(viewContext, cxLayoutingInfo);
+ // ensure that strategy did some layouting
+ YEmbeddable yContent = cxLayoutingInfo.getContent();
+ assertNotNull(yContent);
+
+ // read the suspect layouting infos
+ //
+ YSuspectInfo nameSuspectInfo = cxLayoutingInfo.getActiveSuspectInfos()
+ .get(0);
+ YSuspectInfo ageSuspectInfo = cxLayoutingInfo.getActiveSuspectInfos()
+ .get(1);
+ ISuspectLayoutingInfoEditpart nameSuspectInfoEP = DelegatingEditPartManager
+ .getInstance().getEditpart(viewContext, nameSuspectInfo);
+ ISuspectLayoutingInfoEditpart ageSuspectInfoEP = DelegatingEditPartManager
+ .getInstance().getEditpart(viewContext, ageSuspectInfo);
+
+ IVerticalLayoutEditpart contentEP = DelegatingEditPartManager
+ .getInstance().getEditpart(viewContext, yContent);
+
+ // do asserts
+ //
+ assertTrue(layoutPres.isRendered());
+ assertFalse(layoutPres.isDisposed());
+
+ assertTrue(layoutEP.isRendered());
+ assertFalse(layoutEP.isDisposed());
+ assertTrue(contentEP.isRendered());
+ assertFalse(contentEP.isDisposed());
+ assertFalse(cxLayoutingInfoEP.isDisposed());
+ assertFalse(nameSuspectInfoEP.isDisposed());
+ assertFalse(ageSuspectInfoEP.isDisposed());
+
+ IEmbeddableEditpart child1 = contentEP.getElements().get(0);
+ IEmbeddableEditpart child2 = contentEP.getElements().get(1);
+
+ // ensure, that layout elements have been created and rendered properly
+ assertTrue(child1 instanceof ITextFieldEditpart);
+ assertTrue(child2 instanceof IDecimalFieldEditpart);
+ assertTrue(child1.isRendered());
+ assertFalse(child1.isDisposed());
+ assertTrue(child2.isRendered());
+ assertFalse(child2.isDisposed());
+
+ // ----------------------------------------------------------
+ // ------------- Apply a new default strategy ---------------
+ // ----------------------------------------------------------
+ OnlyLayoutTaggedStrategyProvider strategyProvider = new OnlyLayoutTaggedStrategyProvider();
+ viewContext.registerService(ILayoutingStrategyProvider.class.getName(),
+ strategyProvider);
+
+ eventBroker.send(ILayoutingStrategyProvider.ACTIVE_PROVIDER_TOPIC,
+ strategyProvider);
+
+ StrategyLayoutEditpart implLayoutEP = (StrategyLayoutEditpart) layoutEP;
+ LayoutingStrategyEditpart<?> implStrategyEP = (LayoutingStrategyEditpart<?>) implLayoutEP
+ .getLayoutingStrategy();
+ assertTrue(implStrategyEP.getStrategy() instanceof OnlyLayoutTaggedStrategy);
+
+ // do asserts OLD values
+ //
+ assertFalse(layoutPres.isDisposed());
+ assertFalse(layoutEP.isDisposed());
+ assertTrue(contentEP.isDisposed());
+ assertTrue(cxLayoutingInfoEP.isDisposed());
+ assertTrue(nameSuspectInfoEP.isDisposed());
+ assertTrue(ageSuspectInfoEP.isDisposed());
+ assertFalse(child1.isRendered());
+ assertTrue(child1.isDisposed());
+ assertFalse(child2.isRendered());
+ assertTrue(child2.isDisposed());
+
+ // ----------------------------------------------------------
+ // ------------- Read in the created editparts --------------
+ // ----------------------------------------------------------
+ cxLayoutingInfo = yLayout.getLayoutingInfo();
+ cxLayoutingInfoEP = DelegatingEditPartManager.getInstance()
+ .getEditpart(viewContext, cxLayoutingInfo);
+ // ensure that strategy did some layouting
+ yContent = cxLayoutingInfo.getContent();
+ assertNotNull(yContent);
+
+ // read the suspect layouting infos
+ //
+ ageSuspectInfo = cxLayoutingInfo.getActiveSuspectInfos().get(0);
+ ageSuspectInfoEP = DelegatingEditPartManager.getInstance().getEditpart(
+ viewContext, ageSuspectInfo);
+
+ contentEP = DelegatingEditPartManager.getInstance().getEditpart(
+ viewContext, yContent);
+
+ // do asserts
+ //
+ assertTrue(layoutPres.isRendered());
+ assertFalse(layoutPres.isDisposed());
+
+ assertTrue(layoutEP.isRendered());
+ assertFalse(layoutEP.isDisposed());
+ assertTrue(contentEP.isRendered());
+ assertFalse(contentEP.isDisposed());
+ assertFalse(cxLayoutingInfoEP.isDisposed());
+ assertFalse(ageSuspectInfoEP.isDisposed());
+
+ child1 = contentEP.getElements().get(0);
+
+ // ensure, that layout elements have been created and rendered properly
+ assertTrue(child1 instanceof IDecimalFieldEditpart);
+ assertTrue(child1.isRendered());
+ assertFalse(child1.isDisposed());
+
+ }
+
+ /**
+ * Tests that YLayoutingInfo can become activated and deactivated.
+ *
+ * @throws ContextException
+ */
+ @Test
+ public void test_LayoutInfo_ActivateAndDeactivate() throws ContextException {
+
+ // switch the global locale to german
+ Locale.setDefault(Locale.GERMAN);
+
+ // ----------------------------------------------------------
+ // ------------- Create the layout --------------------------
+ // ----------------------------------------------------------
+ YView yView = factory.createView();
+ YBeanSlot yBeanSlot = yView.addBeanSlot("main", Person.class);
+
+ YStrategyLayout yLayout = cxFactory.createYStrategyLayout();
+ yView.setContent(yLayout);
+
+ // create suspects
+ YSuspect nameSuspect = cxFactory.createYSuspect();
+ nameSuspect.setName("name");
+ nameSuspect.getValueBindingEndpoints().add(
+ yBeanSlot.createBindingEndpoint("name"));
+ yLayout.getSuspects().add(nameSuspect);
+ YSuspect ageSuspect = cxFactory.createYSuspect();
+ ageSuspect.setName("age");
+ // ensure a decimal field
+ ageSuspect.getTags().add("decimal");
+ ageSuspect.getValueBindingEndpoints().add(
+ yBeanSlot.createBindingEndpoint("age"));
+ yLayout.getSuspects().add(ageSuspect);
+
+ // ----------------------------------------------------------
+ // ----------------- Render the UI --------------------------
+ // ----------------------------------------------------------
+ VaadinRenderer renderer = new VaadinRenderer();
+ Map<String, Object> params = new HashMap<String, Object>();
+ Map<String, Object> services = new HashMap<String, Object>();
+
+ params.put(IViewContext.PARAM_SERVICES, services);
+ services.put(ILayoutingStrategyProvider.class.getName(),
+ new DefaultLayoutingStrategyProvider());
+ services.put(IFocusingStrategyProvider.class.getName(),
+ new DefaultFocusingStrategyProvider());
+
+ viewContext = renderer.render(rootLayout, yView, params);
+ viewContext.setBean("main", new Person());
+
+ // ensure bindings are activated
+ //
+ assertEquals(0, yView.getBindingSet().getBindings().size());
+ assertEquals(2, yView.getBindingSet().getTransientBindings().size());
+
+ // ----------------------------------------------------------
+ // ------------- Read in the created editparts --------------
+ // ----------------------------------------------------------
+ YLayoutingInfo cxLayoutingInfo = yLayout.getLayoutingInfo();
+ ILayoutingInfoEditpart cxLayoutingInfoEP = DelegatingEditPartManager
+ .getInstance().getEditpart(viewContext, cxLayoutingInfo);
+ YEmbeddable yContent = cxLayoutingInfo.getContent();
+ assertNotNull(yContent);
+
+ // read the suspect layouting infos
+ //
+ YSuspectInfo nameSuspectInfo = cxLayoutingInfo.getActiveSuspectInfos()
+ .get(0);
+ YSuspectInfo ageSuspectInfo = cxLayoutingInfo.getActiveSuspectInfos()
+ .get(1);
+ ISuspectLayoutingInfoEditpart nameSuspectInfoEP = DelegatingEditPartManager
+ .getInstance().getEditpart(viewContext, nameSuspectInfo);
+ ISuspectLayoutingInfoEditpart ageSuspectInfoEP = DelegatingEditPartManager
+ .getInstance().getEditpart(viewContext, ageSuspectInfo);
+
+ // do asserts
+ //
+ assertFalse(cxLayoutingInfoEP.isDisposed());
+ assertFalse(nameSuspectInfoEP.isDisposed());
+ assertFalse(ageSuspectInfoEP.isDisposed());
+
+ // ----------------------------------------------------------
+ // ------------- Dispose the layouting info -----------------
+ // ----------------------------------------------------------
+ cxLayoutingInfoEP.requestDispose();
+
+ // do further tests
+ //
+ assertTrue(cxLayoutingInfoEP.isDisposed());
+ assertTrue(nameSuspectInfoEP.isDisposed());
+ assertTrue(ageSuspectInfoEP.isDisposed());
+
+ // ensure bindings are removed
+ //
+ assertEquals(0, yView.getBindingSet().getBindings().size());
+ assertEquals(0, yView.getBindingSet().getTransientBindings().size());
+
+ // ----------------------------------------------------------
+ // ---------- Activate the layouting info again -------------
+ // ----------------------------------------------------------
+ yLayout.setLayoutingInfo(cxLayoutingInfo);
+
+ // ----------------------------------------------------------
+ // ------------- Read in the created editparts --------------
+ // ----------------------------------------------------------
+ cxLayoutingInfoEP = DelegatingEditPartManager.getInstance()
+ .getEditpart(viewContext, cxLayoutingInfo);
+ yContent = cxLayoutingInfo.getContent();
+ assertNotNull(yContent);
+
+ // read the suspect layouting infos
+ //
+ nameSuspectInfo = cxLayoutingInfo.getActiveSuspectInfos().get(0);
+ ageSuspectInfo = cxLayoutingInfo.getActiveSuspectInfos().get(1);
+ nameSuspectInfoEP = DelegatingEditPartManager.getInstance()
+ .getEditpart(viewContext, nameSuspectInfo);
+ ageSuspectInfoEP = DelegatingEditPartManager.getInstance().getEditpart(
+ viewContext, ageSuspectInfo);
+
+ assertFalse(cxLayoutingInfoEP.isDisposed());
+ assertFalse(nameSuspectInfoEP.isDisposed());
+ assertFalse(ageSuspectInfoEP.isDisposed());
+
+ // ensure bindings are added again
+ //
+ assertEquals(0, yView.getBindingSet().getBindings().size());
+ assertEquals(2, yView.getBindingSet().getTransientBindings().size());
+
+ // ----------------------------------------------------------
+ // ------------- Dispose the layouting info -----------------
+ // ----------------------------------------------------------
+ cxLayoutingInfoEP.requestDispose();
+ assertTrue(cxLayoutingInfoEP.isDisposed());
+ assertTrue(nameSuspectInfoEP.isDisposed());
+ assertTrue(ageSuspectInfoEP.isDisposed());
+
+ assertEquals(0, yView.getBindingSet().getBindings().size());
+ assertEquals(0, yView.getBindingSet().getTransientBindings().size());
+ }
+
+ /**
+ * Tests that bindings are setup properly.
+ *
+ * @throws ContextException
+ */
+ @Test
+ public void test_LayoutInfo_Bindings() throws ContextException {
+
+ // switch the global locale to german
+ Locale.setDefault(Locale.GERMAN);
+
+ // ----------------------------------------------------------
+ // ------------- Create the layout --------------------------
+ // ----------------------------------------------------------
+ YView yView = factory.createView();
+ YBeanSlot yBeanSlot = yView.addBeanSlot("main", Person.class);
+
+ YStrategyLayout yLayout = cxFactory.createYStrategyLayout();
+ yView.setContent(yLayout);
+
+ // create suspects
+ YSuspect nameSuspect = cxFactory.createYSuspect();
+ nameSuspect.setName("name");
+ nameSuspect.getValueBindingEndpoints().add(
+ yBeanSlot.createBindingEndpoint("name"));
+ yLayout.getSuspects().add(nameSuspect);
+ YSuspect ageSuspect = cxFactory.createYSuspect();
+ ageSuspect.setName("age");
+ // ensure a decimal field
+ ageSuspect.getTags().add("decimal");
+ ageSuspect.getValueBindingEndpoints().add(
+ yBeanSlot.createBindingEndpoint("age"));
+ yLayout.getSuspects().add(ageSuspect);
+
+ // ----------------------------------------------------------
+ // ----------------- Render the UI --------------------------
+ // ----------------------------------------------------------
+ VaadinRenderer renderer = new VaadinRenderer();
+ Map<String, Object> params = new HashMap<String, Object>();
+ Map<String, Object> services = new HashMap<String, Object>();
+
+ params.put(IViewContext.PARAM_SERVICES, services);
+ services.put(ILayoutingStrategyProvider.class.getName(),
+ new DefaultLayoutingStrategyProvider());
+ services.put(IFocusingStrategyProvider.class.getName(),
+ new DefaultFocusingStrategyProvider());
+
+ viewContext = renderer.render(rootLayout, yView, params);
+ viewContext.setBean("main", new Person());
+
+ // ensure bindings are activated
+ //
+ assertEquals(0, yView.getBindingSet().getBindings().size());
+ assertEquals(2, yView.getBindingSet().getTransientBindings().size());
+
+ // ----------------------------------------------------------
+ // ------------- Read in the created editparts --------------
+ // ----------------------------------------------------------
+ YLayoutingInfo cxLayoutingInfo = yLayout.getLayoutingInfo();
+ ILayoutingInfoEditpart cxLayoutingInfoEP = DelegatingEditPartManager
+ .getInstance().getEditpart(viewContext, cxLayoutingInfo);
+ YVerticalLayout yContent = (YVerticalLayout) cxLayoutingInfo
+ .getContent();
+ assertNotNull(yContent);
+
+ // read the suspect layouting infos
+ //
+ YSuspectInfo nameSuspectInfo = cxLayoutingInfo.getActiveSuspectInfos()
+ .get(0);
+ YSuspectInfo ageSuspectInfo = cxLayoutingInfo.getActiveSuspectInfos()
+ .get(1);
+ ISuspectLayoutingInfoEditpart nameSuspectInfoEP = DelegatingEditPartManager
+ .getInstance().getEditpart(viewContext, nameSuspectInfo);
+ ISuspectLayoutingInfoEditpart ageSuspectInfoEP = DelegatingEditPartManager
+ .getInstance().getEditpart(viewContext, ageSuspectInfo);
+
+ // do asserts
+ //
+ assertFalse(cxLayoutingInfoEP.isDisposed());
+ assertFalse(nameSuspectInfoEP.isDisposed());
+ assertFalse(ageSuspectInfoEP.isDisposed());
+
+ YTextField yNameField = (YTextField) yContent.getElement(0);
+ YDecimalField yAgeField = (YDecimalField) yContent.getElement(1);
+ TextField nameField = (TextField) ((IEmbeddableEditpart) findEditpart(yNameField))
+ .getWidget();
+ DecimalField ageField = (DecimalField) ((IEmbeddableEditpart) findEditpart(yAgeField))
+ .getWidget();
+
+ Person bean = (Person) viewContext.getBean("main");
+ bean.setName("My Name");
+ bean.setAge(44);
+ assertEquals(bean.getName(), nameField.getValue());
+ assertEquals(new Double(bean.getAge()), ageField.getConvertedValue());
+
+ // ----------------------------------------------------------
+ // ------------- Dispose the layouting info -----------------
+ // ----------------------------------------------------------
+ cxLayoutingInfoEP.requestDispose();
+
+ // do further tests
+ //
+ assertTrue(cxLayoutingInfoEP.isDisposed());
+ assertTrue(nameSuspectInfoEP.isDisposed());
+ assertTrue(ageSuspectInfoEP.isDisposed());
+
+ // ensure bindings are removed
+ //
+ assertEquals(0, yView.getBindingSet().getBindings().size());
+ assertEquals(0, yView.getBindingSet().getTransientBindings().size());
+
+ bean.setName("Other Name");
+ bean.setAge(36);
+ assertNotEquals(bean.getName(), nameField.getValue());
+ assertNotEquals(new Double(bean.getAge()), ageField.getConvertedValue());
+
+ // ----------------------------------------------------------
+ // ---------- Activate the layouting info again -------------
+ // ----------------------------------------------------------
+ yLayout.setLayoutingInfo(cxLayoutingInfo);
+
+ // ----------------------------------------------------------
+ // ------------- Read in the created editparts --------------
+ // ----------------------------------------------------------
+ cxLayoutingInfoEP = DelegatingEditPartManager.getInstance()
+ .getEditpart(viewContext, cxLayoutingInfo);
+ yContent = (YVerticalLayout) cxLayoutingInfo.getContent();
+ assertNotNull(yContent);
+
+ // read the suspect layouting infos
+ //
+ nameSuspectInfo = cxLayoutingInfo.getActiveSuspectInfos().get(0);
+ ageSuspectInfo = cxLayoutingInfo.getActiveSuspectInfos().get(1);
+ nameSuspectInfoEP = DelegatingEditPartManager.getInstance()
+ .getEditpart(viewContext, nameSuspectInfo);
+ ageSuspectInfoEP = DelegatingEditPartManager.getInstance().getEditpart(
+ viewContext, ageSuspectInfo);
+
+ // get new Vaadin fields
+ yNameField = (YTextField) yContent.getElement(0);
+ yAgeField = (YDecimalField) yContent.getElement(1);
+ nameField = (TextField) ((IEmbeddableEditpart) findEditpart(yNameField))
+ .getWidget();
+ ageField = (DecimalField) ((IEmbeddableEditpart) findEditpart(yAgeField))
+ .getWidget();
+
+ bean = (Person) viewContext.getBean("main");
+ bean.setName("Just a test");
+ bean.setAge(22);
+ assertEquals(bean.getName(), nameField.getValue());
+ assertEquals(new Double(bean.getAge()), ageField.getConvertedValue());
+
+ assertFalse(cxLayoutingInfoEP.isDisposed());
+ assertFalse(nameSuspectInfoEP.isDisposed());
+ assertFalse(ageSuspectInfoEP.isDisposed());
+
+ // ensure bindings are added again
+ //
+ assertEquals(0, yView.getBindingSet().getBindings().size());
+ assertEquals(2, yView.getBindingSet().getTransientBindings().size());
+
+ // ----------------------------------------------------------
+ // ------------- Dispose the layouting info -----------------
+ // ----------------------------------------------------------
+ cxLayoutingInfoEP.requestDispose();
+ assertTrue(cxLayoutingInfoEP.isDisposed());
+ assertTrue(nameSuspectInfoEP.isDisposed());
+ assertTrue(ageSuspectInfoEP.isDisposed());
+
+ assertEquals(0, yView.getBindingSet().getBindings().size());
+ assertEquals(0, yView.getBindingSet().getTransientBindings().size());
+
+ bean.setName("Another test");
+ bean.setAge(44);
+ assertNotEquals(bean.getName(), nameField.getValue());
+ assertNotEquals(new Double(bean.getAge()), ageField.getConvertedValue());
+ }
+
+ /**
+ * Switching the layoutInfo between two instances.
+ *
+ * @throws ContextException
+ */
+ @Test
+ public void test_LayoutInfo_SwitchInfo() throws ContextException {
+
+ // switch the global locale to german
+ Locale.setDefault(Locale.GERMAN);
+
+ // ----------------------------------------------------------
+ // ------------- Create the layout --------------------------
+ // ----------------------------------------------------------
+ YView yView = factory.createView();
+ YBeanSlot yBeanSlot = yView.addBeanSlot("main", Person.class);
+
+ YStrategyLayout yLayout = cxFactory.createYStrategyLayout();
+ yView.setContent(yLayout);
+
+ // create suspects
+ YSuspect nameSuspect = cxFactory.createYSuspect();
+ nameSuspect.setName("name");
+ nameSuspect.getValueBindingEndpoints().add(
+ yBeanSlot.createBindingEndpoint("name"));
+ yLayout.getSuspects().add(nameSuspect);
+ YSuspect ageSuspect = cxFactory.createYSuspect();
+ ageSuspect.setName("age");
+ // ensure a decimal field
+ ageSuspect.getTags().add("decimal");
+ ageSuspect.getValueBindingEndpoints().add(
+ yBeanSlot.createBindingEndpoint("age"));
+ yLayout.getSuspects().add(ageSuspect);
+
+ // ----------------------------------------------------------
+ // ----------------- Render the UI --------------------------
+ // ----------------------------------------------------------
+ VaadinRenderer renderer = new VaadinRenderer();
+ Map<String, Object> params = new HashMap<String, Object>();
+ Map<String, Object> services = new HashMap<String, Object>();
+
+ params.put(IViewContext.PARAM_SERVICES, services);
+ services.put(ILayoutingStrategyProvider.class.getName(),
+ new DefaultLayoutingStrategyProvider());
+ services.put(IFocusingStrategyProvider.class.getName(),
+ new DefaultFocusingStrategyProvider());
+
+ viewContext = renderer.render(rootLayout, yView, params);
+ viewContext.setBean("main", new Person());
+
+ // ensure bindings are activated
+ //
+ assertEquals(0, yView.getBindingSet().getBindings().size());
+ assertEquals(2, yView.getBindingSet().getTransientBindings().size());
+
+ // read the created layouting info
+ //
+ YLayoutingInfo cxLayoutingInfo1 = yLayout.getLayoutingInfo();
+ ILayoutingInfoEditpart cxLayoutingInfoEP1 = DelegatingEditPartManager
+ .getInstance().getEditpart(viewContext, cxLayoutingInfo1);
+ YVerticalLayout yContent1 = (YVerticalLayout) cxLayoutingInfo1
+ .getContent();
+ assertNotNull(yContent1);
+ assertEquals(2, yContent1.getElements().size());
+
+ // ----------------------------------------------------------
+ // ------------- Read in the created editparts --------------
+ // ----------------------------------------------------------
+ YSuspectInfo nameSuspectInfo1_1 = cxLayoutingInfo1
+ .getActiveSuspectInfos().get(0);
+ YSuspectInfo ageSuspectInfo1_2 = cxLayoutingInfo1
+ .getActiveSuspectInfos().get(1);
+ ISuspectLayoutingInfoEditpart nameSuspectInfoEP1_1 = DelegatingEditPartManager
+ .getInstance().getEditpart(viewContext, nameSuspectInfo1_1);
+ ISuspectLayoutingInfoEditpart ageSuspectInfoEP1_2 = DelegatingEditPartManager
+ .getInstance().getEditpart(viewContext, ageSuspectInfo1_2);
+
+ // ----------------------------------------------------------
+ // ---------- Set a new layouting info manually -------------
+ // ----------------------------------------------------------
+ YLayoutingInfo cxLayoutingInfo2 = EcoreUtil.copy(cxLayoutingInfo1);
+
+ // remove one field from the info
+ cxLayoutingInfo2.getActiveSuspectInfos().remove(0);
+ YVerticalLayout yContent2 = (YVerticalLayout) cxLayoutingInfo2
+ .getContent();
+ yContent2.getElements().remove(0);
+
+ ILayoutingInfoEditpart cxLayoutingInfoEP2 = DelegatingEditPartManager
+ .getInstance().getEditpart(viewContext, cxLayoutingInfo2);
+
+ // read the suspect layouting infos
+ YSuspectInfo ageSuspectInfo2_1 = cxLayoutingInfo2
+ .getActiveSuspectInfos().get(0);
+ ISuspectLayoutingInfoEditpart ageSuspectInfoEP2_1 = DelegatingEditPartManager
+ .getInstance().getEditpart(viewContext, ageSuspectInfo2_1);
+
+ // do asserts
+ //
+ assertFalse(cxLayoutingInfoEP1.isDisposed());
+ assertFalse(nameSuspectInfoEP1_1.isDisposed());
+ assertFalse(ageSuspectInfoEP1_2.isDisposed());
+
+ assertFalse(cxLayoutingInfoEP2.isDisposed());
+ assertFalse(ageSuspectInfoEP2_1.isDisposed());
+
+ // currently 2 views active
+ YVerticalLayout yCurrentContent = (YVerticalLayout) yLayout
+ .getLayoutingInfo().getContent();
+ assertEquals(2, yCurrentContent.getElements().size());
+
+ // ----------------------------------------------------------
+ // ------------- Now switch the layouting info --------------
+ // ----------------------------------------------------------
+ yLayout.setLayoutingInfo(cxLayoutingInfo2);
+ assertNotNull(yContent2);
+ assertEquals(1, yContent2.getElements().size());
+
+ assertTrue(cxLayoutingInfoEP1.isDisposed());
+ assertTrue(nameSuspectInfoEP1_1.isDisposed());
+ assertTrue(ageSuspectInfoEP1_2.isDisposed());
+
+ assertFalse(cxLayoutingInfoEP2.isDisposed());
+ assertFalse(ageSuspectInfoEP2_1.isDisposed());
+
+ // ensure bindings are removed
+ //
+ assertEquals(0, yView.getBindingSet().getBindings().size());
+ assertEquals(1, yView.getBindingSet().getTransientBindings().size());
+
+ // currently 1 views active
+ yCurrentContent = (YVerticalLayout) yLayout.getLayoutingInfo()
+ .getContent();
+ assertEquals(1, yCurrentContent.getElements().size());
+
+ // ----------------------------------------------------------
+ // ------------------ And switch it back --------------------
+ // ----------------------------------------------------------
+ yLayout.setLayoutingInfo(cxLayoutingInfo1);
+ assertEquals(0, yView.getBindingSet().getBindings().size());
+ assertEquals(2, yView.getBindingSet().getTransientBindings().size());
+
+ cxLayoutingInfoEP1 = DelegatingEditPartManager.getInstance()
+ .getEditpart(viewContext, cxLayoutingInfo1);
+ yContent1 = (YVerticalLayout) cxLayoutingInfo1.getContent();
+ assertNotNull(yContent1);
+ assertEquals(2, yContent1.getElements().size());
+
+ // read the suspect layouting infos again. NEW INSTANCES!
+ //
+ nameSuspectInfo1_1 = cxLayoutingInfo1.getActiveSuspectInfos().get(0);
+ ageSuspectInfo1_2 = cxLayoutingInfo1.getActiveSuspectInfos().get(1);
+ nameSuspectInfoEP1_1 = DelegatingEditPartManager.getInstance()
+ .getEditpart(viewContext, nameSuspectInfo1_1);
+ ageSuspectInfoEP1_2 = DelegatingEditPartManager.getInstance()
+ .getEditpart(viewContext, ageSuspectInfo1_2);
+
+ assertFalse(cxLayoutingInfoEP1.isDisposed());
+ assertFalse(nameSuspectInfoEP1_1.isDisposed());
+ assertFalse(ageSuspectInfoEP1_2.isDisposed());
+
+ assertTrue(cxLayoutingInfoEP2.isDisposed());
+ assertTrue(ageSuspectInfoEP2_1.isDisposed());
+
+ // ensure bindings are added again
+ //
+ assertEquals(0, yView.getBindingSet().getBindings().size());
+ assertEquals(2, yView.getBindingSet().getTransientBindings().size());
+
+ // currently 2 views active
+ yCurrentContent = (YVerticalLayout) yLayout.getLayoutingInfo()
+ .getContent();
+ assertEquals(2, yCurrentContent.getElements().size());
+
+ // ----------------------------------------------------------
+ // --------------- Dispose the layouting info ---------------
+ // ----------------------------------------------------------
+ cxLayoutingInfoEP1.dispose();
+ assertTrue(cxLayoutingInfoEP1.isDisposed());
+ assertTrue(nameSuspectInfoEP1_1.isDisposed());
+ assertTrue(ageSuspectInfoEP1_2.isDisposed());
+
+ assertEquals(0, yView.getBindingSet().getBindings().size());
+ assertEquals(0, yView.getBindingSet().getTransientBindings().size());
+ }
+
+ /**
+ * Test to show, that active rendered YLayoutingInfo can be changed. The
+ * changes are reflected to the UI, but no complete relayouting is done.
+ *
+ * @throws ContextException
+ */
+ @Test
+ public void test_LayoutingInfo_ChangeValueInActive()
+ throws ContextException {
+
+ // switch the global locale to german
+ Locale.setDefault(Locale.GERMAN);
+
+ // ----------------------------------------------------------
+ // ------------- Create the layout --------------------------
+ // ----------------------------------------------------------
+ YView yView = factory.createView();
+ YBeanSlot yBeanSlot = yView.addBeanSlot("main", Person.class);
+
+ YStrategyLayout yLayout = cxFactory.createYStrategyLayout();
+ yView.setContent(yLayout);
+
+ // create suspects
+ YSuspect nameSuspect = cxFactory.createYSuspect();
+ nameSuspect.setName("name");
+ nameSuspect.getValueBindingEndpoints().add(
+ yBeanSlot.createBindingEndpoint("name"));
+ yLayout.getSuspects().add(nameSuspect);
+ YSuspect ageSuspect = cxFactory.createYSuspect();
+ ageSuspect.setName("age");
+ // ensure a decimal field
+ ageSuspect.getTags().add("decimal");
+ ageSuspect.getValueBindingEndpoints().add(
+ yBeanSlot.createBindingEndpoint("age"));
+ yLayout.getSuspects().add(ageSuspect);
+
+ // ----------------------------------------------------------
+ // ----------------- Render the UI --------------------------
+ // ----------------------------------------------------------
+ VaadinRenderer renderer = new VaadinRenderer();
+ Map<String, Object> params = new HashMap<String, Object>();
+ Map<String, Object> services = new HashMap<String, Object>();
+
+ params.put(IViewContext.PARAM_SERVICES, services);
+ services.put(ILayoutingStrategyProvider.class.getName(),
+ new DefaultLayoutingStrategyProvider());
+ services.put(IFocusingStrategyProvider.class.getName(),
+ new DefaultFocusingStrategyProvider());
+
+ viewContext = renderer.render(rootLayout, yView, params);
+ viewContext.setBean("main", new Person());
+
+ // ----------------------------------------------------------
+ // ------------- Read in the created editparts --------------
+ // ----------------------------------------------------------
+ YLayoutingInfo cxLayoutingInfo1 = yLayout.getLayoutingInfo();
+ ILayoutingInfoEditpart cxLayoutingInfoEP1 = DelegatingEditPartManager
+ .getInstance().getEditpart(viewContext, cxLayoutingInfo1);
+ YVerticalLayout yContent = (YVerticalLayout) cxLayoutingInfo1
+ .getContent();
+ assertNotNull(yContent);
+ assertEquals(2, yContent.getElements().size());
+
+ // read the suspect layouting infos
+ //
+ YSuspectInfo nameSuspectInfo1_1 = cxLayoutingInfo1
+ .getActiveSuspectInfos().get(0);
+ YSuspectInfo ageSuspectInfo1_2 = cxLayoutingInfo1
+ .getActiveSuspectInfos().get(1);
+ ISuspectLayoutingInfoEditpart nameSuspectInfoEP1_1 = DelegatingEditPartManager
+ .getInstance().getEditpart(viewContext, nameSuspectInfo1_1);
+ ISuspectLayoutingInfoEditpart ageSuspectInfoEP1_2 = DelegatingEditPartManager
+ .getInstance().getEditpart(viewContext, ageSuspectInfo1_2);
+
+ // ensure values
+ //
+ assertFalse(nameSuspectInfoEP1_1.isDisposed());
+ assertFalse(ageSuspectInfoEP1_2.isDisposed());
+ assertEquals(2, yView.getBindingSet().getTransientBindings().size());
+
+ // test Vaadin
+ VerticalLayout vl = (VerticalLayout) cxLayoutingInfoEP1.getContent()
+ .getWidget();
+ assertEquals(2, vl.getComponentCount());
+
+ // ----------------------------------------------------------
+ // -------------- Remove nameSuspectInfoEP1_1 ---------------
+ // ----------------------------------------------------------
+ // now remove nameSuspectInfoEP1_1 and its representation
+ cxLayoutingInfo1.getActiveSuspectInfos().remove(0);
+ yContent = (YVerticalLayout) cxLayoutingInfo1.getContent();
+ yContent.getElements().remove(0);
+
+ // ----------------------------------------------------------
+ // --------------- Ensure Vaadin updated UI -----------------
+ // ------ No relayouting happend yet. Ui followed model------
+ // ----------------------------------------------------------
+ assertTrue(nameSuspectInfoEP1_1.isDisposed());
+ assertFalse(cxLayoutingInfoEP1.isDisposed());
+ assertFalse(ageSuspectInfoEP1_2.isDisposed());
+
+ // test Vaadin
+ vl = (VerticalLayout) cxLayoutingInfoEP1.getContent().getWidget();
+ assertEquals(1, vl.getComponentCount());
+
+ // name was removed, so age needs to be index 0
+ YSuspectInfo ageSuspectInfo2_1 = cxLayoutingInfo1
+ .getActiveSuspectInfos().get(0);
+ assertFalse(ageSuspectInfoEP1_2.isDisposed());
+ // ageSuspectInfoEP1_2 was NOT disposed
+ assertSame(ageSuspectInfoEP1_2, findEditpart(ageSuspectInfo2_1));
+ assertEquals(1, yView.getBindingSet().getTransientBindings().size());
+
+ // Ui was updated
+ yContent = (YVerticalLayout) cxLayoutingInfo1.getContent();
+ assertNotNull(yContent);
+ assertEquals(1, yContent.getElements().size());
+
+ vl = (VerticalLayout) cxLayoutingInfoEP1.getContent().getWidget();
+ assertEquals(1, vl.getComponentCount());
+
+ // ----------------------------------------------------------
+ // ----------------- Do full relayouting --------------------
+ // ----------------------------------------------------------
+ IStrategyLayoutEditpart layoutEP = findEditpart(yLayout);
+ layoutEP.requestLayouting();
+
+ // all active editparts have been disposed
+ assertTrue(cxLayoutingInfoEP1.isDisposed());
+ assertTrue(nameSuspectInfoEP1_1.isDisposed());
+ assertTrue(ageSuspectInfoEP1_2.isDisposed());
+
+ cxLayoutingInfo1 = yLayout.getLayoutingInfo();
+ cxLayoutingInfoEP1 = DelegatingEditPartManager.getInstance()
+ .getEditpart(viewContext, cxLayoutingInfo1);
+ yContent = (YVerticalLayout) cxLayoutingInfo1.getContent();
+ assertNotNull(yContent);
+ assertEquals(2, yContent.getElements().size());
+
+ // read the suspect layouting infos
+ //
+ nameSuspectInfo1_1 = cxLayoutingInfo1.getActiveSuspectInfos().get(0);
+ ageSuspectInfo1_2 = cxLayoutingInfo1.getActiveSuspectInfos().get(1);
+ nameSuspectInfoEP1_1 = DelegatingEditPartManager.getInstance()
+ .getEditpart(viewContext, nameSuspectInfo1_1);
+ ageSuspectInfoEP1_2 = DelegatingEditPartManager.getInstance()
+ .getEditpart(viewContext, ageSuspectInfo1_2);
+ assertFalse(cxLayoutingInfoEP1.isDisposed());
+ assertFalse(nameSuspectInfoEP1_1.isDisposed());
+ assertFalse(ageSuspectInfoEP1_2.isDisposed());
+ assertEquals(2, yView.getBindingSet().getTransientBindings().size());
+
+ // test Vaadin
+ vl = (VerticalLayout) cxLayoutingInfoEP1.getContent().getWidget();
+ assertEquals(2, vl.getComponentCount());
+
+ viewContext.dispose();
+
+ }
+
+ /**
+ * Test to show, that active rendered YLayoutingInfo can be changed. The
+ * changes are reflected to the UI, but no complete relayouting is done.
+ *
+ * @throws ContextException
+ */
+ @Test
+ public void test_LayoutingInfo_AddAndRemoveBindingValueInActive()
+ throws ContextException {
+
+ // switch the global locale to german
+ Locale.setDefault(Locale.GERMAN);
+
+ // ----------------------------------------------------------
+ // ------------- Create the layout --------------------------
+ // ----------------------------------------------------------
+ YView yView = factory.createView();
+ YBeanSlot yBeanSlot = yView.addBeanSlot("main", Person.class);
+
+ YStrategyLayout yLayout = cxFactory.createYStrategyLayout();
+ yView.setContent(yLayout);
+
+ // create suspects
+ YSuspect nameSuspect = cxFactory.createYSuspect();
+ nameSuspect.setName("name");
+ nameSuspect.getValueBindingEndpoints().add(
+ yBeanSlot.createBindingEndpoint("name"));
+ yLayout.getSuspects().add(nameSuspect);
+ YSuspect ageSuspect = cxFactory.createYSuspect();
+ ageSuspect.setName("age");
+ // ensure a decimal field
+ ageSuspect.getTags().add("decimal");
+ ageSuspect.getValueBindingEndpoints().add(
+ yBeanSlot.createBindingEndpoint("age"));
+ yLayout.getSuspects().add(ageSuspect);
+
+ // ----------------------------------------------------------
+ // ----------------- Render the UI --------------------------
+ // ----------------------------------------------------------
+ VaadinRenderer renderer = new VaadinRenderer();
+ Map<String, Object> params = new HashMap<String, Object>();
+ Map<String, Object> services = new HashMap<String, Object>();
+
+ params.put(IViewContext.PARAM_SERVICES, services);
+ services.put(ILayoutingStrategyProvider.class.getName(),
+ new DefaultLayoutingStrategyProvider());
+ services.put(IFocusingStrategyProvider.class.getName(),
+ new DefaultFocusingStrategyProvider());
+
+ viewContext = renderer.render(rootLayout, yView, params);
+ viewContext.setBean("main", new Person());
+
+ // ----------------------------------------------------------
+ // ------------- Read in the created editparts --------------
+ // ----------------------------------------------------------
+ YLayoutingInfo cxLayoutingInfo1 = yLayout.getLayoutingInfo();
+ YVerticalLayout yContent = (YVerticalLayout) cxLayoutingInfo1
+ .getContent();
+ assertNotNull(yContent);
+ assertEquals(2, yContent.getElements().size());
+
+ // read the suspect layouting infos
+ //
+ YSuspectInfo nameSuspectInfo1_1 = cxLayoutingInfo1
+ .getActiveSuspectInfos().get(0);
+
+ // ----------------------------------------------------------
+ // ----- Add a new binding to the active suspect info -------
+ // ----------------------------------------------------------
+ // make a copy -> otherwise the suspect will be changed
+ YValueBindingEndpoint yValueEPName = yBeanSlot
+ .createBindingEndpoint("name");
+ YValueBindingEndpoint yValueEPName2 = yBeanSlot
+ .createBindingEndpoint("name2");
+ YValueBinding yBinding = BindingFactory.eINSTANCE.createYValueBinding();
+ yBinding.setModelEndpoint(yValueEPName);
+ yBinding.setTargetEndpoint(yValueEPName2);
+ nameSuspectInfo1_1.getBindings().add(yBinding);
+
+ IBindingEditpart<?> bindingEP = findEditpart(yBinding);
+
+ // ensure that binding is active
+ assertEquals(3, yView.getBindingSet().getTransientBindings().size());
+ assertTrue(bindingEP.isBound());
+ assertFalse(bindingEP.isDisposed());
+
+ // ----------------------------------------------------------
+ // ---------------- Remove the binding again ----------------
+ // ----------------------------------------------------------
+ nameSuspectInfo1_1.getBindings().remove(yBinding);
+ assertEquals(2, yView.getBindingSet().getTransientBindings().size());
+ assertTrue(bindingEP.isDisposed());
+ assertFalse(bindingEP.isBound());
+
+ }
+
+ /**
+ * Tests that adding a suspect directly by model has no bad effect.
+ *
+ * @throws ContextException
+ */
+ @Test
+ public void test_AddSuspect() throws ContextException {
+
+ // switch the global locale to german
+ Locale.setDefault(Locale.GERMAN);
+
+ // ----------------------------------------------------------
+ // ------------- Create the layout --------------------------
+ // ----------------------------------------------------------
+ YView yView = factory.createView();
+ YBeanSlot yBeanSlot = yView.addBeanSlot("main", Person.class);
+
+ YStrategyLayout yLayout = cxFactory.createYStrategyLayout();
+ yView.setContent(yLayout);
+
+ // create suspects
+ YSuspect nameSuspect = cxFactory.createYSuspect();
+ nameSuspect.setName("name");
+ nameSuspect.getValueBindingEndpoints().add(
+ yBeanSlot.createBindingEndpoint("name"));
+ yLayout.getSuspects().add(nameSuspect);
+ YSuspect ageSuspect = cxFactory.createYSuspect();
+ ageSuspect.setName("age");
+ // ensure a decimal field
+ ageSuspect.getTags().add("decimal");
+ ageSuspect.getValueBindingEndpoints().add(
+ yBeanSlot.createBindingEndpoint("age"));
+ yLayout.getSuspects().add(ageSuspect);
+
+ // ----------------------------------------------------------
+ // ----------------- Render the UI --------------------------
+ // ----------------------------------------------------------
+ VaadinRenderer renderer = new VaadinRenderer();
+ Map<String, Object> params = new HashMap<String, Object>();
+ Map<String, Object> services = new HashMap<String, Object>();
+
+ params.put(IViewContext.PARAM_SERVICES, services);
+ services.put(ILayoutingStrategyProvider.class.getName(),
+ new DefaultLayoutingStrategyProvider());
+ services.put(IFocusingStrategyProvider.class.getName(),
+ new DefaultFocusingStrategyProvider());
+
+ viewContext = renderer.render(rootLayout, yView, params);
+ viewContext.setBean("main", new Person());
+
+ // ----------------------------------------------------------
+ // ----------------- Change the suspect ---------------------
+ // ----------------------------------------------------------
+ YSuspect birthdaySuspect = cxFactory.createYSuspect();
+ birthdaySuspect.setName("birthday");
+ // ensure a decimal field
+ birthdaySuspect.getTags().add("date");
+ birthdaySuspect.getValueBindingEndpoints().add(
+ yBeanSlot.createBindingEndpoint("birthday"));
+ yLayout.getSuspects().add(birthdaySuspect);
+
+ // Ensure that new suspect did not change anything
+ YLayoutingInfo cxLayoutingInfo = yLayout.getLayoutingInfo();
+ assertEquals(2, cxLayoutingInfo.getActiveSuspectInfos().size());
+
+ // ----------------------------------------------------------
+ // ----------------- Now do a relayout ----------------------
+ // ----- And the new suspect should be added to the ui -----
+ // ----------------------------------------------------------
+ IStrategyLayoutEditpart layoutEP = findEditpart(yLayout);
+ layoutEP.requestLayouting();
+
+ cxLayoutingInfo = yLayout.getLayoutingInfo();
+ assertEquals(3, cxLayoutingInfo.getActiveSuspectInfos().size());
+ }
+
+ /**
+ * Tests that adding a suspect directly by model has no bad effect.
+ *
+ * @throws ContextException
+ */
+ @Test
+ public void test_Layouter_RemoveSuspect() throws ContextException {
+
+ // switch the global locale to german
+ Locale.setDefault(Locale.GERMAN);
+
+ // ----------------------------------------------------------
+ // ------------- Create the layout --------------------------
+ // ----------------------------------------------------------
+ YView yView = factory.createView();
+ YBeanSlot yBeanSlot = yView.addBeanSlot("main", Person.class);
+
+ YStrategyLayout yLayout = cxFactory.createYStrategyLayout();
+ yView.setContent(yLayout);
+
+ // create suspects
+ YSuspect nameSuspect = cxFactory.createYSuspect();
+ nameSuspect.setName("name");
+ nameSuspect.getValueBindingEndpoints().add(
+ yBeanSlot.createBindingEndpoint("name"));
+ yLayout.getSuspects().add(nameSuspect);
+ YSuspect ageSuspect = cxFactory.createYSuspect();
+ ageSuspect.setName("age");
+ // ensure a decimal field
+ ageSuspect.getTags().add("decimal");
+ ageSuspect.getValueBindingEndpoints().add(
+ yBeanSlot.createBindingEndpoint("age"));
+ yLayout.getSuspects().add(ageSuspect);
+
+ // ----------------------------------------------------------
+ // ----------------- Render the UI --------------------------
+ // ----------------------------------------------------------
+ VaadinRenderer renderer = new VaadinRenderer();
+ Map<String, Object> params = new HashMap<String, Object>();
+ Map<String, Object> services = new HashMap<String, Object>();
+
+ params.put(IViewContext.PARAM_SERVICES, services);
+ services.put(ILayoutingStrategyProvider.class.getName(),
+ new DefaultLayoutingStrategyProvider());
+ services.put(IFocusingStrategyProvider.class.getName(),
+ new DefaultFocusingStrategyProvider());
+
+ viewContext = renderer.render(rootLayout, yView, params);
+ viewContext.setBean("main", new Person());
+
+ // ----------------------------------------------------------
+ // ------------- Remove the suspect --------------
+ // ----------------------------------------------------------
+ yLayout.getSuspects().remove(nameSuspect);
+
+ // Ensure that new suspect did not change anything
+ YLayoutingInfo cxLayoutingInfo = yLayout.getLayoutingInfo();
+ assertEquals(2, cxLayoutingInfo.getActiveSuspectInfos().size());
+
+ // ----------------------------------------------------------
+ // ------------------ Do a relayouting ----------------------
+ // ----------------------------------------------------------
+ IStrategyLayoutEditpart layoutEP = findEditpart(yLayout);
+ layoutEP.requestLayouting();
+
+ cxLayoutingInfo = yLayout.getLayoutingInfo();
+ assertEquals(1, cxLayoutingInfo.getActiveSuspectInfos().size());
+
+ }
+
+ /**
+ * Tests for the default focusing.
+ *
+ * @throws ContextException
+ */
+ @Test
+ public void test_Focusing_Default() throws ContextException {
+
+ // switch the global locale to german
+ Locale.setDefault(Locale.GERMAN);
+
+ // ----------------------------------------------------------
+ // ------------- Create the layout --------------------------
+ // ----------------------------------------------------------
+ YView yView = factory.createView();
+ YBeanSlot yBeanSlot = yView.addBeanSlot("main", Person.class);
+
+ YStrategyLayout yLayout = cxFactory.createYStrategyLayout();
+ yView.setContent(yLayout);
+
+ // create suspects
+ //
+ YSuspect nameSuspect = cxFactory.createYSuspect();
+ nameSuspect.setName("name");
+ nameSuspect.getValueBindingEndpoints().add(
+ yBeanSlot.createBindingEndpoint("name"));
+ yLayout.getSuspects().add(nameSuspect);
+ YSuspect ageSuspect = cxFactory.createYSuspect();
+ ageSuspect.setName("age");
+ // ensure a decimal field
+ ageSuspect.getTags().add("decimal");
+ ageSuspect.getValueBindingEndpoints().add(
+ yBeanSlot.createBindingEndpoint("age"));
+ yLayout.getSuspects().add(ageSuspect);
+
+ // ----------------------------------------------------------
+ // ------------- Create the focusing strategy ---------------
+ // ----------------------------------------------------------
+ YDelegatingFocusingStrategy cxStrategy = cxFactory
+ .createYDelegatingFocusingStrategy();
+ cxStrategy.setDelegateStrategyId("default");
+ cxStrategy.setKeyStrokeDefinition(null);
+ yLayout.getFocusingStrategies().add(cxStrategy);
+
+ // ----------------------------------------------------------
+ // ----------------- Render the UI --------------------------
+ // ----------------------------------------------------------
+ VaadinRenderer renderer = new VaadinRenderer();
+ Map<String, Object> params = new HashMap<String, Object>();
+ Map<String, Object> services = new HashMap<String, Object>();
+
+ params.put(IViewContext.PARAM_SERVICES, services);
+ services.put(ILayoutingStrategyProvider.class.getName(),
+ new DefaultLayoutingStrategyProvider());
+ services.put(IFocusingStrategyProvider.class.getName(),
+ new DefaultFocusingStrategyProvider());
+
+ viewContext = renderer.render(rootLayout, yView, params);
+ viewContext.setBean("main", new Person());
+
+ StrategyLayoutEditpart layoutEP = findEditpart(yLayout);
+
+ // ----------------------------------------------------------
+ // ------------- Ensure proper keystroke def ---------------
+ // ----------------------------------------------------------
+ DelegatingFocusingStrategyEditpart strategyEP = getEditpart(cxStrategy);
+ KeyStrokeDefinition keyStrokeDef = strategyEP.getKeyStrokeDefinition()
+ .getDefinition();
+ assertEquals(KeyCode.TAB, keyStrokeDef.getKeyCode());
+ assertEquals(0, keyStrokeDef.getModifierKeys().length);
+
+ DefaultFocusingStrategy stgy = (DefaultFocusingStrategy) strategyEP
+ .getStrategy();
+ assertEquals(0, stgy.calledCount);
+ assertEquals(1, layoutEP.getKeystrokeCallbacks().size());
+
+ // ----------------------------------------------------------
+ // ------------- Ensure focusing is done --------------------
+ // ----------------------------------------------------------
+ KeyStrokeCallback callback = layoutEP.getKeystrokeCallbacks().get(
+ strategyEP);
+ callback.callback(null, null);
+ assertEquals(1, stgy.calledCount);
+
+ // ----------------------------------------------------------
+ // ------------- Ensure focus strategy removed --------------
+ // ----------------------------------------------------------
+ yLayout.getFocusingStrategies().clear();
+ assertEquals(0, yLayout.getFocusingStrategies().size());
+ assertTrue(strategyEP.isDisposed());
+ assertEquals(0, layoutEP.getKeystrokeCallbacks().size());
+
+ try {
+ callback.callback(null, null);
+ fail("Exception is required");
+ } catch (Exception e) {
+ }
+
+ }
+
+ /**
+ * Tests for the focusing with two focusing strategies.
+ *
+ * @throws ContextException
+ */
+ @Test
+ public void test_Focusing_WithTwoStrategies() throws ContextException {
+
+ // switch the global locale to german
+ Locale.setDefault(Locale.GERMAN);
+
+ // ----------------------------------------------------------
+ // ------------- Create the layout --------------------------
+ // ----------------------------------------------------------
+ YView yView = factory.createView();
+ YBeanSlot yBeanSlot = yView.addBeanSlot("main", Person.class);
+
+ YStrategyLayout yLayout = cxFactory.createYStrategyLayout();
+ yView.setContent(yLayout);
+
+ // create suspects
+ //
+ YSuspect nameSuspect = cxFactory.createYSuspect();
+ nameSuspect.setName("name");
+ nameSuspect.getValueBindingEndpoints().add(
+ yBeanSlot.createBindingEndpoint("name"));
+ yLayout.getSuspects().add(nameSuspect);
+ YSuspect ageSuspect = cxFactory.createYSuspect();
+ ageSuspect.setName("age");
+ // ensure a decimal field
+ ageSuspect.getTags().add("decimal");
+ ageSuspect.getValueBindingEndpoints().add(
+ yBeanSlot.createBindingEndpoint("age"));
+ yLayout.getSuspects().add(ageSuspect);
+
+ // ----------------------------------------------------------
+ // ------------- Create two focusing strategies ---------------
+ // ----------------------------------------------------------
+ YDelegatingFocusingStrategy cxStrategy1 = cxFactory
+ .createYDelegatingFocusingStrategy();
+ cxStrategy1.setDelegateStrategyId("default");
+ cxStrategy1.setKeyStrokeDefinition(null);
+ yLayout.getFocusingStrategies().add(cxStrategy1);
+
+ YDelegatingFocusingStrategy cxStrategy2 = cxFactory
+ .createYDelegatingFocusingStrategy();
+ cxStrategy2.setDelegateStrategyId("default");
+ cxStrategy2.setKeyStrokeDefinition(null);
+ yLayout.getFocusingStrategies().add(cxStrategy2);
+
+ // ----------------------------------------------------------
+ // ----------------- Render the UI --------------------------
+ // ----------------------------------------------------------
+ VaadinRenderer renderer = new VaadinRenderer();
+ Map<String, Object> params = new HashMap<String, Object>();
+ Map<String, Object> services = new HashMap<String, Object>();
+
+ params.put(IViewContext.PARAM_SERVICES, services);
+ services.put(ILayoutingStrategyProvider.class.getName(),
+ new DefaultLayoutingStrategyProvider());
+ services.put(IFocusingStrategyProvider.class.getName(),
+ new DefaultFocusingStrategyProvider());
+
+ viewContext = renderer.render(rootLayout, yView, params);
+ viewContext.setBean("main", new Person());
+
+ StrategyLayoutEditpart layoutEP = findEditpart(yLayout);
+
+ // ----------------------------------------------------------
+ // ------------- Ensure proper keystroke def ---------------
+ // ----------------------------------------------------------
+ DelegatingFocusingStrategyEditpart strategy1EP = findEditpart(cxStrategy1);
+ KeyStrokeDefinition keyStrokeDef1 = strategy1EP
+ .getKeyStrokeDefinition().getDefinition();
+ assertEquals(KeyCode.TAB, keyStrokeDef1.getKeyCode());
+ assertEquals(0, keyStrokeDef1.getModifierKeys().length);
+
+ DefaultFocusingStrategy stgy1 = (DefaultFocusingStrategy) strategy1EP
+ .getStrategy();
+ assertEquals(0, stgy1.calledCount);
+
+ DelegatingFocusingStrategyEditpart strategy2EP = findEditpart(cxStrategy2);
+ KeyStrokeDefinition keyStrokeDef2 = strategy2EP
+ .getKeyStrokeDefinition().getDefinition();
+ assertEquals(KeyCode.TAB, keyStrokeDef2.getKeyCode());
+ assertEquals(0, keyStrokeDef2.getModifierKeys().length);
+
+ DefaultFocusingStrategy stgy2 = (DefaultFocusingStrategy) strategy2EP
+ .getStrategy();
+ assertEquals(0, stgy2.calledCount);
+
+ // ensure two callbacks available
+ assertEquals(2, layoutEP.getKeystrokeCallbacks().size());
+
+ assertNotSame(strategy1EP, strategy2EP);
+ assertNotSame(stgy1, stgy2);
+
+ // ----------------------------------------------------------
+ // ------------- Ensure focusing is done --------------------
+ // ----------------------------------------------------------
+ KeyStrokeCallback callback1 = layoutEP.getKeystrokeCallbacks().get(
+ strategy1EP);
+ callback1.callback(null, null);
+ assertEquals(1, stgy1.calledCount);
+
+ KeyStrokeCallback callback2 = layoutEP.getKeystrokeCallbacks().get(
+ strategy2EP);
+ callback2.callback(null, null);
+ assertEquals(1, stgy2.calledCount);
+
+ // ----------------------------------------------------------
+ // ------------- Now remove strategy 1 ----------------------
+ // ----------------------------------------------------------
+ yLayout.getFocusingStrategies().remove(0);
+
+ assertEquals(1, yLayout.getFocusingStrategies().size());
+ assertTrue(strategy1EP.isDisposed());
+ assertEquals(1, layoutEP.getKeystrokeCallbacks().size());
+
+ try {
+ callback1.callback(null, null);
+ fail("Exception is required");
+ } catch (Exception e) {
+ }
+
+ // ----------------------------------------------------------
+ // ------------- Now add another strategy -------------------
+ // ------------- with keystroke definitions -----------------
+ // ----------------------------------------------------------
+
+ YDelegatingFocusingStrategy cxStrategy3 = cxFactory
+ .createYDelegatingFocusingStrategy();
+ cxStrategy3.setDelegateStrategyId("default");
+ YKeyStrokeDefinition yKeyStrokeDef3 = CoreModelFactory.eINSTANCE
+ .createYKeyStrokeDefinition();
+ yKeyStrokeDef3.setKeyCode(YKeyCode.B);
+ yKeyStrokeDef3.getModifierKeys().add(YModifierKey.ALT);
+ yKeyStrokeDef3.getModifierKeys().add(YModifierKey.CTRL);
+ cxStrategy3.setKeyStrokeDefinition(yKeyStrokeDef3);
+ yLayout.getFocusingStrategies().add(cxStrategy3);
+
+ DelegatingFocusingStrategyEditpart strategy3EP = findEditpart(cxStrategy3);
+ KeyStrokeDefinition keyStrokeDef3 = strategy3EP
+ .getKeyStrokeDefinition().getDefinition();
+ assertEquals(KeyCode.B, keyStrokeDef3.getKeyCode());
+ assertEquals(2, keyStrokeDef3.getModifierKeys().length);
+
+ DefaultFocusingStrategy stgy3 = (DefaultFocusingStrategy) strategy3EP
+ .getStrategy();
+ assertEquals(0, stgy3.calledCount);
+
+ // ensure two callbacks available
+ assertEquals(2, layoutEP.getKeystrokeCallbacks().size());
+
+ KeyStrokeCallback callback3 = layoutEP.getKeystrokeCallbacks().get(
+ strategy3EP);
+ callback3.callback(null, null);
+ assertEquals(1, stgy3.calledCount);
+
+ callback3.callback(null, null);
+ assertEquals(2, stgy3.calledCount);
+
+ // ----------------------------------------------------------
+ // ------------- Now dispose all focusing strategies --------
+ // ----------------------------------------------------------
+ yLayout.getFocusingStrategies().remove(0);
+ yLayout.getFocusingStrategies().remove(0);
+
+ assertTrue(strategy2EP.isDisposed());
+ assertTrue(strategy3EP.isDisposed());
+
+ assertEquals(0, yLayout.getFocusingStrategies().size());
+ assertEquals(0, layoutEP.getKeystrokeCallbacks().size());
+ try {
+ callback2.callback(null, null);
+ fail("Exception is required");
+ } catch (Exception e) {
+ }
+ try {
+ callback3.callback(null, null);
+ fail("Exception is required");
+ } catch (Exception e) {
+ }
+ }
+
+ /**
+ * Tests for the event management in Vaadin.
+ *
+ * @throws ContextException
+ */
+ @Test
+ public void test_Focusing_VaadinEvents() throws ContextException {
+
+ // switch the global locale to german
+ Locale.setDefault(Locale.GERMAN);
+
+ // ----------------------------------------------------------
+ // ------------- Create the layout --------------------------
+ // ----------------------------------------------------------
+ YView yView = factory.createView();
+ YBeanSlot yBeanSlot = yView.addBeanSlot("main", Person.class);
+
+ YStrategyLayout yLayout = cxFactory.createYStrategyLayout();
+ yView.setContent(yLayout);
+
+ // create suspects
+ //
+ YSuspect nameSuspect = cxFactory.createYSuspect();
+ nameSuspect.setName("name");
+ nameSuspect.getValueBindingEndpoints().add(
+ yBeanSlot.createBindingEndpoint("name"));
+ yLayout.getSuspects().add(nameSuspect);
+ YSuspect ageSuspect = cxFactory.createYSuspect();
+ ageSuspect.setName("age");
+ // ensure a decimal field
+ ageSuspect.getTags().add("decimal");
+ ageSuspect.getValueBindingEndpoints().add(
+ yBeanSlot.createBindingEndpoint("age"));
+ yLayout.getSuspects().add(ageSuspect);
+
+ // ----------------------------------------------------------
+ // ------------- Create the focusing strategy ---------------
+ // ----------------------------------------------------------
+ YDelegatingFocusingStrategy cxStrategy = cxFactory
+ .createYDelegatingFocusingStrategy();
+ cxStrategy.setDelegateStrategyId("default");
+ cxStrategy.setKeyStrokeDefinition(null);
+ yLayout.getFocusingStrategies().add(cxStrategy);
+
+ YKeyStrokeDefinition yKeyStrokeDef = CoreModelFactory.eINSTANCE
+ .createYKeyStrokeDefinition();
+ yKeyStrokeDef.setKeyCode(YKeyCode.TAB);
+ yKeyStrokeDef.getModifierKeys().add(YModifierKey.ALT);
+ yKeyStrokeDef.getModifierKeys().add(YModifierKey.CTRL);
+ cxStrategy.setKeyStrokeDefinition(yKeyStrokeDef);
+
+ // ----------------------------------------------------------
+ // ----------------- Render the UI --------------------------
+ // ----------------------------------------------------------
+ VaadinRenderer renderer = new VaadinRenderer();
+ Map<String, Object> params = new HashMap<String, Object>();
+ Map<String, Object> services = new HashMap<String, Object>();
+
+ params.put(IViewContext.PARAM_SERVICES, services);
+ services.put(ILayoutingStrategyProvider.class.getName(),
+ new DefaultLayoutingStrategyProvider());
+ services.put(IFocusingStrategyProvider.class.getName(),
+ new DefaultFocusingStrategyProvider());
+
+ viewContext = renderer.render(rootLayout, yView, params);
+ viewContext.setBean("main", new Person());
+
+ StrategyLayoutEditpart layoutEP = findEditpart(yLayout);
+
+ // ----------------------------------------------------------
+ // ------------- Ensure proper keystroke def ---------------
+ // ----------------------------------------------------------
+ DelegatingFocusingStrategyEditpart strategyEP = getEditpart(cxStrategy);
+ DefaultFocusingStrategy stgy = (DefaultFocusingStrategy) strategyEP
+ .getStrategy();
+ assertEquals(0, stgy.calledCount);
+
+ // ----------------------------------------------------------
+ // ------------- Ensure focusing is done --------------------
+ // ----------------------------------------------------------
+ Panel panel = (Panel) layoutEP.getWidget();
+ ActionManager actionManager = getActionManager(panel);
+
+ ShortcutAction action = (ShortcutAction) actionManager.getActions(null,
+ null)[0];
+ VerticalLayout panelContent = (VerticalLayout) panel.getContent();
+ VerticalLayout innerPanelContent = (VerticalLayout) panelContent
+ .getComponent(0);
+ actionManager.handleAction(action, panel,
+ innerPanelContent.getComponent(0));
+ assertEquals(1, stgy.calledCount);
+
+ ShortcutAction action2 = new ShortcutAction("", KeyCode.ENTER,
+ new int[] { ModifierKey.SHIFT });
+ actionManager.handleAction(action2, panel, panel);
+ assertEquals(1, stgy.calledCount);
+ }
+
+ /**
+ * Tests for the event management in Vaadin.
+ *
+ * @throws ContextException
+ */
+ @Test
+ public void test_Focusing_FieldGetsFocus() throws ContextException {
+
+ // switch the global locale to german
+ Locale.setDefault(Locale.GERMAN);
+
+ // ----------------------------------------------------------
+ // ------------- Create the layout --------------------------
+ // ----------------------------------------------------------
+ YView yView = factory.createView();
+ YBeanSlot yBeanSlot = yView.addBeanSlot("main", Person.class);
+
+ YStrategyLayout yLayout = cxFactory.createYStrategyLayout();
+ yView.setContent(yLayout);
+
+ // create suspects
+ //
+ YSuspect nameSuspect = cxFactory.createYSuspect();
+ nameSuspect.setName("name");
+ nameSuspect.getValueBindingEndpoints().add(
+ yBeanSlot.createBindingEndpoint("name"));
+ yLayout.getSuspects().add(nameSuspect);
+ YSuspect ageSuspect = cxFactory.createYSuspect();
+ ageSuspect.setName("age");
+ // ensure a decimal field
+ ageSuspect.getTags().add("decimal");
+ ageSuspect.getValueBindingEndpoints().add(
+ yBeanSlot.createBindingEndpoint("age"));
+ yLayout.getSuspects().add(ageSuspect);
+
+ // ----------------------------------------------------------
+ // ------------- Create the focusing strategy ---------------
+ // ----------------------------------------------------------
+ YDelegatingFocusingStrategy cxStrategy = cxFactory
+ .createYDelegatingFocusingStrategy();
+ cxStrategy.setDelegateStrategyId("default");
+ cxStrategy.setKeyStrokeDefinition(null);
+ yLayout.getFocusingStrategies().add(cxStrategy);
+
+ YKeyStrokeDefinition yKeyStrokeDef = CoreModelFactory.eINSTANCE
+ .createYKeyStrokeDefinition();
+ yKeyStrokeDef.setKeyCode(YKeyCode.TAB);
+ yKeyStrokeDef.getModifierKeys().add(YModifierKey.ALT);
+ yKeyStrokeDef.getModifierKeys().add(YModifierKey.CTRL);
+ cxStrategy.setKeyStrokeDefinition(yKeyStrokeDef);
+
+ // ----------------------------------------------------------
+ // ----------------- Render the UI --------------------------
+ // ----------------------------------------------------------
+ VaadinRenderer renderer = new VaadinRenderer();
+ Map<String, Object> params = new HashMap<String, Object>();
+ Map<String, Object> services = new HashMap<String, Object>();
+
+ params.put(IViewContext.PARAM_SERVICES, services);
+ services.put(ILayoutingStrategyProvider.class.getName(),
+ new DefaultLayoutingStrategyProvider());
+ services.put(IFocusingStrategyProvider.class.getName(),
+ new DefaultFocusingStrategyProvider());
+
+ viewContext = renderer.render(rootLayout, yView, params);
+ viewContext.setBean("main", new Person());
+
+ StrategyLayoutEditpart layoutEP = findEditpart(yLayout);
+ DelegatingFocusingStrategyEditpart strategyEP = getEditpart(cxStrategy);
+ DefaultFocusingStrategy stgy = (DefaultFocusingStrategy) strategyEP
+ .getStrategy();
+ assertEquals(0, stgy.calledCount);
+
+ // ----------------------------------------------------------
+ // ------------- Ensure focusing is done --------------------
+ // ----------------------------------------------------------
+ Panel panel = (Panel) layoutEP.getWidget();
+ ActionManager actionManager = getActionManager(panel);
+
+ YVerticalLayout yContent = (YVerticalLayout) yLayout.getLayoutingInfo()
+ .getContent();
+ YTextField yNameField = (YTextField) yContent.getElements().get(0);
+ YDecimalField yAgeField = (YDecimalField) yContent.getElements().get(1);
+
+ // set the name field to be focused now
+ yView.setCurrentFocus(yNameField);
+
+ // now send an TAB-event. Then the age fields needs to have the focus.
+ ShortcutAction action = (ShortcutAction) actionManager.getActions(null,
+ null)[0];
+ VerticalLayout panelContent = (VerticalLayout) panel.getContent();
+ VerticalLayout innerPanelContent = (VerticalLayout) panelContent
+ .getComponent(0);
+ actionManager.handleAction(action, panel,
+ innerPanelContent.getComponent(0));
+ assertSame(yView.getCurrentFocus(), yAgeField);
+
+ // send an event that is not handled
+ ShortcutAction action2 = new ShortcutAction("", KeyCode.ENTER,
+ new int[] { ModifierKey.SHIFT });
+ actionManager.handleAction(action2, panel, panel);
+ assertSame(yView.getCurrentFocus(), yAgeField);
+
+ // now send another proper event
+ actionManager.handleAction(action, panel,
+ innerPanelContent.getComponent(1));
+ assertSame(yView.getCurrentFocus(), yNameField);
+
+ }
+
+ protected ActionManager getActionManager(Component panel) {
+ ActionManager actionManager = null;
+ try {
+ Method m = AbstractComponent.class.getDeclaredMethod(
+ "getActionManager", new Class[0]);
+ if (!m.isAccessible()) {
+ m.setAccessible(true);
+ }
+ actionManager = (ActionManager) m.invoke(panel, new Object[0]);
+ } catch (NoSuchMethodException | IllegalAccessException
+ | InvocationTargetException e) {
+ fail(e.toString());
+ }
+ return actionManager;
+ }
+
+ private static class DefaultLayoutingStrategyProvider implements
+ ILayoutingStrategyProvider {
+
+ @Override
+ public ILayoutingStrategy getStrategy() {
+ return new DefaultLayoutingStrategy();
+ }
+
+ }
+
+ private static class OnlyLayoutTaggedStrategyProvider implements
+ ILayoutingStrategyProvider {
+
+ @Override
+ public ILayoutingStrategy getStrategy() {
+ return new OnlyLayoutTaggedStrategy();
+ }
+
+ }
+
+ public static class DefaultFocusingStrategyProvider implements
+ IFocusingStrategyProvider {
+
+ private IFocusingStrategy strategy;
+
+ @Override
+ public IFocusingStrategy getStrategy() {
+ return strategy != null ? strategy : new DefaultFocusingStrategy();
+ }
+ }
+
+ protected static class DefaultLayoutingStrategy implements
+ ILayoutingStrategy {
+
+ @Override
+ public void layout(YLayoutingInfo layoutingInfo) {
+ YStrategyLayout cxLayout = layoutingInfo.getLayout();
+ layoutingInfo.getActiveSuspectInfos().clear();
+
+ YVerticalLayout content = ExtensionModelFactory.eINSTANCE
+ .createYVerticalLayout();
+
+ for (YSuspect suspect : new ArrayList<YSuspect>(
+ cxLayout.getSuspects())) {
+ YSuspectInfo suspectInfo = layoutingInfo
+ .createSuspectInfo(suspect);
+ // add the suspectInfo as active suspect
+ layoutingInfo.getActiveSuspectInfos().add(suspectInfo);
+
+ YEmbeddable yEmbeddable = prepareElementForSuspect(suspectInfo);
+ content.addElement(yEmbeddable);
+ }
+
+ layoutingInfo.setContent(content);
+ }
+
+ /**
+ * Creates a new element for the given suspect. Handle bindings,...
+ *
+ * @param suspectInfo
+ * @return
+ */
+ protected YEmbeddable prepareElementForSuspect(YSuspectInfo suspectInfo) {
+ // create a new element for the given suspect
+ YEmbeddable yEmbeddable = createElementForSuspect(suspectInfo);
+
+ // prepares the value bindings
+ prepareValueBindings(suspectInfo, yEmbeddable);
+
+ return yEmbeddable;
+ }
+
+ protected void prepareValueBindings(YSuspectInfo suspectInfo,
+ YEmbeddable yEmbeddable) {
+ YSuspect cxSuspect = suspectInfo.getSuspect();
+ // iterate over all elements
+ for (YBindingEndpoint ep : cxSuspect.getValueBindingEndpoints()) {
+
+ /*
+ * if yEmbeddable is a value bindable and ep a value binding
+ */
+ if (ep instanceof YValueBindingEndpoint
+ && yEmbeddable instanceof YValueBindable) {
+ YValueBindable yBindable = (YValueBindable) yEmbeddable;
+ // make a copy -> otherwise the suspect will be changed
+ YBindingEndpoint epCopy = EcoreUtil.copy(ep);
+
+ YValueBindingEndpoint yValueEP = yBindable
+ .createValueEndpoint();
+ YValueBinding yBinding = BindingFactory.eINSTANCE
+ .createYValueBinding();
+ yBinding.setModelEndpoint((YValueBindingEndpoint) epCopy);
+ yBinding.setTargetEndpoint(yValueEP);
+
+ // register binding add suspect. Will be handled
+ // automatically.
+ suspectInfo.getBindings().add(yBinding);
+
+ /*
+ * if yEmbeddable is a collection bindable and ep a list
+ * binding
+ */
+ } else if (ep instanceof YListBindingEndpoint
+ && yEmbeddable instanceof YCollectionBindable) {
+ YCollectionBindable yBindable = (YCollectionBindable) yEmbeddable;
+ // make a copy -> otherwise the suspect will be changed
+ YBindingEndpoint epCopy = EcoreUtil.copy(ep);
+
+ YEmbeddableCollectionEndpoint yListEP = yBindable
+ .createCollectionEndpoint();
+ YListBinding yBinding = BindingFactory.eINSTANCE
+ .createYListBinding();
+ yBinding.setModelEndpoint((YListBindingEndpoint) epCopy);
+ yBinding.setTargetEndpoint(yListEP);
+
+ // register binding add suspect. Will be handled
+ // automatically.
+ suspectInfo.getBindings().add(yBinding);
+ }
+ }
+ }
+
+ protected YEmbeddable createElementForSuspect(YSuspectInfo suspectInfo) {
+ YSuspect cxSuspect = suspectInfo.getSuspect();
+ YEmbeddable yEmbeddable = null;
+ if (cxSuspect.getTags().contains("decimal")) {
+ yEmbeddable = ExtensionModelFactory.eINSTANCE
+ .createYDecimalField();
+ } else {
+ yEmbeddable = ExtensionModelFactory.eINSTANCE
+ .createYTextField();
+ }
+ return yEmbeddable;
+ }
+ }
+
+ protected static class OnlyLayoutTaggedStrategy extends
+ DefaultLayoutingStrategy {
+
+ @Override
+ public void layout(YLayoutingInfo layoutingInfo) {
+ YStrategyLayout cxLayout = layoutingInfo.getLayout();
+ layoutingInfo.getActiveSuspectInfos().clear();
+
+ YVerticalLayout content = ExtensionModelFactory.eINSTANCE
+ .createYVerticalLayout();
+
+ for (YSuspect suspect : new ArrayList<YSuspect>(
+ cxLayout.getSuspects())) {
+ if (suspect.getTags().isEmpty()) {
+ continue;
+ }
+ YSuspectInfo suspectInfo = layoutingInfo
+ .createSuspectInfo(suspect);
+ // add the suspectInfo as active suspect
+ layoutingInfo.getActiveSuspectInfos().add(suspectInfo);
+
+ YEmbeddable yEmbeddable = prepareElementForSuspect(suspectInfo);
+ content.addElement(yEmbeddable);
+ }
+
+ layoutingInfo.setContent(content);
+ }
+ }
+
+ /**
+ * The default focusing strategy focuses the next field in the order they
+ * appear in the layout.
+ */
+ private static class DefaultFocusingStrategy implements IFocusingStrategy {
+
+ protected int calledCount;
+
+ @Override
+ public void focus(Object source, Object target, YStrategyLayout cxLayout) {
+ calledCount++;
+
+ YView yView = cxLayout.getView();
+ IViewContext context = ModelUtil.getViewContext(yView);
+ IWidgetAssocationsService<Object, ? extends YElement> service = context
+ .getService(IWidgetAssocationsService.ID);
+ YEmbeddable yCurrentFocus = (YEmbeddable) service
+ .getModelElement(target);
+ YEmbeddable yNextFocus = findNextElementToFocus(yCurrentFocus);
+
+ yView.setCurrentFocus((YFocusable) yNextFocus);
+
+ }
+
+ /**
+ * Looks for the next element to be focused. Therefore it uses a round
+ * robin approach. If end of elements are reached, we start by index = 0
+ * again.
+ *
+ * @param yElement
+ * @return
+ */
+ protected YEmbeddable findNextElementToFocus(YEmbeddable yElement) {
+ if (yElement == null) {
+ return null;
+ }
+ YLayout yParent = (YLayout) yElement.eContainer();
+ int index = yParent.getElements().indexOf(yElement);
+ if (index == yParent.getElements().size() - 1) {
+ // element is the last -> Start again
+ index = 0;
+ } else {
+ // use the next element
+ index = index + 1;
+ }
+
+ YEmbeddable nextFocusElement = yParent.getElements().get(index);
+ return nextFocusElement;
+ }
+
+ @Override
+ public KeyStrokeDefinition getKeyStrokeDefinition() {
+ // returns the default keystroke definition if nothing else was
+ // defined.
+ KeyStrokeDefinition result = new KeyStrokeDefinition("TestMe",
+ KeyCode.TAB, new int[0]);
+ return result;
+ }
+
+ }
+
+ private static class OtherFocusingStrategy extends DefaultFocusingStrategy {
+
+ }
+
+}
diff --git a/org.eclipse.osbp.ecview.extension.presentation.vaadin.tests/src/org/eclipse/osbp/ecview/extension/presentation/tests/strategy/ValueBean.java b/org.eclipse.osbp.ecview.extension.presentation.vaadin.tests/src/org/eclipse/osbp/ecview/extension/presentation/tests/strategy/ValueBean.java
new file mode 100644
index 0000000..2f3326c
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.presentation.vaadin.tests/src/org/eclipse/osbp/ecview/extension/presentation/tests/strategy/ValueBean.java
@@ -0,0 +1,146 @@
+/**
+ *
+ * Copyright (c) 2015 - 2016 - Loetz GmbH&Co.KG, 69115 Heidelberg, Germany
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Loetz GmbH&Co.KG - Initial implementation
+ *
+ */
+ package org.eclipse.osbp.ecview.extension.presentation.tests.strategy;
+
+import java.util.Date;
+
+public class ValueBean extends AbstractBean {
+
+ private String value;
+ private byte[] bytesValue;
+ private boolean boolValue;
+ private Date dateValue;
+ private int intValue;
+ private long longValue;
+ private double doubleValue;
+ private float floatValue;
+
+ public ValueBean(String value) {
+ super();
+ this.value = value;
+ }
+
+ public ValueBean(byte[] bytesValue) {
+ super();
+ this.bytesValue = bytesValue;
+ }
+
+ public ValueBean(boolean value) {
+ super();
+ this.boolValue = value;
+ }
+
+ public ValueBean(Date value) {
+ super();
+ this.dateValue = value;
+ }
+
+ public ValueBean(int value) {
+ super();
+ this.intValue = value;
+ }
+
+ public ValueBean(long value) {
+ super();
+ this.longValue = value;
+ }
+
+ public ValueBean(double value) {
+ super();
+ this.doubleValue = value;
+ }
+
+ public ValueBean(float value) {
+ super();
+ this.floatValue = value;
+ }
+
+ /**
+ * @return the value
+ */
+ public String getValue() {
+ return value;
+ }
+
+ /**
+ * @param value
+ * the value to set
+ */
+ public void setValue(String value) {
+ firePropertyChanged("value", this.value, this.value = value);
+ }
+
+ public boolean isBoolValue() {
+ return boolValue;
+ }
+
+ public void setBoolValue(boolean boolValue) {
+ firePropertyChanged("boolValue", this.boolValue,
+ this.boolValue = boolValue);
+ }
+
+ public Date getDateValue() {
+ return dateValue;
+ }
+
+ public void setDateValue(Date dateValue) {
+ firePropertyChanged("dateValue", this.dateValue,
+ this.dateValue = dateValue);
+ }
+
+ public int getIntValue() {
+ return intValue;
+ }
+
+ public void setIntValue(int intValue) {
+ firePropertyChanged("intValue", this.intValue, this.intValue = intValue);
+ }
+
+ public long getLongValue() {
+ return longValue;
+ }
+
+ public void setLongValue(long longValue) {
+ firePropertyChanged("longValue", this.longValue,
+ this.longValue = longValue);
+ }
+
+ public double getDoubleValue() {
+ return doubleValue;
+ }
+
+ public void setDoubleValue(double doubleValue) {
+ firePropertyChanged("doubleValue", this.doubleValue,
+ this.doubleValue = doubleValue);
+ }
+
+ public float getFloatValue() {
+ return floatValue;
+ }
+
+ public void setFloatValue(float floatValue) {
+ firePropertyChanged("floatValue", this.floatValue,
+ this.floatValue = floatValue);
+ }
+
+ public byte[] getBytesValue() {
+ return bytesValue;
+ }
+
+ public void setBytesValue(byte[] bytesValue) {
+ firePropertyChanged("bytesValue", this.bytesValue,
+ this.bytesValue = bytesValue);
+ }
+
+}
diff --git a/org.eclipse.osbp.ecview.extension.presentation.vaadin/.classpath b/org.eclipse.osbp.ecview.extension.presentation.vaadin/.classpath
new file mode 100644
index 0000000..cf36b56
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.presentation.vaadin/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src/"/>
+ <classpathentry kind="output" path="target/classes"/>
+</classpath>
diff --git a/org.eclipse.osbp.ecview.extension.presentation.vaadin/.gitignore b/org.eclipse.osbp.ecview.extension.presentation.vaadin/.gitignore
new file mode 100644
index 0000000..b83d222
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.presentation.vaadin/.gitignore
@@ -0,0 +1 @@
+/target/
diff --git a/org.eclipse.osbp.ecview.extension.presentation.vaadin/.settings/com.vaadin.integration.eclipse.prefs b/org.eclipse.osbp.ecview.extension.presentation.vaadin/.settings/com.vaadin.integration.eclipse.prefs
new file mode 100644
index 0000000..0904e44
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.presentation.vaadin/.settings/com.vaadin.integration.eclipse.prefs
@@ -0,0 +1,2 @@
+com.vaadin.integration.eclipse.mavenLatestVersionsUpgrade=["7.7.7"]
+eclipse.preferences.version=1
diff --git a/org.eclipse.osbp.ecview.extension.presentation.vaadin/.settings/org.eclipse.core.resources.prefs b/org.eclipse.osbp.ecview.extension.presentation.vaadin/.settings/org.eclipse.core.resources.prefs
new file mode 100644
index 0000000..99f26c0
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.presentation.vaadin/.settings/org.eclipse.core.resources.prefs
@@ -0,0 +1,2 @@
+eclipse.preferences.version=1
+encoding/<project>=UTF-8
diff --git a/org.eclipse.osbp.ecview.extension.presentation.vaadin/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.osbp.ecview.extension.presentation.vaadin/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 0000000..0c68a61
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.presentation.vaadin/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,7 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+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.8
diff --git a/org.eclipse.osbp.ecview.extension.presentation.vaadin/.settings/org.eclipse.m2e.core.prefs b/org.eclipse.osbp.ecview.extension.presentation.vaadin/.settings/org.eclipse.m2e.core.prefs
new file mode 100644
index 0000000..f897a7f
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.presentation.vaadin/.settings/org.eclipse.m2e.core.prefs
@@ -0,0 +1,4 @@
+activeProfiles=
+eclipse.preferences.version=1
+resolveWorkspaceProjects=true
+version=1
diff --git a/org.eclipse.osbp.ecview.extension.presentation.vaadin/.settings/org.eclipse.xtend.core.Xtend.prefs b/org.eclipse.osbp.ecview.extension.presentation.vaadin/.settings/org.eclipse.xtend.core.Xtend.prefs
new file mode 100644
index 0000000..19e3115
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.presentation.vaadin/.settings/org.eclipse.xtend.core.Xtend.prefs
@@ -0,0 +1,11 @@
+//outlet.DEFAULT_OUTPUT.sourceFolder.src/test/java.directory=src/test/generated-sources/xtend
+BuilderConfiguration.is_project_specific=true
+eclipse.preferences.version=1
+is_project_specific=true
+outlet.DEFAULT_OUTPUT.hideLocalSyntheticVariables=true
+outlet.DEFAULT_OUTPUT.installDslAsPrimarySource=false
+outlet.DEFAULT_OUTPUT.sourceFolder.emf-gen.directory=xtend-gen
+outlet.DEFAULT_OUTPUT.sourceFolder.src-gen.directory=xtend-gen
+outlet.DEFAULT_OUTPUT.sourceFolder.src.directory=xtend-gen
+outlet.DEFAULT_OUTPUT.sourceFolder.xtend-gen.directory=xtend-gen
+outlet.DEFAULT_OUTPUT.userOutputPerSourceFolder=true
diff --git a/org.eclipse.osbp.ecview.extension.presentation.vaadin/META-INF/MANIFEST.MF b/org.eclipse.osbp.ecview.extension.presentation.vaadin/META-INF/MANIFEST.MF
index 3e75676..2d15d90 100644
--- a/org.eclipse.osbp.ecview.extension.presentation.vaadin/META-INF/MANIFEST.MF
+++ b/org.eclipse.osbp.ecview.extension.presentation.vaadin/META-INF/MANIFEST.MF
@@ -5,9 +5,9 @@
Bundle-Vendor: Eclipse OSBP
Bundle-Version: 0.9.0.qualifier
Require-Bundle: org.slf4j.api,
- com.vaadin.shared;bundle-version="[7.5.7,7.7.0)",
- com.vaadin.client;bundle-version="[7.5.7,7.7.0)",
- com.vaadin.server;bundle-version="[7.5.7,7.7.0)",
+ com.vaadin.shared;bundle-version="[7.7.6,7.8.0)",
+ com.vaadin.client;bundle-version="[7.7.6,7.8.0)",
+ com.vaadin.server;bundle-version="[7.7.6,7.8.0)",
com.ibm.icu;bundle-version="50.1.1",
org.eclipse.osbp.ecview.core.common;bundle-version="[0.9.0,0.10.0)",
org.eclipse.osbp.ecview.core.common.editparts.emf;bundle-version="[0.9.0,0.10.0)",
@@ -26,33 +26,34 @@
org.eclipse.osbp.ecview.extension.model;bundle-version="[0.9.0,0.10.0)",
org.eclipse.emf.databinding;bundle-version="1.3.0",
org.jsoup;bundle-version="1.7.2",
- org.eclipse.e4.core.contexts,
org.eclipse.osbp.utils.functionnormalizer;bundle-version="[0.9.0,0.10.0)",
org.eclipse.osbp.ecview.extension.api;bundle-version="[0.9.0,0.10.0)",
org.apache.commons.beanutils;bundle-version="1.9.2",
- org.eclipse.core.databinding.beans,
+ org.eclipse.core.databinding.beans;bundle-version="[1.3.100,1.4.0)",
org.eclipse.osbp.dsl.dto.lib;bundle-version="[0.9.0,0.10.0)",
org.eclipse.osbp.xtext.functionlibrary.common;bundle-version="[0.9.0,0.10.0)",
org.eclipse.uomo.units;bundle-version="0.6.0",
org.unitsofmeasurement.unit-api;bundle-version="0.6.1",
- org.eclipse.osbp.vaadin.addons.designer.overlay;bundle-version="0.9.0",
- dragdroplayouts.osgi;bundle-version="1.1.3",
- org.eclipse.osbp.fork.vaadin.addon.maskedtextfield;bundle-version="0.1.10",
- org.eclipse.osbp.runtime.web.vaadin.components.widget,
- org.eclipse.xtext.util,
- org.eclipse.core.databinding.property;bundle-version="1.4.200"
+ org.eclipse.osbp.vaadin.addons.designer.overlay;bundle-version="[0.9.0,0.10.0)",
+ dragdroplayouts.osgi;bundle-version="[1.3.2,1.3.3)",
+ org.eclipse.osbp.fork.vaadin.addon.maskedtextfield;bundle-version="[0.1.10,0.1.11)",
+ org.eclipse.osbp.runtime.web.vaadin.components.widget;bundle-version="[0.9.0,0.10.0)",
+ org.eclipse.xtext.util;bundle-version="[2.11.0,2.12.0)",
+ org.eclipse.core.databinding.property;bundle-version="[1.6.0,1.7.0)",
+ org.eclipse.osbp.blob;bundle-version="0.9.0"
Import-Package: org.apache.commons.lang,
org.eclipse.core.databinding.property.value,
org.eclipse.e4.core.services.events,
org.eclipse.osbp.ui.api.customfields;version="0.9.0",
org.eclipse.osbp.ui.api.functionlibrary;version="0.9.0",
org.eclipse.osbp.ui.api.themes;version="0.9.0",
- org.eclipse.osbp.utils.blob.component;version="0.9.0",
org.eclipse.osbp.utils.functionnormalizer.api;version="0.9.0",
+ org.eclipse.osbp.utils.themes.ui;version="0.9.0",
org.eclipse.osbp.utils.vaadin;version="0.9.0",
org.osgi.framework;version="1.7.0",
org.osgi.service.component.annotations;version="1.2.0"
Export-Package: org.eclipse.osbp.ecview.extension.presentation.vaadin;version="0.9.0";x-internal:=true,
+ org.eclipse.osbp.ecview.extension.presentation.vaadin.components;version="0.9.0",
org.eclipse.osbp.ecview.extension.presentation.vaadin.components.common;version="0.9.0",
org.eclipse.osbp.ecview.extension.presentation.vaadin.converter;version="0.9.0",
org.eclipse.osbp.ecview.extension.presentation.vaadin.strategy,
@@ -61,4 +62,5 @@
org.eclipse.osbp.ecview.extension.vaadin.components.utils;version="0.9.0"
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Bundle-ActivationPolicy: lazy
-Service-Component: OSGI-INF/*.xml
+Service-Component: OSGI-INF/org.eclipse.osbp.ecview.extension.presentation.vaadin.converter.ConverterFactory.xml,
+ OSGI-INF/org.eclipse.osbp.ecview.extension.presentation.vaadin.PresenterFactory.xml
diff --git a/org.eclipse.osbp.ecview.extension.presentation.vaadin/OSGI-INF/presentationFactory.xml b/org.eclipse.osbp.ecview.extension.presentation.vaadin/OSGI-INF/org.eclipse.osbp.ecview.extension.presentation.vaadin.PresenterFactory.xml
similarity index 74%
rename from org.eclipse.osbp.ecview.extension.presentation.vaadin/OSGI-INF/presentationFactory.xml
rename to org.eclipse.osbp.ecview.extension.presentation.vaadin/OSGI-INF/org.eclipse.osbp.ecview.extension.presentation.vaadin.PresenterFactory.xml
index 54c0a9f..2dd335d 100644
--- a/org.eclipse.osbp.ecview.extension.presentation.vaadin/OSGI-INF/presentationFactory.xml
+++ b/org.eclipse.osbp.ecview.extension.presentation.vaadin/OSGI-INF/org.eclipse.osbp.ecview.extension.presentation.vaadin.PresenterFactory.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
-<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" name="org.eclipse.osbp.ecview.extension.presentation.vaadin.factory">
- <implementation class="org.eclipse.osbp.ecview.extension.presentation.vaadin.PresenterFactory"/>
+<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" immediate="true" name="org.eclipse.osbp.ecview.extension.presentation.vaadin.PresenterFactory">
<service>
<provide interface="org.eclipse.osbp.ecview.core.common.presentation.IPresentationFactory"/>
</service>
-</scr:component>
+ <implementation class="org.eclipse.osbp.ecview.extension.presentation.vaadin.PresenterFactory"/>
+</scr:component>
\ No newline at end of file
diff --git a/org.eclipse.osbp.ecview.extension.presentation.vaadin/src/org/eclipse/osbp/ecview/extension/presentation/vaadin/PresenterFactory.java b/org.eclipse.osbp.ecview.extension.presentation.vaadin/src/org/eclipse/osbp/ecview/extension/presentation/vaadin/PresenterFactory.java
index faca014..64b2eba 100644
--- a/org.eclipse.osbp.ecview.extension.presentation.vaadin/src/org/eclipse/osbp/ecview/extension/presentation/vaadin/PresenterFactory.java
+++ b/org.eclipse.osbp.ecview.extension.presentation.vaadin/src/org/eclipse/osbp/ecview/extension/presentation/vaadin/PresenterFactory.java
@@ -41,10 +41,12 @@
import org.eclipse.osbp.ecview.extension.presentation.vaadin.components.RichTextAreaPresentation;
import org.eclipse.osbp.ecview.extension.presentation.vaadin.strategy.StrategyLayoutPresentation;
import org.eclipse.osbp.runtime.web.ecview.presentation.vaadin.VaadinRenderer;
+import org.osgi.service.component.annotations.Component;
/**
* The presenter factory.
*/
+@Component(immediate = true, service = { IPresentationFactory.class })
public class PresenterFactory implements IPresentationFactory {
/**
diff --git a/org.eclipse.osbp.ecview.extension.presentation.vaadin/src/org/eclipse/osbp/ecview/extension/presentation/vaadin/components/BlobUploadComponentPresentation.java b/org.eclipse.osbp.ecview.extension.presentation.vaadin/src/org/eclipse/osbp/ecview/extension/presentation/vaadin/components/BlobUploadComponentPresentation.java
index b00374c..0f5af74 100644
--- a/org.eclipse.osbp.ecview.extension.presentation.vaadin/src/org/eclipse/osbp/ecview/extension/presentation/vaadin/components/BlobUploadComponentPresentation.java
+++ b/org.eclipse.osbp.ecview.extension.presentation.vaadin/src/org/eclipse/osbp/ecview/extension/presentation/vaadin/components/BlobUploadComponentPresentation.java
@@ -18,12 +18,10 @@
import org.eclipse.core.databinding.Binding;
import org.eclipse.core.databinding.observable.IObservable;
import org.eclipse.core.databinding.observable.value.IObservableValue;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.impl.AdapterImpl;
import org.eclipse.emf.databinding.EMFObservables;
+import org.eclipse.osbp.blob.component.BlobUploadComponent;
import org.eclipse.osbp.ecview.core.common.editpart.IElementEditpart;
import org.eclipse.osbp.ecview.core.common.editpart.IEmbeddableEditpart;
-import org.eclipse.osbp.ecview.core.common.model.core.CoreModelPackage;
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.extension.editparts.components.IBlobUploadComponentEditpart;
@@ -33,9 +31,9 @@
import org.eclipse.osbp.runtime.web.ecview.presentation.vaadin.internal.util.Util;
import org.eclipse.osbp.runtime.web.vaadin.databinding.VaadinProperties;
import org.eclipse.osbp.runtime.web.vaadin.databinding.values.IVaadinObservableValue;
+import org.eclipse.osbp.ui.api.customfields.IBlobService;
import org.eclipse.osbp.ui.api.themes.IThemeResourceService;
import org.eclipse.osbp.ui.api.themes.IThemeResourceService.ThemeResourceType;
-import org.eclipse.osbp.utils.blob.component.BlobUploadComponent;
import com.vaadin.data.util.ObjectProperty;
import com.vaadin.ui.Component;
@@ -54,9 +52,6 @@
/** The blob upload comp. */
private BlobUploadComponent blobUploadComp;
- /** The property. */
- private ObjectProperty<String> property;
-
/**
* Constructor.
*
@@ -76,11 +71,9 @@
if (blobUploadComp == null) {
IThemeResourceService themeResourceService = getViewContext().getService(IThemeResourceService.class.getName());
- blobUploadComp = new BlobUploadComponent();
+ IBlobService blobService = getViewContext().getService(IBlobService.class.getName());
+ blobUploadComp = new BlobUploadComponent(blobService);
blobUploadComp.setDisplayResolutionId(modelAccess.yblobUploadComp.getDisplayResolutionId());
- blobUploadComp.enableUploadButton(true);
- blobUploadComp.setFirmlyLinked(modelAccess.isFirmlyLinked());
- blobUploadComp.setUniqueNameEnabled(modelAccess.isUniqueNameEnabled());
blobUploadComp.setBlobUploadCompLabel(new Label(modelAccess.yblobUploadComp.getLabel()));
blobUploadComp.setUploadIcon(themeResourceService.getThemeResource("upload", ThemeResourceType.ICON));
blobUploadComp.setDownloadIcon(themeResourceService.getThemeResource("download", ThemeResourceType.ICON));
@@ -95,7 +88,7 @@
blobUploadComp.setId(getEditpart().getId());
}
- property = new ObjectProperty<String>("", String.class);
+ ObjectProperty<String> property = new ObjectProperty<>("", String.class);
blobUploadComp.setPropertyDataSource(property);
// creates the binding for the field
@@ -158,6 +151,7 @@
*
* @return the i observable value
*/
+ @SuppressWarnings("rawtypes")
protected IObservableValue internalGetValueEndpoint() {
// return the observable value for text
return EMFObservables.observeValue(castEObject(getModel()), YECviewPackage.Literals.YBLOB_UPLOAD_COMPONENT__VALUE);
@@ -171,6 +165,7 @@
* @param blobUploadComp
* the blob upload comp
*/
+ @SuppressWarnings("rawtypes")
protected void createBindings(YBlobUploadComponent yblobUploadComp, BlobUploadComponent blobUploadComp) {
// create the model binding from widget to ECView-model
@@ -301,33 +296,13 @@
}
/**
- * Returns the boolean value of uniqueNameEnabled.
- *
- * @return uniqueNameEnabled
- */
- public boolean isUniqueNameEnabled() {
- return yblobUploadComp.isUniqueNameEnabled();
- }
-
- /**
- * Returns the boolean value of firmlyLinked.
- *
- * @return firmlyLinked
- */
- public boolean isFirmlyLinked() {
- return yblobUploadComp.isFirmlyLinked();
- }
-
- /**
* Returns the label.
*
* @return the label
*/
public String getLabel() {
- // return yblobUploadComp.getDatadescription() != null ?
- // yblobUploadComp
- // .getDatadescription().getLabel() : null;
- return yblobUploadComp.getLabel();
+// return yblobUploadComp.getLabel();
+ return yblobUploadComp.getAuthorizationId();
}
/**
@@ -336,10 +311,8 @@
* @return the label i18n key
*/
public String getLabelI18nKey() {
- // return yblobUploadComp.getDatadescription() != null ?
- // yblobUploadComp
- // .getDatadescription().getLabelI18nKey() : null;
- return yblobUploadComp.getLabelI18nKey();
+// return yblobUploadComp.getLabelI18nKey();
+ return yblobUploadComp.getAuthorizationId();
}
}
@@ -373,26 +346,4 @@
ep.requestUnrender();
ep.requestRender();
}
-
- /**
- * The Class Adapter.
- */
- private class Adapter extends AdapterImpl {
-
- /*
- * (non-Javadoc)
- *
- * @see
- * org.eclipse.emf.common.notify.impl.AdapterImpl#notifyChanged(org.
- * eclipse.emf.common.notify.Notification)
- */
- @Override
- public void notifyChanged(Notification msg) {
- if (msg.getFeature() == CoreModelPackage.Literals.YENABLE__ENABLED) {
- switchIt();
- }
- }
-
- }
-
}
\ No newline at end of file
diff --git a/org.eclipse.osbp.ecview.extension.presentation.vaadin/src/org/eclipse/osbp/ecview/extension/presentation/vaadin/components/IconComboBoxPresentation.java b/org.eclipse.osbp.ecview.extension.presentation.vaadin/src/org/eclipse/osbp/ecview/extension/presentation/vaadin/components/IconComboBoxPresentation.java
index 39de45e..2ea97a9 100644
--- a/org.eclipse.osbp.ecview.extension.presentation.vaadin/src/org/eclipse/osbp/ecview/extension/presentation/vaadin/components/IconComboBoxPresentation.java
+++ b/org.eclipse.osbp.ecview.extension.presentation.vaadin/src/org/eclipse/osbp/ecview/extension/presentation/vaadin/components/IconComboBoxPresentation.java
@@ -369,7 +369,7 @@
return value;
}
@SuppressWarnings("unchecked")
- Map<String, String> callResult = (Map<String, String>) service.callFunctionLibrary(wrapper.getClassName(), wrapper.getMethodName());
+ Map<String, String> callResult = (Map<String, String>) service.invoke(wrapper.getClassName(), wrapper.getMethodName());
if (callResult != null) {
return callResult;
} else {
diff --git a/org.eclipse.osbp.ecview.extension.presentation.vaadin/src/org/eclipse/osbp/ecview/extension/presentation/vaadin/components/RichTextAreaPresentation.java b/org.eclipse.osbp.ecview.extension.presentation.vaadin/src/org/eclipse/osbp/ecview/extension/presentation/vaadin/components/RichTextAreaPresentation.java
index 52263ce..e9128a4 100644
--- a/org.eclipse.osbp.ecview.extension.presentation.vaadin/src/org/eclipse/osbp/ecview/extension/presentation/vaadin/components/RichTextAreaPresentation.java
+++ b/org.eclipse.osbp.ecview.extension.presentation.vaadin/src/org/eclipse/osbp/ecview/extension/presentation/vaadin/components/RichTextAreaPresentation.java
@@ -407,6 +407,16 @@
reportValidationError(message);
return message;
}
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see com.vaadin.ui.AbstractField#focus()
+ */
+ @Override
+ public void focus() {
+ super.focus();
+ }
}
private static class TextToBlobConverter extends Converter {
diff --git a/org.eclipse.osbp.ecview.extension.presentation.vaadin/src/org/eclipse/osbp/ecview/extension/presentation/vaadin/converter/ConverterFactory.java b/org.eclipse.osbp.ecview.extension.presentation.vaadin/src/org/eclipse/osbp/ecview/extension/presentation/vaadin/converter/ConverterFactory.java
index 09b1602..9ef7b41 100644
--- a/org.eclipse.osbp.ecview.extension.presentation.vaadin/src/org/eclipse/osbp/ecview/extension/presentation/vaadin/converter/ConverterFactory.java
+++ b/org.eclipse.osbp.ecview.extension.presentation.vaadin/src/org/eclipse/osbp/ecview/extension/presentation/vaadin/converter/ConverterFactory.java
@@ -24,6 +24,7 @@
import org.eclipse.osbp.ecview.extension.editparts.converter.IObjectToStringConverterEditpart;
import org.eclipse.osbp.ecview.extension.editparts.converter.ISimpleDecimalConverterEditpart;
import org.eclipse.osbp.ecview.extension.editparts.converter.IStringToResourceConverterEditpart;
+import org.eclipse.osbp.ecview.extension.editparts.converter.IVaaclipseUiThemeToStringConverterEditpart;
import org.eclipse.osbp.ecview.extension.model.converter.YConverterPackage;
import org.eclipse.osbp.ecview.extension.model.converter.YCustomDecimalConverter;
import org.eclipse.osbp.ecview.extension.model.converter.YDecimalToUomoConverter;
@@ -57,6 +58,8 @@
if (editpart instanceof IObjectToStringConverterEditpart) {
return new ObjectToStringConverter();
+ } else if (editpart instanceof IVaaclipseUiThemeToStringConverterEditpart) {
+ return new VaaclipseUiThemeToStringConverter();
} else if (editpart instanceof IStringToResourceConverterEditpart) {
return new StringToResourceConverter(uiContext,
(YStringToResourceConverter) editpart.getModel());
diff --git a/org.eclipse.osbp.ecview.extension.presentation.vaadin/src/org/eclipse/osbp/ecview/extension/presentation/vaadin/converter/CustomDecimalConverter.java b/org.eclipse.osbp.ecview.extension.presentation.vaadin/src/org/eclipse/osbp/ecview/extension/presentation/vaadin/converter/CustomDecimalConverter.java
index 6728deb..6341505 100644
--- a/org.eclipse.osbp.ecview.extension.presentation.vaadin/src/org/eclipse/osbp/ecview/extension/presentation/vaadin/converter/CustomDecimalConverter.java
+++ b/org.eclipse.osbp.ecview.extension.presentation.vaadin/src/org/eclipse/osbp/ecview/extension/presentation/vaadin/converter/CustomDecimalConverter.java
@@ -51,12 +51,10 @@
private IServiceRegistry registry;
/** The y converter. */
- private YCustomDecimalConverter yConverter;
+ private transient YCustomDecimalConverter yConverter;
/** The converted decimal format. */
private DecimalFormat convertedDecimalFormat;
-// private final DecimalFormat defaultDecimalFormat = new DecimalFormat(
-// "##,##0.00");
/** The default decimal format. */
private final DecimalFormat defaultDecimalFormat = new DecimalFormat();
@@ -86,7 +84,7 @@
@Override
public String convertToPresentation(Double value,
Class<? extends String> targetType, Locale locale)
- throws ConversionException {
+ throws ConversionException { // NOSONAR
if (value == null) {
return null;
}
@@ -102,38 +100,13 @@
return getToPresentationFormat(locale).format(value);
}
-// @Override
-// public String convertToPresentationOld(Double value,
-// Class<? extends String> targetType, Locale locale)
-// throws ConversionException {
-// if (value == null) {
-// return null;
-// }
-
-// FunctionTypingAPI functionTypingAPI = new FunctionTypingAPI();
-// for (Entry<String, String> entry : getProperties()) {
-// if (functionTypingAPI.getFunctionBaseUnitTypeName().equals(
-// entry.getKey())) {
-// yConverter.setBaseUnit(entry.getValue());
-// }
-// }
-// for (Entry<String, String> entry : getProperties()) {
-// if (functionTypingAPI.getFunctionToPresentationFormatTypeName()
-// .equals(entry.getKey())) {
-// value = handleToPresentationFormatOld(entry.getValue(), value,
-// locale, yConverter.getBaseUnit());
-// }
-// }
-// return getToPresentationFormat(locale).format(value);
-// }
-
/* (non-Javadoc)
* @see com.vaadin.data.util.converter.StringToDoubleConverter#convertToModel(java.lang.String, java.lang.Class, java.util.Locale)
*/
@Override
public Double convertToModel(String value,
Class<? extends Double> targetType, Locale locale)
- throws ConversionException {
+ throws ConversionException { // NOSONAR
Number n = null;
String suffix = "";
if (value != null){
@@ -151,16 +124,6 @@
n = 0;
}
- // Double dbl = new Double(n.doubleValue());
- // String dblStr = defaultDecimalFormat.format(dbl);
- // int idx = dblStr.toString().length();
- // String suffix = value.substring(idx).trim();
- // for (Entry<String, String> entry : getProperties()) {
- // if (functionTypingAPI.getFunctionBaseUnitTypeName().equals(
- // entry.getKey())) {
- // yConverter.setBaseUnit(entry.getValue());
- // }
- // }
for (Entry<String, String> entry : getProperties()) {
if (functionTypingAPI.getFunctionConverterTypeName()
.equalsIgnoreCase(entry.getKey())) {
@@ -184,7 +147,7 @@
if (yConverter != null) {
return yConverter.getProperties();
}
- return new BasicEMap<String, String>();
+ return new BasicEMap<>();
}
/**
@@ -230,22 +193,17 @@
}
BaseAmount<?> callResult = (BaseAmount<?>) service
- .callFunctionLibrary(wrapper.getClassName(),
+ .invoke(wrapper.getClassName(),
wrapper.getMethodName(), value, locale,
baseUnit);
if (callResult!=null){
return getAmountOutput(callResult, locale);
} else {
- // TODO (JCD): Translation
- LOGGER.error("The called converter function call '" + functionFqn
- + "' is not defined. Please define the required function in your Functionlibrary DSL instance!");
+ LOGGER.error("The called converter function call {} is not defined. Please define the required function in your Functionlibrary DSL instance!", functionFqn);
}
}
} catch (ClassCastException ex) {
- // TODO (JCD): Translation
- LOGGER.error("Return type of the function call '" + functionFqn
- + "' is not a "
- + BaseAmount.class.getSimpleName() + "!");
+ LOGGER.error("Return type of the function call {} is not a {}", functionFqn, BaseAmount.class.getSimpleName());
}
return getAmountOutput(new BaseAmount<Dimensionless>(value, DimensionlessUnit.NOSYMBOL), locale);
}
@@ -268,58 +226,9 @@
String convertedUnit = localUnitFormat.format(amount.unit());
// as you can't use icu for compatibilty reasons, this functions are used - instead of getNumber()
String convertedNumber = getToPresentationFormat(locale).format(amount.value());
- StringBuffer strBuf = new StringBuffer(convertedNumber).append(" ").append(convertedUnit);
+ StringBuilder strBuf = new StringBuilder(convertedNumber).append(" ").append(convertedUnit);
return strBuf.toString();
}
-
-// /**
-// * Handle to presentation format old.
-// *
-// * @param functionFqn
-// * the function fqn
-// * @param value
-// * the value
-// * @param locale
-// * the locale
-// * @param baseUnit
-// * the base unit
-// * @return the double
-// */
-// private Double handleToPresentationFormatOld(String functionFqn, Double value,
-// Locale locale, String baseUnit) {
-// FunctionWrapper wrapper = new FunctionWrapper(functionFqn);
-// try {
-// if (locale != null) {
-// IFunctionLibraryService service = registry
-// .getService(IFunctionLibraryService.class.getName());
-// if (service == null) {
-// LOGGER.error("No IFunctionLibraryService available");
-// // TODO
-// return value;
-// }
-//
-// TempDecimalFormatWrapper callResult = (TempDecimalFormatWrapper) service
-// .callFunctionLibrary(wrapper.getClassName(),
-// wrapper.getMethodName(), value, locale,
-// baseUnit);
-// if (callResult!=null){
-// setConvertedDecimalFormat(callResult.getFormat());
-// return callResult.getValue();
-// } else {
-// // TODO (JCD): Translation
-// LOGGER.error("The called converter function call '" + functionFqn
-// + "' is not defined. Please define the required function in your Functionlibrary DSL instance!");
-// }
-// }
-// } catch (ClassCastException ex) {
-// // TODO (JCD): Translation
-// LOGGER.error("Return type of the function call '" + functionFqn
-// + "' is not a "
-// + TempDecimalFormatWrapper.class.getSimpleName() + "!");
-// }
-// return value;
-// }
-
/**
* Handle to model format.
*
@@ -344,16 +253,11 @@
.getService(IFunctionLibraryService.class.getName());
if (service == null) {
LOGGER.error("No IFunctionLibraryService available");
- // TODO
return value;
}
- Double callResult = (Double) service.callFunctionLibrary(
- wrapper.getClassName(), wrapper.getMethodName(), value,
- locale, baseSuffix, suffix);
- return callResult;
+ return (Double) service.invoke(wrapper.getClassName(), wrapper.getMethodName(), value,locale, baseSuffix, suffix);
}
} catch (ClassCastException ex) {
- // TODO (JCD): Translation
LOGGER.error("Return type of the function call '" + functionFqn
+ "' is not a " + Double.class.getSimpleName() + "!");
}
@@ -370,12 +274,11 @@
private MeasurementValue splitValue(String value){
Pattern p = Pattern.compile("\\d+([.,]\\d+)?");
char groupSeparator = defaultDecimalFormat.getDecimalFormatSymbols().getGroupingSeparator();
- value = value.replace(String.valueOf(groupSeparator), "");
- Matcher m = p.matcher(value);
+ String newValue = value.replace(String.valueOf(groupSeparator), "");
+ Matcher m = p.matcher(newValue);
if (m.find()) {
- String unit = value.replace(value.substring(m.start(), m.end()),"").trim();
- MeasurementValue measure = new MeasurementValue(m.group(), unit);
- return measure;
+ String unit = newValue.replace(newValue.substring(m.start(), m.end()),"").trim();
+ return new MeasurementValue(m.group(), unit);
}
return null;
}
diff --git a/org.eclipse.osbp.ecview.extension.presentation.vaadin/src/org/eclipse/osbp/ecview/extension/presentation/vaadin/converter/VaaclipseUiThemeToStringConverter.java b/org.eclipse.osbp.ecview.extension.presentation.vaadin/src/org/eclipse/osbp/ecview/extension/presentation/vaadin/converter/VaaclipseUiThemeToStringConverter.java
new file mode 100644
index 0000000..98644aa
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.presentation.vaadin/src/org/eclipse/osbp/ecview/extension/presentation/vaadin/converter/VaaclipseUiThemeToStringConverter.java
@@ -0,0 +1,64 @@
+/**
+ *
+ * Copyright (c) 2011, 2016 - Loetz GmbH&Co.KG (69115 Heidelberg, Germany)
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Florian Pirchner - Initial implementation
+ *
+ */
+package org.eclipse.osbp.ecview.extension.presentation.vaadin.converter;
+
+import java.util.Locale;
+
+import org.eclipse.osbp.utils.themes.ui.VaaclipseUiTheme;
+
+import com.vaadin.data.util.converter.Converter;
+
+/**
+ * The Class VaaclipseUiThemeToStringConverter.
+ */
+@SuppressWarnings("serial")
+public class VaaclipseUiThemeToStringConverter implements Converter<VaaclipseUiTheme, String> {
+
+ /* (non-Javadoc)
+ * @see com.vaadin.data.util.converter.Converter#convertToModel(java.lang.Object, java.lang.Class, java.util.Locale)
+ */
+ @Override
+ public String convertToModel(VaaclipseUiTheme value,
+ Class<? extends String> targetType, Locale locale)
+ throws com.vaadin.data.util.converter.Converter.ConversionException {
+ return value!=null ? value.getId() : "";
+ }
+
+ /* (non-Javadoc)
+ * @see com.vaadin.data.util.converter.Converter#convertToPresentation(java.lang.Object, java.lang.Class, java.util.Locale)
+ */
+ @Override
+ public VaaclipseUiTheme convertToPresentation(String value,
+ Class<? extends VaaclipseUiTheme> targetType, Locale locale)
+ throws com.vaadin.data.util.converter.Converter.ConversionException {
+ return VaaclipseUiTheme.forText(value);
+ }
+
+ /* (non-Javadoc)
+ * @see com.vaadin.data.util.converter.Converter#getModelType()
+ */
+ @Override
+ public Class<VaaclipseUiTheme> getPresentationType() {
+ return VaaclipseUiTheme.class;
+ }
+
+ /* (non-Javadoc)
+ * @see com.vaadin.data.util.converter.Converter#getPresentationType()
+ */
+ @Override
+ public Class<String> getModelType() {
+ return String.class;
+ }
+
+}
diff --git a/org.eclipse.osbp.ecview.extension.presentation.vaadin/src/org/eclipse/osbp/ecview/extension/vaadin/components/CustomDecimalField.java b/org.eclipse.osbp.ecview.extension.presentation.vaadin/src/org/eclipse/osbp/ecview/extension/vaadin/components/CustomDecimalField.java
index 1620cff..aabcee6 100644
--- a/org.eclipse.osbp.ecview.extension.presentation.vaadin/src/org/eclipse/osbp/ecview/extension/vaadin/components/CustomDecimalField.java
+++ b/org.eclipse.osbp.ecview.extension.presentation.vaadin/src/org/eclipse/osbp/ecview/extension/vaadin/components/CustomDecimalField.java
@@ -17,9 +17,6 @@
import java.util.Map;
import java.util.Map.Entry;
-import javax.inject.Inject;
-
-import org.eclipse.e4.core.contexts.IEclipseContext;
import org.eclipse.emf.common.util.EMap;
import org.eclipse.osbp.ecview.core.common.context.IViewContext;
import org.eclipse.osbp.ecview.extension.presentation.vaadin.converter.CustomDecimalConverter;
@@ -37,8 +34,7 @@
public class CustomDecimalField extends DecimalField {
/** The Constant LOGGER. */
- private static final Logger LOGGER = LoggerFactory
- .getLogger(CustomDecimalField.class);
+ private static final Logger LOGGER = LoggerFactory.getLogger(CustomDecimalField.class);
/** The view context. */
private final IViewContext viewContext;
@@ -46,10 +42,6 @@
/** The converter. */
private CustomDecimalConverter converter;
- /** The context. */
- @Inject
- IEclipseContext context;
-
/**
* Instantiates a new custom decimal field.
*/
@@ -79,8 +71,7 @@
* @param viewContext
* the view context
*/
- public CustomDecimalField(String caption, CustomDecimalConverter converter,
- IViewContext viewContext) {
+ public CustomDecimalField(String caption, CustomDecimalConverter converter, IViewContext viewContext) {
super(caption, converter);
this.viewContext = viewContext;
@@ -96,13 +87,15 @@
* the new converter
*/
public void setConverter(CustomDecimalConverter converter) {
- this.converter = converter != null ? converter
- : new CustomDecimalConverter();
+ this.converter = converter != null ? converter : new CustomDecimalConverter();
super.setConverter(this.converter);
}
- /* (non-Javadoc)
- * @see org.eclipse.osbp.runtime.web.vaadin.components.fields.DecimalField#setInternalValue(java.lang.String)
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osbp.runtime.web.vaadin.components.fields.DecimalField#
+ * setInternalValue(java.lang.String)
*/
protected void setInternalValue(String newValue) {
super.setInternalValue(newValue);
@@ -116,14 +109,23 @@
}
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see com.vaadin.ui.AbstractField#setConvertedValue(java.lang.Object)
*/
public void setConvertedValue(Object value) {
if (converter != null) {
converter.setConvertedDecimalFormat(null);
}
- super.setConvertedValue(value);
+
+ boolean oldReadonly = isReadOnly();
+ try {
+ setReadOnly(false);
+ super.setConvertedValue(value);
+ } finally {
+ setReadOnly(oldReadonly);
+ }
}
/**
@@ -136,8 +138,7 @@
private void callFunctions(EMap<String, String> properties) {
FunctionTypingAPI functionTypingAPI = new FunctionTypingAPI();
for (Entry<String, String> entry : properties) {
- if (functionTypingAPI.getFunctionCssTypeName().equalsIgnoreCase(
- entry.getKey())) {
+ if (functionTypingAPI.getFunctionCssTypeName().equalsIgnoreCase(entry.getKey())) {
handleCss(entry.getValue());
}
LOGGER.debug("entry.getKey(): " + entry.getKey());
@@ -160,8 +161,7 @@
if (getPropertyDataSource() == null || isBuffered() || isModified()) {
String value = getInternalValue();
try {
- result = converter.convertToModel(value, Double.class,
- getLocale());
+ result = converter.convertToModel(value, Double.class, getLocale());
} catch (Exception e) {
// nothing to do
}
@@ -179,19 +179,17 @@
LOGGER.error("No implementation of IFunctionLibraryService available.");
return;
}
-
+
Map<String, Boolean> callResult = (Map<String, Boolean>) functionService
- .callFunctionLibrary(wrapper.getClassName(),
- wrapper.getMethodName(), result);
- if (callResult!=null){
+ .invoke(wrapper.getClassName(), wrapper.getMethodName(), result);
+ if (callResult != null) {
removeStyleNames(callResult);
addStyleNames(callResult);
}
}
} catch (ClassCastException ex) {
// TODO (JCD): Translation
- LOGGER.error("Return type of the function call '" + functionFqn
- + "' is not a Map!");
+ LOGGER.error("Return type of the function call '" + functionFqn + "' is not a Map!");
}
}
diff --git a/org.eclipse.osbp.ecview.extension.presentation/META-INF/MANIFEST.MF b/org.eclipse.osbp.ecview.extension.presentation/META-INF/MANIFEST.MF
index 1a94746..90e7ef4 100644
--- a/org.eclipse.osbp.ecview.extension.presentation/META-INF/MANIFEST.MF
+++ b/org.eclipse.osbp.ecview.extension.presentation/META-INF/MANIFEST.MF
@@ -5,9 +5,9 @@
Bundle-Vendor: Eclipse OSBP
Bundle-Version: 0.9.0.qualifier
Require-Bundle: org.slf4j.api,
- com.vaadin.shared;bundle-version="[7.5.7,7.7.0)",
- com.vaadin.client;bundle-version="[7.5.7,7.7.0)",
- com.vaadin.server;bundle-version="[7.5.7,7.7.0)",
+ com.vaadin.shared;bundle-version="[7.7.6,7.8.0)",
+ com.vaadin.client;bundle-version="[7.7.6,7.8.0)",
+ com.vaadin.server;bundle-version="[7.7.6,7.8.0)",
com.ibm.icu;bundle-version="50.1.1",
org.eclipse.osbp.ecview.core.common;bundle-version="[0.9.0,0.10.0)",
org.eclipse.osbp.ecview.core.common.editparts.emf;bundle-version="[0.9.0,0.10.0)",
@@ -26,8 +26,7 @@
org.eclipse.emf.databinding;bundle-version="1.3.0",
org.eclipse.osbp.ecview.extension.api;bundle-version="[0.9.0,0.10.0)",
org.apache.commons.beanutils;bundle-version="1.9.2"
-Import-Package: org.eclipse.osbp.utils.blob.component;version="0.9.0",
- org.eclipse.core.databinding.property.value,
+Import-Package: org.eclipse.core.databinding.property.value;version="1.6.0",
org.eclipse.e4.core.services.events,
org.osgi.framework;version="1.7.0",
org.osgi.service.component.annotations;version="1.2.0"
diff --git a/org.eclipse.osbp.ecview.extension.sample/modelsbin/dtos.dtos.dtos_bin b/org.eclipse.osbp.ecview.extension.sample/modelsbin/dtos.dtos.dtos_bin
deleted file mode 100644
index 4356555..0000000
--- a/org.eclipse.osbp.ecview.extension.sample/modelsbin/dtos.dtos.dtos_bin
+++ /dev/null
@@ -1,34 +0,0 @@
-<?xml version="1.0" encoding="ASCII"?>
-<dto:LDtoModel xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:dto="http://osbp.eclipse.org/dsl/dto/v1" xmlns:types="http://osbp.eclipse.org/dsl/common/types/v1" xmlns:types_1="http://www.eclipse.org/xtext/common/JavaVMTypes">
- <packages name="org.eclipse.osbp.ecview.extension.tests.dtos">
- <types xsi:type="types:LDataType" name="String">
- <jvmTypeReference xsi:type="types_1:JvmParameterizedTypeReference">
- <type xsi:type="types_1:JvmGenericType" href="java:/Objects/java.lang.String#java.lang.String"/>
- </jvmTypeReference>
- </types>
- <types xsi:type="types:LDataType" name="int" asPrimitive="true">
- <jvmTypeReference xsi:type="types_1:JvmParameterizedTypeReference">
- <type xsi:type="types_1:JvmGenericType" href="java:/Objects/java.lang.Integer#java.lang.Integer"/>
- </jvmTypeReference>
- </types>
- <types xsi:type="types:LDataType" name="Date" date="true"/>
- <types xsi:type="dto:LDto" name="Person">
- <annotationInfo xsi:type="dto:LDto"/>
- <features xsi:type="dto:LDtoAttribute" name="id" uuid="true" type="//@packages.0/@types.0">
- <annotationInfo xsi:type="dto:LDtoFeature"/>
- </features>
- <features xsi:type="dto:LDtoAttribute" name="name" type="//@packages.0/@types.0">
- <annotationInfo xsi:type="dto:LDtoFeature"/>
- </features>
- <features xsi:type="dto:LDtoAttribute" name="name2" type="//@packages.0/@types.0">
- <annotationInfo xsi:type="dto:LDtoFeature"/>
- </features>
- <features xsi:type="dto:LDtoAttribute" name="age" type="//@packages.0/@types.1">
- <annotationInfo xsi:type="dto:LDtoFeature"/>
- </features>
- <features xsi:type="dto:LDtoAttribute" name="birthday" type="//@packages.0/@types.2">
- <annotationInfo xsi:type="dto:LDtoFeature"/>
- </features>
- </types>
- </packages>
-</dto:LDtoModel>
diff --git a/org.eclipse.osbp.ecview.extension.services.tests/.classpath b/org.eclipse.osbp.ecview.extension.services.tests/.classpath
new file mode 100644
index 0000000..0f2de47
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.services.tests/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
+ <classpathentry exported="true" kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="target/classes"/>
+</classpath>
diff --git a/org.eclipse.osbp.ecview.extension.services.tests/.gitignore b/org.eclipse.osbp.ecview.extension.services.tests/.gitignore
new file mode 100644
index 0000000..b83d222
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.services.tests/.gitignore
@@ -0,0 +1 @@
+/target/
diff --git a/org.eclipse.osbp.ecview.extension.services.tests/.settings/org.eclipse.core.resources.prefs b/org.eclipse.osbp.ecview.extension.services.tests/.settings/org.eclipse.core.resources.prefs
new file mode 100644
index 0000000..99f26c0
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.services.tests/.settings/org.eclipse.core.resources.prefs
@@ -0,0 +1,2 @@
+eclipse.preferences.version=1
+encoding/<project>=UTF-8
diff --git a/org.eclipse.osbp.ecview.extension.services.tests/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.osbp.ecview.extension.services.tests/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 0000000..0c68a61
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.services.tests/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,7 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+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.8
diff --git a/org.eclipse.osbp.ecview.extension.services.tests/.settings/org.eclipse.m2e.core.prefs b/org.eclipse.osbp.ecview.extension.services.tests/.settings/org.eclipse.m2e.core.prefs
new file mode 100644
index 0000000..f897a7f
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.services.tests/.settings/org.eclipse.m2e.core.prefs
@@ -0,0 +1,4 @@
+activeProfiles=
+eclipse.preferences.version=1
+resolveWorkspaceProjects=true
+version=1
diff --git a/org.eclipse.osbp.ecview.extension.services.tests/.settings/org.eclipse.xtend.core.Xtend.prefs b/org.eclipse.osbp.ecview.extension.services.tests/.settings/org.eclipse.xtend.core.Xtend.prefs
new file mode 100644
index 0000000..0933f8c
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.services.tests/.settings/org.eclipse.xtend.core.Xtend.prefs
@@ -0,0 +1,10 @@
+//outlet.DEFAULT_OUTPUT.sourceFolder.src/test/java.directory=src/test/generated-sources/xtend
+eclipse.preferences.version=1
+is_project_specific=true
+outlet.DEFAULT_OUTPUT.hideLocalSyntheticVariables=true
+outlet.DEFAULT_OUTPUT.installDslAsPrimarySource=false
+outlet.DEFAULT_OUTPUT.sourceFolder.emf-gen.directory=xtend-gen
+outlet.DEFAULT_OUTPUT.sourceFolder.src-gen.directory=xtend-gen
+outlet.DEFAULT_OUTPUT.sourceFolder.src.directory=xtend-gen
+outlet.DEFAULT_OUTPUT.sourceFolder.xtend-gen.directory=xtend-gen
+outlet.DEFAULT_OUTPUT.userOutputPerSourceFolder=true
diff --git a/org.eclipse.osbp.ecview.extension.services/.classpath b/org.eclipse.osbp.ecview.extension.services/.classpath
new file mode 100644
index 0000000..43b9862
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.services/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="target/classes"/>
+</classpath>
diff --git a/org.eclipse.osbp.ecview.extension.services/.gitignore b/org.eclipse.osbp.ecview.extension.services/.gitignore
new file mode 100644
index 0000000..0f63015
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.services/.gitignore
@@ -0,0 +1,2 @@
+/target/
+/bin/
diff --git a/org.eclipse.osbp.ecview.extension.services/.settings/org.eclipse.core.resources.prefs b/org.eclipse.osbp.ecview.extension.services/.settings/org.eclipse.core.resources.prefs
new file mode 100644
index 0000000..99f26c0
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.services/.settings/org.eclipse.core.resources.prefs
@@ -0,0 +1,2 @@
+eclipse.preferences.version=1
+encoding/<project>=UTF-8
diff --git a/org.eclipse.osbp.ecview.extension.services/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.osbp.ecview.extension.services/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 0000000..0c68a61
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.services/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,7 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+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.8
diff --git a/org.eclipse.osbp.ecview.extension.services/.settings/org.eclipse.m2e.core.prefs b/org.eclipse.osbp.ecview.extension.services/.settings/org.eclipse.m2e.core.prefs
new file mode 100644
index 0000000..f897a7f
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.services/.settings/org.eclipse.m2e.core.prefs
@@ -0,0 +1,4 @@
+activeProfiles=
+eclipse.preferences.version=1
+resolveWorkspaceProjects=true
+version=1
diff --git a/org.eclipse.osbp.ecview.extension.services/.settings/org.eclipse.xtend.core.Xtend.prefs b/org.eclipse.osbp.ecview.extension.services/.settings/org.eclipse.xtend.core.Xtend.prefs
new file mode 100644
index 0000000..19e3115
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.services/.settings/org.eclipse.xtend.core.Xtend.prefs
@@ -0,0 +1,11 @@
+//outlet.DEFAULT_OUTPUT.sourceFolder.src/test/java.directory=src/test/generated-sources/xtend
+BuilderConfiguration.is_project_specific=true
+eclipse.preferences.version=1
+is_project_specific=true
+outlet.DEFAULT_OUTPUT.hideLocalSyntheticVariables=true
+outlet.DEFAULT_OUTPUT.installDslAsPrimarySource=false
+outlet.DEFAULT_OUTPUT.sourceFolder.emf-gen.directory=xtend-gen
+outlet.DEFAULT_OUTPUT.sourceFolder.src-gen.directory=xtend-gen
+outlet.DEFAULT_OUTPUT.sourceFolder.src.directory=xtend-gen
+outlet.DEFAULT_OUTPUT.sourceFolder.xtend-gen.directory=xtend-gen
+outlet.DEFAULT_OUTPUT.userOutputPerSourceFolder=true
diff --git a/org.eclipse.osbp.ecview.extension.services/META-INF/MANIFEST.MF b/org.eclipse.osbp.ecview.extension.services/META-INF/MANIFEST.MF
index 088e38a..05d0f69 100644
--- a/org.eclipse.osbp.ecview.extension.services/META-INF/MANIFEST.MF
+++ b/org.eclipse.osbp.ecview.extension.services/META-INF/MANIFEST.MF
@@ -22,4 +22,4 @@
Service-Component: OSGI-INF/org.eclipse.osbp.ecview.extension.services.ECViewProviderService.xml,
OSGI-INF/org.eclipse.osbp.ecview.extension.services.ECViewCacheBuilder.xml,
OSGI-INF/org.eclipse.osbp.ecview.extension.services.ECViewCache.xml
-Export-Package: org.eclipse.osbp.ecview.extension.services
+Export-Package: org.eclipse.osbp.ecview.extension.services;version="0.9.0"
diff --git a/org.eclipse.osbp.ecview.extension.strategy/.classpath b/org.eclipse.osbp.ecview.extension.strategy/.classpath
new file mode 100644
index 0000000..43b9862
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.strategy/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="target/classes"/>
+</classpath>
diff --git a/org.eclipse.osbp.ecview.extension.strategy/.gitignore b/org.eclipse.osbp.ecview.extension.strategy/.gitignore
new file mode 100644
index 0000000..09e3bc9
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.strategy/.gitignore
@@ -0,0 +1,2 @@
+/bin/
+/target/
diff --git a/org.eclipse.osbp.ecview.extension.strategy/.settings/com.vaadin.integration.eclipse.prefs b/org.eclipse.osbp.ecview.extension.strategy/.settings/com.vaadin.integration.eclipse.prefs
new file mode 100644
index 0000000..0904e44
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.strategy/.settings/com.vaadin.integration.eclipse.prefs
@@ -0,0 +1,2 @@
+com.vaadin.integration.eclipse.mavenLatestVersionsUpgrade=["7.7.7"]
+eclipse.preferences.version=1
diff --git a/org.eclipse.osbp.ecview.extension.strategy/.settings/org.eclipse.core.resources.prefs b/org.eclipse.osbp.ecview.extension.strategy/.settings/org.eclipse.core.resources.prefs
new file mode 100644
index 0000000..99f26c0
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.strategy/.settings/org.eclipse.core.resources.prefs
@@ -0,0 +1,2 @@
+eclipse.preferences.version=1
+encoding/<project>=UTF-8
diff --git a/org.eclipse.osbp.ecview.extension.strategy/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.osbp.ecview.extension.strategy/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 0000000..0c68a61
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.strategy/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,7 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+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.8
diff --git a/org.eclipse.osbp.ecview.extension.strategy/.settings/org.eclipse.m2e.core.prefs b/org.eclipse.osbp.ecview.extension.strategy/.settings/org.eclipse.m2e.core.prefs
new file mode 100644
index 0000000..f897a7f
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.strategy/.settings/org.eclipse.m2e.core.prefs
@@ -0,0 +1,4 @@
+activeProfiles=
+eclipse.preferences.version=1
+resolveWorkspaceProjects=true
+version=1
diff --git a/org.eclipse.osbp.ecview.extension.strategy/.settings/org.eclipse.pde.core.prefs b/org.eclipse.osbp.ecview.extension.strategy/.settings/org.eclipse.pde.core.prefs
new file mode 100644
index 0000000..f29e940
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.strategy/.settings/org.eclipse.pde.core.prefs
@@ -0,0 +1,3 @@
+eclipse.preferences.version=1
+pluginProject.extensions=false
+resolve.requirebundle=false
diff --git a/org.eclipse.osbp.ecview.extension.strategy/.settings/org.eclipse.xtend.core.Xtend.prefs b/org.eclipse.osbp.ecview.extension.strategy/.settings/org.eclipse.xtend.core.Xtend.prefs
new file mode 100644
index 0000000..19e3115
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.strategy/.settings/org.eclipse.xtend.core.Xtend.prefs
@@ -0,0 +1,11 @@
+//outlet.DEFAULT_OUTPUT.sourceFolder.src/test/java.directory=src/test/generated-sources/xtend
+BuilderConfiguration.is_project_specific=true
+eclipse.preferences.version=1
+is_project_specific=true
+outlet.DEFAULT_OUTPUT.hideLocalSyntheticVariables=true
+outlet.DEFAULT_OUTPUT.installDslAsPrimarySource=false
+outlet.DEFAULT_OUTPUT.sourceFolder.emf-gen.directory=xtend-gen
+outlet.DEFAULT_OUTPUT.sourceFolder.src-gen.directory=xtend-gen
+outlet.DEFAULT_OUTPUT.sourceFolder.src.directory=xtend-gen
+outlet.DEFAULT_OUTPUT.sourceFolder.xtend-gen.directory=xtend-gen
+outlet.DEFAULT_OUTPUT.userOutputPerSourceFolder=true
diff --git a/org.eclipse.osbp.ecview.extension.strategy/META-INF/MANIFEST.MF b/org.eclipse.osbp.ecview.extension.strategy/META-INF/MANIFEST.MF
index 8f2304b..536ecb2 100644
--- a/org.eclipse.osbp.ecview.extension.strategy/META-INF/MANIFEST.MF
+++ b/org.eclipse.osbp.ecview.extension.strategy/META-INF/MANIFEST.MF
@@ -8,21 +8,22 @@
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Import-Package: org.eclipse.osbp.ecview.core.common.editpart.emf;version="0.9.0",
org.eclipse.osbp.ecview.extension.api;version="0.9.0",
+ org.eclipse.osbp.utils.themes.ui;version="0.9.0",
org.osgi.framework;version="1.8.0",
org.osgi.service.component;version="1.2.0",
org.osgi.service.component.annotations;version="1.2.0",
org.slf4j
Bundle-ActivationPolicy: lazy
-Export-Package: org.eclipse.osbp.ecview.extension.strategy;version="0.9.0"
-Require-Bundle: com.vaadin.server;bundle-version="[7.5.7,7.7.0)",
- org.eclipse.core.databinding;bundle-version="1.4.1",
+Export-Package: org.eclipse.osbp.ecview.extension.strategy;version="0.9.0",
+ org.eclipse.osbp.ecview.extension.strategy.util;version="0.9.0"
+Require-Bundle: com.vaadin.server;bundle-version="[7.7.6,7.8.0)",
+ org.eclipse.core.databinding;bundle-version="[1.6.0,1.7.0)",
org.eclipse.osbp.ecview.core.common;bundle-version="[0.9.0,0.10.0)",
org.eclipse.osbp.runtime.common;bundle-version="[0.9.0,0.10.0)",
org.eclipse.osbp.ecview.core.common.model;bundle-version="[0.9.0,0.10.0)",
org.eclipse.osbp.ecview.core.util.emf;bundle-version="[0.9.0,0.10.0)",
org.eclipse.osbp.ecview.core.extension.model;bundle-version="[0.9.0,0.10.0)",
org.eclipse.osbp.ecview.extension.model;bundle-version="[0.9.0,0.10.0)",
- org.eclipse.osbp.utils;bundle-version="[0.9.0,0.10.0)",
org.eclipse.osbp.utils.functionnormalizer;bundle-version="[0.9.0,0.10.0)",
org.eclipse.osbp.gitinfo;bundle-version="[0.9.0,0.10.0)",
org.eclipse.osbp.ecview.extension.grid.model;bundle-version="[0.9.0,0.10.0)",
@@ -30,6 +31,6 @@
org.eclipse.osbp.dsl.common.xtext;bundle-version="[0.9.0,0.10.0)",
org.eclipse.osbp.dsl.datatype.lib;bundle-version="[0.9.0,0.10.0)",
org.junit;bundle-version="4.11.0",
- org.eclipse.osbp.ui.api,
- org.eclipse.osbp.preferences
+ org.eclipse.osbp.ui.api;bundle-version="[0.9.0,0.10.0)",
+ org.eclipse.osbp.preferences;bundle-version="[0.9.0,0.10.0)"
Service-Component: OSGI-INF/*.xml
diff --git a/org.eclipse.osbp.ecview.extension.strategy/src/org/eclipse/osbp/ecview/extension/strategy/AbstractLayoutingStrategy.java b/org.eclipse.osbp.ecview.extension.strategy/src/org/eclipse/osbp/ecview/extension/strategy/AbstractLayoutingStrategy.java
index 63f5e54..0cbe04c 100644
--- a/org.eclipse.osbp.ecview.extension.strategy/src/org/eclipse/osbp/ecview/extension/strategy/AbstractLayoutingStrategy.java
+++ b/org.eclipse.osbp.ecview.extension.strategy/src/org/eclipse/osbp/ecview/extension/strategy/AbstractLayoutingStrategy.java
@@ -17,8 +17,8 @@
import java.util.Collection;
import java.util.Collections;
import java.util.Comparator;
-import java.util.Locale;
import java.util.Map.Entry;
+import java.util.Set;
import java.util.TreeSet;
import org.eclipse.emf.common.util.EList;
@@ -54,6 +54,8 @@
import org.eclipse.osbp.ecview.core.common.model.datatypes.impl.DatatypesFactoryImpl;
import org.eclipse.osbp.ecview.core.common.model.validation.ValidationFactory;
import org.eclipse.osbp.ecview.core.common.model.validation.YBeanValidationValidator;
+import org.eclipse.osbp.ecview.core.common.model.validation.YUniqueAttributeValidator;
+import org.eclipse.osbp.ecview.core.common.util.ECViewUtil;
import org.eclipse.osbp.ecview.core.extension.model.datatypes.ExtDatatypesFactory;
import org.eclipse.osbp.ecview.core.extension.model.datatypes.YDateTimeDatatype;
import org.eclipse.osbp.ecview.core.extension.model.datatypes.YDateTimeFormat;
@@ -66,6 +68,7 @@
import org.eclipse.osbp.ecview.core.extension.model.extension.YDecimalField;
import org.eclipse.osbp.ecview.core.extension.model.extension.YEnumComboBox;
import org.eclipse.osbp.ecview.core.extension.model.extension.YEnumOptionsGroup;
+import org.eclipse.osbp.ecview.core.extension.model.extension.YFilteringComponent;
import org.eclipse.osbp.ecview.core.extension.model.extension.YNumericField;
import org.eclipse.osbp.ecview.core.extension.model.extension.YPasswordField;
import org.eclipse.osbp.ecview.core.extension.model.extension.YSuggestTextField;
@@ -96,6 +99,7 @@
import org.eclipse.osbp.ecview.extension.model.YSubTypeSuspect;
import org.eclipse.osbp.ecview.extension.model.YSuspect;
import org.eclipse.osbp.ecview.extension.model.YSuspectInfo;
+import org.eclipse.osbp.ecview.extension.model.YTypedCompoundSuspect;
import org.eclipse.osbp.ecview.extension.model.YTypedSuspect;
import org.eclipse.osbp.ecview.extension.model.converter.YConverterFactory;
import org.eclipse.osbp.ecview.extension.model.converter.YCustomDecimalConverter;
@@ -104,17 +108,18 @@
import org.eclipse.osbp.ecview.extension.model.visibility.YVisibilityFactory;
import org.eclipse.osbp.ecview.extension.strategy.util.NamingConventionsUtil;
import org.eclipse.osbp.preferences.ProductConfiguration;
-import org.eclipse.osbp.runtime.common.i18n.II18nService;
import org.eclipse.osbp.ui.api.metadata.IDSLMetadataService;
+import org.eclipse.osbp.ui.api.themes.EnumCssClass;
import org.eclipse.osbp.ui.api.useraccess.AbstractAuthorization.Action;
-import org.eclipse.osbp.ui.api.useraccess.AbstractAuthorization.Permission;
+import org.eclipse.osbp.ui.api.useraccess.AbstractAuthorization.Group;
import org.eclipse.osbp.ui.api.useraccess.AbstractSubOrganization;
import org.eclipse.osbp.ui.api.useraccess.IOrganizationService;
import org.eclipse.osbp.ui.api.useraccess.IPosition;
import org.eclipse.osbp.ui.api.useraccess.IUserAccessService;
import org.eclipse.osbp.utils.functionnormalizer.api.FunctionTypingAPI;
import org.eclipse.osbp.utils.functionnormalizer.entities.FunctionType;
-import org.eclipse.osbp.utils.theme.EnumCssClass;
+import org.eclipse.osbp.utils.themes.ui.VaaclipseUiTheme;
+import org.eclipse.osbp.utils.themes.ui.VaaclipseUiTheme.ThemeList;
import org.eclipse.xtext.util.Pair;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -130,9 +135,6 @@
/** The function typing api. */
private FunctionTypingAPI functionTypingApi;
- /** The i18n service. */
- private II18nService i18nService;
-
/** The user access service. */
private IUserAccessService userAccessService;
@@ -158,10 +160,14 @@
this.functionTypingApi = new FunctionTypingAPI();
}
+ public YLayoutingInfo getLayoutingInfo() {
+ return layoutingInfo;
+ }
+
/*
* (non-Javadoc)
*
- * @see org.eclipse.osbp.ecview.extension.api.ILayoutingStrategy#layout(org.eclipse .osbp.ecview.extension.model.YLayoutingInfo)
+ * @see org.eclipse.osbp.ecview.extension.api.ILayoutingStrategy#layout(org. eclipse .osbp.ecview.extension.model.YLayoutingInfo)
*/
@Override
public void layout(YLayoutingInfo layoutingInfo) {
@@ -173,13 +179,15 @@
layoutingInfo.getActiveSuspectInfos().clear();
YLayout layout = createContentLayout();
YEmbeddable content;
- YTabSheet tabSheet = null;
+
+ layoutingInfo.getView().getTags().add(TAG__AUTOBINDED);
+
viewContext = ModelUtil.getViewContext(yLayout);
- i18nService = viewContext.getService(II18nService.ID);
userAccessService = viewContext.getService(IUserAccessService.class.getName());
dslMetadataService = viewContext.getService(IDSLMetadataService.class.getName());
// Identify if a TabSheet is necessary due to existing table or grid
if (isTabSheetNeeded(yLayout.getSuspects())) {
+ YTabSheet tabSheet;
tabSheet = ExtensionModelFactory.eINSTANCE.createYTabSheet();
YTab tab = ExtensionModelFactory.eINSTANCE.createYTab();
tab.setLabelI18nKey(getEntityI18nKey(yLayout.getSuspects()));
@@ -191,7 +199,7 @@
}
// Creates YEmbeddables from YSuspects
for (YSuspect suspect : createSuspectList(yLayout)) {
- if (filteredCategory != null && !filteredCategory.equals("") && !suspect.getTags().contains(filteredCategory)) {
+ if (filteredCategory != null && !"".equals(filteredCategory) && !suspect.getTags().contains(filteredCategory)) {
// filter the suspect
continue;
}
@@ -235,8 +243,8 @@
* @return the array list
*/
private ArrayList<YSuspect> createSuspectList(YStrategyLayout yLayout) {
- ArrayList<YSuspect> suspectList = new ArrayList<YSuspect>(yLayout.getSuspects().size());
- ArrayList<YSuspect> suspectCollectionList = new ArrayList<YSuspect>(yLayout.getSuspects().size());
+ ArrayList<YSuspect> suspectList = new ArrayList<>(yLayout.getSuspects().size());
+ ArrayList<YSuspect> suspectCollectionList = new ArrayList<>(yLayout.getSuspects().size());
for (YSuspect ySuspect : yLayout.getSuspects()) {
if (ySuspect.getTags().contains(TAG__TABLE) || ySuspect.getTags().contains(TAG__GRID)) {
suspectCollectionList.add(ySuspect);
@@ -265,7 +273,6 @@
if (suspectInfo.getSuspect().getTags().contains(TAG__TABLE) || suspectInfo.getSuspect().getTags().contains(TAG__GRID)) {
YTab tab = ExtensionModelFactory.eINSTANCE.createYTab();
tab.setLabelI18nKey(suspectInfo.getSuspect().getLabelI18nKey());
- // YLayout layout = createContentLayout();
YVerticalLayout layout = ExtensionModelFactory.eINSTANCE.createYVerticalLayout();
layout.addElement(element);
YVerticalLayoutCellStyle cellStyle = layout.addCellStyle(element);
@@ -274,10 +281,10 @@
tabs.add(tab);
} else {
// Gets the YLayout of the first tab to add the element
- addElement(((YLayout) tabs.get(0).getEmbeddable()), element);
+ addElement((YLayout) tabs.get(0).getEmbeddable(), element);
}
} else {
- addElement(((YLayout) content), element);
+ addElement((YLayout) content, element);
}
}
@@ -307,7 +314,7 @@
*/
protected YEmbeddable prepareElementForSuspect(YSuspectInfo suspectInfo) {
// create a new element for the given suspect
- YEmbeddable yEmbeddable = createElementForSuspect(suspectInfo);
+ YEmbeddable yEmbeddable = createElementForSuspect(suspectInfo); // NOSONAR
return yEmbeddable;
}
@@ -333,7 +340,7 @@
// make a copy -> otherwise the suspect will be changed
YBindingEndpoint epCopy = EcoreUtil.copy(ep);
- YValueBindingEndpoint yValueEP = null;
+ YValueBindingEndpoint yValueEP;
if (suspectInfo.getTags().contains(ILayoutingStrategy.TAG__RICH_TEXT__BLOB)) {
// if we need to bind the blob value, then we need to use a
// different endpoint
@@ -402,7 +409,6 @@
if (existFunctionsInProperties(ySuspect)) {
yEmbeddable = YECviewFactory.eINSTANCE.createYCustomDecimalField();
setCustomDecimalConverter(yEmbeddable, ySuspect);
- // if (existInProperties(ySuspect, PROPERTY_DECIMALFORMAT)) {
} else {
yEmbeddable = ExtensionModelFactory.eINSTANCE.createYDecimalField();
((YDecimalField) yEmbeddable).setConverter(getConverter(ySuspect.getProperties()));
@@ -477,10 +483,14 @@
yEmbeddable = createOrganizationCombo(ySuspect);
} else if (ySuspect.getTags().contains(TAG__PERSPECTIVE_COMBO)) {
yEmbeddable = createPerspectiveCombo(ySuspect);
+ } else if (ySuspect.getTags().contains(TAG__THEME_COMBO)) {
+ yEmbeddable = createThemeCombo(ySuspect);
} else if (ySuspect.getTags().contains(TAG__IMAGE_PICKER)) {
yEmbeddable = createIconComboBox(ySuspect);
} else if (ySuspect.getTags().contains(TAG__SUBTYPES_ROOT)) {
createSubTypeElements((YSubTypeBaseSuspect) ySuspect);
+ } else if (ySuspect.getTags().contains(TAG__DTO)) {
+ createNestedBeanElements((YTypedCompoundSuspect) ySuspect);
} else {
yEmbeddable = ExtensionModelFactory.eINSTANCE.createYTextField();
}
@@ -492,6 +502,10 @@
suspectInfo.setTarget(yEmbeddable);
+ if(ySuspect.getTags().contains(TAG__ON_KANBAN_CARD)){
+ yEmbeddable.getTags().add(TAG__ON_KANBAN_CARD);
+ }
+
// --- Required for validation ---
if (ySuspect.getTags().contains(TAG__CONSTRAINT)) {
if (yEmbeddable instanceof YField) {
@@ -502,6 +516,18 @@
}
}
+
+ if (ySuspect.getTags().contains(TAG__UNIQUE)) {
+ if (yEmbeddable instanceof YField) {
+ YUniqueAttributeValidator validator = ValidationFactory.eINSTANCE.createYUniqueAttributeValidator();
+ validator.setValTypeFullyQualifiedName(ySuspect.getProperties().get(PROPERTY_CLASS));
+ validator.setPropertyPath(ySuspect.getProperties().get(PROPERTY_NAME));
+ // this endpoint gains access to the bound bean
+ validator.setContainerValueBindingEndpoint(EcoreUtil.copy(ySuspect.getContainerValueBindingEndpoint()));
+ ((YField) yEmbeddable).getValidators().add(validator);
+ }
+ }
+
// ------------------------------
// Only for Test purposes
@@ -595,6 +621,28 @@
}
/**
+ * Creates elements for nested types in the dto.
+ *
+ * @param ySuspect
+ * the y suspect
+ * @return the yEmbeddable
+ */
+ private YEmbeddable createNestedBeanElements(YTypedCompoundSuspect ySuspect) {
+
+ for (YSuspect childSuspect : ySuspect.getChildren()) {
+ // Create a new suspect info.
+ YSuspectInfo suspectInfo = layoutingInfo.createSuspectInfo(childSuspect);
+ // add the suspectInfo as active suspect
+ layoutingInfo.getActiveSuspectInfos().add(suspectInfo);
+
+ YEmbeddable yEmbeddable = prepareElementForSuspect(suspectInfo);
+ addElement(null, yEmbeddable, suspectInfo);
+ }
+
+ return null;
+ }
+
+ /**
* Create a VP which reacts to the type of the value in the beanslot. And matches it against the type of the child suspect.
*
* @param yEmbeddable
@@ -734,7 +782,24 @@
beanReferenceField.setType(yTypedSuspect.getType());
beanReferenceField.setTypeQualifiedName(yTypedSuspect.getTypeQualifiedName());
beanReferenceField.setCaptionPropertyPath(getCaptionPropertyPath(suspectProperties));
+
+ // create search dialog
+ Class<?> type = yTypedSuspect.getType();
+ YFilteringComponent yFilterComponent = ExtensionModelFactory.eINSTANCE.createYFilteringComponent();
+
+ String filterDepthString = suspectProperties.get(ILayoutingStrategy.PROPERTY__FILTER_DEPTH);
+ int depth = 0;
+ if (filterDepthString != null) {
+ depth = Integer.valueOf(filterDepthString);
+ }
+
+ ECViewUtil.fill(type, depth, yFilterComponent);
+
+ if (!yFilterComponent.getFilterDescriptors().isEmpty()) {
+ beanReferenceField.setFilteringComponent(yFilterComponent);
+ }
}
+
// Alternative for non editable bean references is a non editable
// Textfield.
} else {
@@ -763,29 +828,6 @@
}
/**
- * Creates the y combo box.
- *
- * @param ySuspect
- * the y suspect
- * @return the y embeddable
- */
- private YEmbeddable createSimpleComboBox(YSuspect ySuspect) {
- YTypedSuspect yTypedSuspect = (YTypedSuspect) ySuspect;
- EMap<String, String> suspectProperties = yTypedSuspect.getProperties();
- YComboBox yEmbeddable = null;
- if (suspectProperties.containsKey("caption")) {
- yEmbeddable = ExtensionModelFactory.eINSTANCE.createYComboBox();
- YComboBox comboBox = (YComboBox) yEmbeddable;
- comboBox.setType(yTypedSuspect.getType());
- comboBox.setTypeQualifiedName(yTypedSuspect.getTypeQualifiedName());
- comboBox.setCaptionProperty(suspectProperties.get("caption"));
- }
- // TODO: check if yEmbeddable might be set by some other condition.
- // Otherwise it might be null.
- return yEmbeddable;
- }
-
- /**
* Creates the table.
*
* @param ySuspect
@@ -812,6 +854,9 @@
YDatadescription datadescription = DatatypesFactoryImpl.eINSTANCE.createYDatadescription();
datadescription.setLabelI18nKey(columnInfo.getLabelI18nKey());
column.setDatadescription(datadescription);
+ if (columnInfo.getProperties() != null && !columnInfo.getProperties().isEmpty()) {
+ column.getProperties().addAll(columnInfo.getProperties());
+ }
columns.add(column);
}
for (YColumn yColumn : table.getColumns()) {
@@ -909,9 +954,6 @@
yEmbeddable = YECviewFactory.eINSTANCE.createYPairComboBox();
YPairComboBox yCombo = (YPairComboBox) yEmbeddable;
yCombo.setUseBeanService(false);
- // YTypedSuspect yTypedSuspect = (YTypedSuspect) ySuspect;
- // yCombo.setType(yTypedSuspect.getType());
- // yCombo.setTypeQualifiedName(yTypedSuspect.getTypeQualifiedName());
yCombo.setType(Pair.class);
yCombo.setTypeQualifiedName(Pair.class.getCanonicalName());
yCombo.getCollection().addAll(getPerspectiveNames());
@@ -919,27 +961,39 @@
return yEmbeddable;
}
- private Collection<? extends IPosition> getOrganizationPositions(String organizationName) {
- IOrganizationService organizationService = ServiceListener.getOrganizationService();
- // In case of the open source solution a organization service is not available!
- if (organizationService != null) {
- AbstractSubOrganization organization = organizationService.getOrganization(organizationName);
- if (organization != null) {
- return organization.getPositions();
- }
- }
- return Collections.emptyList();
+ /**
+ * Creates the theme combo box inclosing themes.
+ *
+ * @param ySuspect
+ * the y suspect
+ * @return the y embeddable
+ */
+ private YEmbeddable createThemeCombo(YSuspect ySuspect) {
+ YEmbeddable yEmbeddable;
+ yEmbeddable = ExtensionModelFactory.eINSTANCE.createYComboBox();
+ YComboBox yCombo = (YComboBox) yEmbeddable;
+ yCombo.setUseBeanService(false);
+ yCombo.setCaptionProperty("label");
+ yCombo.setType(VaaclipseUiTheme.class);
+ yCombo.setTypeQualifiedName(VaaclipseUiTheme.class.getCanonicalName());
+ yCombo.setModelSelectionType(String.class);
+ yCombo.setModelSelectionTypeQualifiedName(String.class.getCanonicalName());
+ yCombo.getCollection().addAll(getThemes());
+ YConverter conv = YConverterFactory.eINSTANCE.createYVaaclipseUiThemeToStringConverter();
+ yCombo.setConverter(conv);
+ return yEmbeddable;
}
private Collection<String> getOrganizationPositionNames(String organizationName) {
IOrganizationService organizationService = ServiceListener.getOrganizationService();
- // In case of the open source solution a organization service is not available!
+ // In case of the open source solution a organization service is not
+ // available!
if (organizationService != null) {
AbstractSubOrganization organization = organizationService.getOrganization(organizationName);
if (organization != null) {
- Collection<String> positionNames = new TreeSet<String>();
+ Collection<String> positionNames = new TreeSet<>();
for (IPosition position : organization.getPositions()) {
- positionNames.add(position.getName().replace("_", " "));
+ positionNames.add(position.getLinkAlias());
}
return positionNames;
}
@@ -952,6 +1006,10 @@
return dslMetadataService.getDslGrammarElementNames(IDSLMetadataService.DSLLiterals.PERSPECTIVES);
}
+ private Set<VaaclipseUiTheme> getThemes() {
+ return VaaclipseUiTheme.values(ThemeList.forProduct);
+ }
+
/**
* Sets the custom decimal converter.
*
@@ -1023,11 +1081,11 @@
String dtoName = ySuspect.getAuthorizationGroup();
String dtoProperty = ySuspect.getAuthorizationId();
- if (userAccessService.isPermitted(Permission.forDto(dtoName, Action.readable)).isPermitted()) {
- boolean invisible = userAccessService.isPermitted(Permission.forDtoProperty(dtoName, dtoProperty, Action.invisible)).isPermitted();
+ if (userAccessService.isGranted(Group.DTO, Action.READABLE, dtoName)) {
+ boolean invisible = userAccessService.isVetoed(Group.DTO, Action.INVISIBLE, dtoName, dtoProperty);
if (!invisible) {
- boolean enabled = !userAccessService.isPermitted(Permission.forDtoProperty(dtoName, dtoProperty, Action.disabled)).isPermitted();
- boolean editable = !userAccessService.isPermitted(Permission.forDtoProperty(dtoName, dtoProperty, Action.noneditable)).isPermitted();
+ boolean enabled = !userAccessService.isVetoed(Group.DTO, Action.DISABLED, dtoName, dtoProperty);
+ boolean editable = !userAccessService.isVetoed(Group.DTO, Action.NONEDITABLE, dtoName, dtoProperty);
if (enabled && editable) {
return true;
}
@@ -1046,32 +1104,12 @@
private String getEntityI18nKey(EList<YSuspect> suspects) {
for (YSuspect suspect : suspects) {
String dto = suspect.getAuthorizationGroup();
- return NamingConventionsUtil.toFqnEntityName(dto);
+ return NamingConventionsUtil.toSimpleEntityName(dto);
}
return "";
}
/**
- * Returns true, if the label is valid.
- *
- * @param i18nKey
- * the i18n key
- * @return true, if is label i18n key valid
- */
- private boolean isLabelI18nKeyValid(String i18nKey) {
- return i18nKey != null;
- }
-
- /**
- * Returns the active locale for the view.
- *
- * @return the locale
- */
- private Locale getLocale() {
- return viewContext.getLocale();
- }
-
- /**
* Helper Comparator to allow to sort a list of suspects due to their table or grid property value. Sort criteria is that the highest value became the first of the list
* followed by the suspects with decreasing value. In case of same values the order between the compared suspects will be maintained and in case of no value the suspect gets
* the value 0 and became the last elements of the list.
@@ -1090,24 +1128,23 @@
public int compare(YSuspect suspect1, YSuspect suspect2) {
if (suspect1 == null && suspect2 == null) {
return 0;
- } else if (suspect1 == null && suspect2 != null) {
+ } else if (suspect1 == null) { // && suspect2 != null
return (-1);
- } else if (suspect1 != null && suspect2 == null) {
+ } else if (suspect2 == null) { // suspect1 != null &&
return 1;
- } else if (suspect1 != null && suspect2 != null) {
- boolean _lessThan = (getValue(suspect1).compareTo(getValue(suspect2)) < 0);
- if (_lessThan) {
+ } else { // this means: (suspect1 != null && suspect2 != null)
+ boolean lessThan = getValue(suspect1).compareTo(getValue(suspect2)) < 0;
+ if (lessThan) {
return 1;
} else {
- boolean _greaterThan = (getValue(suspect1).compareTo(getValue(suspect2)) > 0);
- if (_greaterThan) {
+ boolean greaterThan = getValue(suspect1).compareTo(getValue(suspect2)) > 0;
+ if (greaterThan) {
return (-1);
} else {
return 0;
}
}
}
- return 0;
}
/**
@@ -1125,7 +1162,7 @@
}
return Integer.valueOf(value);
} catch (NumberFormatException nfe) {
- return new Integer(0);
+ return 0;
}
}
diff --git a/org.eclipse.osbp.ecview.extension.strategy/src/org/eclipse/osbp/ecview/extension/strategy/AltEnterForwardFocusingStrategy.java b/org.eclipse.osbp.ecview.extension.strategy/src/org/eclipse/osbp/ecview/extension/strategy/AltEnterForwardFocusingStrategy.java
index 98651d9..99dc8eb 100644
--- a/org.eclipse.osbp.ecview.extension.strategy/src/org/eclipse/osbp/ecview/extension/strategy/AltEnterForwardFocusingStrategy.java
+++ b/org.eclipse.osbp.ecview.extension.strategy/src/org/eclipse/osbp/ecview/extension/strategy/AltEnterForwardFocusingStrategy.java
@@ -22,38 +22,36 @@
import org.eclipse.osbp.ecview.core.common.model.core.YView;
import org.eclipse.osbp.ecview.core.common.services.IWidgetAssocationsService;
import org.eclipse.osbp.ecview.core.util.emf.ModelUtil;
+import org.eclipse.osbp.ecview.extension.api.IFocusingStrategy;
+import org.eclipse.osbp.ecview.extension.model.YStrategyLayout;
import org.eclipse.osbp.runtime.common.keystroke.KeyStrokeDefinition;
import com.vaadin.event.ShortcutAction.KeyCode;
import com.vaadin.event.ShortcutAction.ModifierKey;
-import org.eclipse.osbp.ecview.extension.api.IFocusingStrategy;
-import org.eclipse.osbp.ecview.extension.model.YStrategyLayout;
-
/**
* The Class AltEnterForwardFocusingStrategy.
*/
public class AltEnterForwardFocusingStrategy implements IFocusingStrategy {
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.osbp.ecview.extension.api.IFocusingStrategy#focus(java.lang.Object, java.lang.Object, org.eclipse.osbp.ecview.extension.model.YStrategyLayout)
*/
@Override
public void focus(Object source, Object target, YStrategyLayout yLayout) {
YView yView = yLayout.getView();
IViewContext context = ModelUtil.getViewContext(yView);
- IWidgetAssocationsService<Object, ? extends YElement> service = context
- .getService(IWidgetAssocationsService.ID);
+ IWidgetAssocationsService<Object, ? extends YElement> service = context.getService(IWidgetAssocationsService.ID);
- YEmbeddable yCurrentFocus = (YEmbeddable) service
- .getModelElement(target);
+ YEmbeddable yCurrentFocus = (YEmbeddable) service.getModelElement(target);
YEmbeddable yNextFocus = findNextElementToFocus(yCurrentFocus);
yView.setCurrentFocus((YFocusable) yNextFocus);
}
/**
- * Looks for the next element to be focused. Therefore it uses a round robin
- * approach. If end of elements are reached, we start by index = 0 again.
+ * Looks for the next element to be focused. Therefore it uses a round robin approach. If end of elements are reached, we start by index = 0 again.
*
* @param yElement
* the y element
@@ -74,8 +72,8 @@
}
YEmbeddable nextFocusElement = yParent.getElements().get(index);
- if (nextFocusElement instanceof YEditable){
- if (((YEditable)nextFocusElement).isEditable()){
+ if (nextFocusElement instanceof YEditable) {
+ if (((YEditable) nextFocusElement).isEditable()) {
return nextFocusElement;
} else {
return findNextElementToFocus(nextFocusElement);
@@ -84,15 +82,16 @@
return nextFocusElement;
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.osbp.ecview.extension.api.IFocusingStrategy#getKeyStrokeDefinition()
*/
@Override
public KeyStrokeDefinition getKeyStrokeDefinition() {
int[] modifierKeys = new int[1];
modifierKeys[0] = ModifierKey.ALT;
- KeyStrokeDefinition def = new KeyStrokeDefinition("", KeyCode.ENTER,
- modifierKeys);
+ KeyStrokeDefinition def = new KeyStrokeDefinition("", KeyCode.ENTER, modifierKeys);
return def;
}
diff --git a/org.eclipse.osbp.ecview.extension.strategy/src/org/eclipse/osbp/ecview/extension/strategy/EnterBackwardFocusingStrategy.java b/org.eclipse.osbp.ecview.extension.strategy/src/org/eclipse/osbp/ecview/extension/strategy/EnterBackwardFocusingStrategy.java
index 012db1d..9d080a3 100644
--- a/org.eclipse.osbp.ecview.extension.strategy/src/org/eclipse/osbp/ecview/extension/strategy/EnterBackwardFocusingStrategy.java
+++ b/org.eclipse.osbp.ecview.extension.strategy/src/org/eclipse/osbp/ecview/extension/strategy/EnterBackwardFocusingStrategy.java
@@ -13,6 +13,8 @@
*/
package org.eclipse.osbp.ecview.extension.strategy;
+import java.util.Map;
+
import org.eclipse.osbp.ecview.core.common.context.IViewContext;
import org.eclipse.osbp.ecview.core.common.model.core.YEditable;
import org.eclipse.osbp.ecview.core.common.model.core.YElement;
@@ -22,37 +24,35 @@
import org.eclipse.osbp.ecview.core.common.model.core.YView;
import org.eclipse.osbp.ecview.core.common.services.IWidgetAssocationsService;
import org.eclipse.osbp.ecview.core.util.emf.ModelUtil;
+import org.eclipse.osbp.ecview.extension.api.IFocusingStrategy;
+import org.eclipse.osbp.ecview.extension.model.YStrategyLayout;
import org.eclipse.osbp.runtime.common.keystroke.KeyStrokeDefinition;
import com.vaadin.event.ShortcutAction.KeyCode;
-import org.eclipse.osbp.ecview.extension.api.IFocusingStrategy;
-import org.eclipse.osbp.ecview.extension.model.YStrategyLayout;
-
/**
* The Class EnterBackwardFocusingStrategy.
*/
public class EnterBackwardFocusingStrategy implements IFocusingStrategy {
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.osbp.ecview.extension.api.IFocusingStrategy#focus(java.lang.Object, java.lang.Object, org.eclipse.osbp.ecview.extension.model.YStrategyLayout)
*/
@Override
public void focus(Object source, Object target, YStrategyLayout yLayout) {
YView yView = yLayout.getView();
IViewContext context = ModelUtil.getViewContext(yView);
- IWidgetAssocationsService<Object, ? extends YElement> service = context
- .getService(IWidgetAssocationsService.ID);
+ IWidgetAssocationsService<Object, ? extends YElement> service = context.getService(IWidgetAssocationsService.ID);
- YEmbeddable yCurrentFocus = (YEmbeddable) service
- .getModelElement(target);
+ YEmbeddable yCurrentFocus = (YEmbeddable) service.getModelElement(target);
YEmbeddable yNextFocus = findNextElementToFocus(yCurrentFocus);
yView.setCurrentFocus((YFocusable) yNextFocus);
}
/**
- * Looks for the next element to be focused. Therefore it uses a round robin
- * approach. If the first element is reached, we start at the end again.
+ * Looks for the next element to be focused. Therefore it uses a round robin approach. If the first element is reached, we start at the end again.
*
* @param yElement
* the y element
@@ -73,8 +73,8 @@
}
YEmbeddable nextFocusElement = yParent.getElements().get(index);
- if (nextFocusElement instanceof YEditable){
- if (((YEditable)nextFocusElement).isEditable()){
+ if (nextFocusElement instanceof YEditable) {
+ if (((YEditable) nextFocusElement).isEditable()) {
return nextFocusElement;
} else {
return findNextElementToFocus(nextFocusElement);
@@ -83,7 +83,9 @@
return nextFocusElement;
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.osbp.ecview.extension.api.IFocusingStrategy#getKeyStrokeDefinition()
*/
@Override
diff --git a/org.eclipse.osbp.ecview.extension.strategy/src/org/eclipse/osbp/ecview/extension/strategy/EnterForwardFocusingStrategy.java b/org.eclipse.osbp.ecview.extension.strategy/src/org/eclipse/osbp/ecview/extension/strategy/EnterForwardFocusingStrategy.java
index fa49b57..82b5dc5 100644
--- a/org.eclipse.osbp.ecview.extension.strategy/src/org/eclipse/osbp/ecview/extension/strategy/EnterForwardFocusingStrategy.java
+++ b/org.eclipse.osbp.ecview.extension.strategy/src/org/eclipse/osbp/ecview/extension/strategy/EnterForwardFocusingStrategy.java
@@ -13,6 +13,8 @@
*/
package org.eclipse.osbp.ecview.extension.strategy;
+import java.util.Map;
+
import org.eclipse.osbp.ecview.core.common.context.IViewContext;
import org.eclipse.osbp.ecview.core.common.model.core.YEditable;
import org.eclipse.osbp.ecview.core.common.model.core.YElement;
@@ -22,37 +24,35 @@
import org.eclipse.osbp.ecview.core.common.model.core.YView;
import org.eclipse.osbp.ecview.core.common.services.IWidgetAssocationsService;
import org.eclipse.osbp.ecview.core.util.emf.ModelUtil;
+import org.eclipse.osbp.ecview.extension.api.IFocusingStrategy;
+import org.eclipse.osbp.ecview.extension.model.YStrategyLayout;
import org.eclipse.osbp.runtime.common.keystroke.KeyStrokeDefinition;
import com.vaadin.event.ShortcutAction.KeyCode;
-import org.eclipse.osbp.ecview.extension.api.IFocusingStrategy;
-import org.eclipse.osbp.ecview.extension.model.YStrategyLayout;
-
/**
* The Class EnterForwardFocusingStrategy.
*/
public class EnterForwardFocusingStrategy implements IFocusingStrategy {
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.osbp.ecview.extension.api.IFocusingStrategy#focus(java.lang.Object, java.lang.Object, org.eclipse.osbp.ecview.extension.model.YStrategyLayout)
*/
@Override
public void focus(Object source, Object target, YStrategyLayout yLayout) {
YView yView = yLayout.getView();
IViewContext context = ModelUtil.getViewContext(yView);
- IWidgetAssocationsService<Object, ? extends YElement> service = context
- .getService(IWidgetAssocationsService.ID);
+ IWidgetAssocationsService<Object, ? extends YElement> service = context.getService(IWidgetAssocationsService.ID);
- YEmbeddable yCurrentFocus = (YEmbeddable) service
- .getModelElement(target);
+ YEmbeddable yCurrentFocus = (YEmbeddable) service.getModelElement(target);
YEmbeddable yNextFocus = findNextElementToFocus(yCurrentFocus);
yView.setCurrentFocus((YFocusable) yNextFocus);
}
/**
- * Looks for the next element to be focused. Therefore it uses a round robin
- * approach. If end of elements are reached, we start by index = 0 again.
+ * Looks for the next element to be focused. Therefore it uses a round robin approach. If end of elements are reached, we start by index = 0 again.
*
* @param yElement
* the y element
@@ -73,8 +73,8 @@
}
YEmbeddable nextFocusElement = yParent.getElements().get(index);
- if (nextFocusElement instanceof YEditable){
- if (((YEditable)nextFocusElement).isEditable()){
+ if (nextFocusElement instanceof YEditable) {
+ if (((YEditable) nextFocusElement).isEditable()) {
return nextFocusElement;
} else {
return findNextElementToFocus(nextFocusElement);
@@ -83,13 +83,14 @@
return nextFocusElement;
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.osbp.ecview.extension.api.IFocusingStrategy#getKeyStrokeDefinition()
*/
@Override
public KeyStrokeDefinition getKeyStrokeDefinition() {
- KeyStrokeDefinition def = new KeyStrokeDefinition("", KeyCode.ENTER,
- new int[0]);
+ KeyStrokeDefinition def = new KeyStrokeDefinition("", KeyCode.ENTER, new int[0]);
return def;
}
diff --git a/org.eclipse.osbp.ecview.extension.strategy/src/org/eclipse/osbp/ecview/extension/strategy/TabBackwardFocusingStrategy.java b/org.eclipse.osbp.ecview.extension.strategy/src/org/eclipse/osbp/ecview/extension/strategy/TabBackwardFocusingStrategy.java
index a5c844b..77ef83e 100644
--- a/org.eclipse.osbp.ecview.extension.strategy/src/org/eclipse/osbp/ecview/extension/strategy/TabBackwardFocusingStrategy.java
+++ b/org.eclipse.osbp.ecview.extension.strategy/src/org/eclipse/osbp/ecview/extension/strategy/TabBackwardFocusingStrategy.java
@@ -13,6 +13,8 @@
*/
package org.eclipse.osbp.ecview.extension.strategy;
+import java.util.Map;
+
import org.eclipse.osbp.ecview.core.common.context.IViewContext;
import org.eclipse.osbp.ecview.core.common.model.core.YEditable;
import org.eclipse.osbp.ecview.core.common.model.core.YElement;
@@ -22,37 +24,35 @@
import org.eclipse.osbp.ecview.core.common.model.core.YView;
import org.eclipse.osbp.ecview.core.common.services.IWidgetAssocationsService;
import org.eclipse.osbp.ecview.core.util.emf.ModelUtil;
+import org.eclipse.osbp.ecview.extension.api.IFocusingStrategy;
+import org.eclipse.osbp.ecview.extension.model.YStrategyLayout;
import org.eclipse.osbp.runtime.common.keystroke.KeyStrokeDefinition;
import com.vaadin.event.ShortcutAction.KeyCode;
-import org.eclipse.osbp.ecview.extension.api.IFocusingStrategy;
-import org.eclipse.osbp.ecview.extension.model.YStrategyLayout;
-
/**
* The Class TabBackwardFocusingStrategy.
*/
public class TabBackwardFocusingStrategy implements IFocusingStrategy {
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.osbp.ecview.extension.api.IFocusingStrategy#focus(java.lang.Object, java.lang.Object, org.eclipse.osbp.ecview.extension.model.YStrategyLayout)
*/
@Override
public void focus(Object source, Object target, YStrategyLayout yLayout) {
YView yView = yLayout.getView();
IViewContext context = ModelUtil.getViewContext(yView);
- IWidgetAssocationsService<Object, ? extends YElement> service = context
- .getService(IWidgetAssocationsService.ID);
+ IWidgetAssocationsService<Object, ? extends YElement> service = context.getService(IWidgetAssocationsService.ID);
- YEmbeddable yCurrentFocus = (YEmbeddable) service
- .getModelElement(target);
+ YEmbeddable yCurrentFocus = (YEmbeddable) service.getModelElement(target);
YEmbeddable yNextFocus = findNextElementToFocus(yLayout, yCurrentFocus);
yView.setCurrentFocus((YFocusable) yNextFocus);
}
/**
- * Looks for the next element to be focused. Therefore it uses a round robin
- * approach. If the first element is reached, we start at the end again.
+ * Looks for the next element to be focused. Therefore it uses a round robin approach. If the first element is reached, we start at the end again.
*
* @param yLayout
* the y layout
@@ -60,8 +60,7 @@
* the y element
* @return the y embeddable
*/
- protected YEmbeddable findNextElementToFocus(YStrategyLayout yLayout,
- YEmbeddable yElement) {
+ protected YEmbeddable findNextElementToFocus(YStrategyLayout yLayout, YEmbeddable yElement) {
if (yElement == null) {
return null;
}
@@ -76,8 +75,8 @@
}
YEmbeddable nextFocusElement = yParent.getElements().get(index);
- if (nextFocusElement instanceof YEditable){
- if (((YEditable)nextFocusElement).isEditable()){
+ if (nextFocusElement instanceof YEditable) {
+ if (((YEditable) nextFocusElement).isEditable()) {
return nextFocusElement;
} else {
return findNextElementToFocus(yLayout, nextFocusElement);
@@ -99,13 +98,14 @@
// return target;
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.osbp.ecview.extension.api.IFocusingStrategy#getKeyStrokeDefinition()
*/
@Override
public KeyStrokeDefinition getKeyStrokeDefinition() {
- KeyStrokeDefinition def = new KeyStrokeDefinition("", KeyCode.TAB,
- new int[0]);
+ KeyStrokeDefinition def = new KeyStrokeDefinition("", KeyCode.TAB, new int[0]);
return def;
}
diff --git a/org.eclipse.osbp.ecview.extension.strategy/src/org/eclipse/osbp/ecview/extension/strategy/TabForwardFocusingStrategy.java b/org.eclipse.osbp.ecview.extension.strategy/src/org/eclipse/osbp/ecview/extension/strategy/TabForwardFocusingStrategy.java
index dc8b9cc..351023f 100644
--- a/org.eclipse.osbp.ecview.extension.strategy/src/org/eclipse/osbp/ecview/extension/strategy/TabForwardFocusingStrategy.java
+++ b/org.eclipse.osbp.ecview.extension.strategy/src/org/eclipse/osbp/ecview/extension/strategy/TabForwardFocusingStrategy.java
@@ -13,6 +13,8 @@
*/
package org.eclipse.osbp.ecview.extension.strategy;
+import java.util.Map;
+
import org.eclipse.osbp.ecview.core.common.context.IViewContext;
import org.eclipse.osbp.ecview.core.common.model.core.YEditable;
import org.eclipse.osbp.ecview.core.common.model.core.YElement;
@@ -22,37 +24,35 @@
import org.eclipse.osbp.ecview.core.common.model.core.YView;
import org.eclipse.osbp.ecview.core.common.services.IWidgetAssocationsService;
import org.eclipse.osbp.ecview.core.util.emf.ModelUtil;
+import org.eclipse.osbp.ecview.extension.api.IFocusingStrategy;
+import org.eclipse.osbp.ecview.extension.model.YStrategyLayout;
import org.eclipse.osbp.runtime.common.keystroke.KeyStrokeDefinition;
import com.vaadin.event.ShortcutAction.KeyCode;
-import org.eclipse.osbp.ecview.extension.api.IFocusingStrategy;
-import org.eclipse.osbp.ecview.extension.model.YStrategyLayout;
-
/**
* The Class TabForwardFocusingStrategy.
*/
public class TabForwardFocusingStrategy implements IFocusingStrategy {
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.osbp.ecview.extension.api.IFocusingStrategy#focus(java.lang.Object, java.lang.Object, org.eclipse.osbp.ecview.extension.model.YStrategyLayout)
*/
@Override
public void focus(Object source, Object target, YStrategyLayout yLayout) {
YView yView = yLayout.getView();
IViewContext context = ModelUtil.getViewContext(yView);
- IWidgetAssocationsService<Object, ? extends YElement> service = context
- .getService(IWidgetAssocationsService.ID);
+ IWidgetAssocationsService<Object, ? extends YElement> service = context.getService(IWidgetAssocationsService.ID);
- YEmbeddable yCurrentFocus = (YEmbeddable) service
- .getModelElement(target);
+ YEmbeddable yCurrentFocus = (YEmbeddable) service.getModelElement(target);
YEmbeddable yNextFocus = findNextElementToFocus(yCurrentFocus);
yView.setCurrentFocus((YFocusable) yNextFocus);
}
/**
- * Looks for the next element to be focused. Therefore it uses a round robin
- * approach. If end of elements are reached, we start by index = 0 again.
+ * Looks for the next element to be focused. Therefore it uses a round robin approach. If end of elements are reached, we start by index = 0 again.
*
* @param yElement
* the y element
@@ -73,8 +73,8 @@
}
YEmbeddable nextFocusElement = yParent.getElements().get(index);
- if (nextFocusElement instanceof YEditable){
- if (((YEditable)nextFocusElement).isEditable()){
+ if (nextFocusElement instanceof YEditable) {
+ if (((YEditable) nextFocusElement).isEditable()) {
return nextFocusElement;
} else {
return findNextElementToFocus(nextFocusElement);
@@ -83,13 +83,14 @@
return nextFocusElement;
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.osbp.ecview.extension.api.IFocusingStrategy#getKeyStrokeDefinition()
*/
@Override
public KeyStrokeDefinition getKeyStrokeDefinition() {
- KeyStrokeDefinition def = new KeyStrokeDefinition("", KeyCode.TAB,
- new int[0]);
+ KeyStrokeDefinition def = new KeyStrokeDefinition("", KeyCode.TAB, new int[0]);
return def;
}
diff --git a/org.eclipse.osbp.ecview.extension.strategy/src/org/eclipse/osbp/ecview/extension/strategy/util/NamingConventionsUtil.java b/org.eclipse.osbp.ecview.extension.strategy/src/org/eclipse/osbp/ecview/extension/strategy/util/NamingConventionsUtil.java
index e2b0b50..296255c 100644
--- a/org.eclipse.osbp.ecview.extension.strategy/src/org/eclipse/osbp/ecview/extension/strategy/util/NamingConventionsUtil.java
+++ b/org.eclipse.osbp.ecview.extension.strategy/src/org/eclipse/osbp/ecview/extension/strategy/util/NamingConventionsUtil.java
@@ -107,6 +107,19 @@
}
/**
+ * Returns the simple name of the entity for the given type.
+ *
+ * @param fqnDto
+ * the fqn dto
+ * @return the string
+ */
+ public static String toSimpleEntityName(String fqnDto) {
+ int idx = fqnDto.lastIndexOf(".");
+ String dtoName = fqnDto.substring(idx+1);
+ return toEntityName(dtoName);
+ }
+
+ /**
* The Class Pair.
*/
private static class Pair {
diff --git a/org.eclipse.osbp.ecview.extension.tests/.classpath b/org.eclipse.osbp.ecview.extension.tests/.classpath
new file mode 100644
index 0000000..22f3064
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.tests/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/org.eclipse.osbp.ecview.extension.tests/.gitignore b/org.eclipse.osbp.ecview.extension.tests/.gitignore
new file mode 100644
index 0000000..ae3c172
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.tests/.gitignore
@@ -0,0 +1 @@
+/bin/
diff --git a/org.eclipse.osbp.ecview.extension.tests/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.osbp.ecview.extension.tests/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 0000000..0c68a61
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.tests/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,7 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+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.8
diff --git a/org.eclipse.osbp.ecview.extension.widgetset/.classpath b/org.eclipse.osbp.ecview.extension.widgetset/.classpath
new file mode 100644
index 0000000..5323207
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.widgetset/.classpath
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="src" path="VAADIN"/>
+ <classpathentry kind="output" path="target/classes"/>
+</classpath>
diff --git a/org.eclipse.osbp.ecview.extension.widgetset/.gitignore b/org.eclipse.osbp.ecview.extension.widgetset/.gitignore
new file mode 100644
index 0000000..efd82af
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.widgetset/.gitignore
@@ -0,0 +1,6 @@
+/resources/
+/gwt-unitCache
+/VAADIN/*
+!/VAADIN/README.txt
+/target/
+/target/
diff --git a/org.eclipse.osbp.ecview.extension.widgetset/.settings/org.eclipse.core.resources.prefs b/org.eclipse.osbp.ecview.extension.widgetset/.settings/org.eclipse.core.resources.prefs
new file mode 100644
index 0000000..99f26c0
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.widgetset/.settings/org.eclipse.core.resources.prefs
@@ -0,0 +1,2 @@
+eclipse.preferences.version=1
+encoding/<project>=UTF-8
diff --git a/org.eclipse.osbp.ecview.extension.widgetset/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.osbp.ecview.extension.widgetset/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 0000000..f42de36
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.widgetset/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,7 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
+org.eclipse.jdt.core.compiler.compliance=1.7
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.7
diff --git a/org.eclipse.osbp.ecview.extension.widgetset/.settings/org.eclipse.m2e.core.prefs b/org.eclipse.osbp.ecview.extension.widgetset/.settings/org.eclipse.m2e.core.prefs
new file mode 100644
index 0000000..f897a7f
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.widgetset/.settings/org.eclipse.m2e.core.prefs
@@ -0,0 +1,4 @@
+activeProfiles=
+eclipse.preferences.version=1
+resolveWorkspaceProjects=true
+version=1
diff --git a/org.eclipse.osbp.ecview.extension.widgetset/.settings/org.eclipse.xtend.core.Xtend.prefs b/org.eclipse.osbp.ecview.extension.widgetset/.settings/org.eclipse.xtend.core.Xtend.prefs
new file mode 100644
index 0000000..19e3115
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.widgetset/.settings/org.eclipse.xtend.core.Xtend.prefs
@@ -0,0 +1,11 @@
+//outlet.DEFAULT_OUTPUT.sourceFolder.src/test/java.directory=src/test/generated-sources/xtend
+BuilderConfiguration.is_project_specific=true
+eclipse.preferences.version=1
+is_project_specific=true
+outlet.DEFAULT_OUTPUT.hideLocalSyntheticVariables=true
+outlet.DEFAULT_OUTPUT.installDslAsPrimarySource=false
+outlet.DEFAULT_OUTPUT.sourceFolder.emf-gen.directory=xtend-gen
+outlet.DEFAULT_OUTPUT.sourceFolder.src-gen.directory=xtend-gen
+outlet.DEFAULT_OUTPUT.sourceFolder.src.directory=xtend-gen
+outlet.DEFAULT_OUTPUT.sourceFolder.xtend-gen.directory=xtend-gen
+outlet.DEFAULT_OUTPUT.userOutputPerSourceFolder=true
diff --git a/org.eclipse.osbp.ecview.extension.widgetset/META-INF/MANIFEST.MF b/org.eclipse.osbp.ecview.extension.widgetset/META-INF/MANIFEST.MF
index 8eb1f47..d18b9e8 100644
--- a/org.eclipse.osbp.ecview.extension.widgetset/META-INF/MANIFEST.MF
+++ b/org.eclipse.osbp.ecview.extension.widgetset/META-INF/MANIFEST.MF
@@ -6,14 +6,14 @@
Bundle-RequiredExecutionEnvironment: JavaSE-1.7
Bundle-ActivationPolicy: lazy
Bundle-Vendor: Eclipse OSBP
-Require-Bundle: com.vaadin.client;bundle-version="[7.5.7,7.7.0)",
- com.vaadin.server;bundle-version="[7.5.7,7.7.0)",
- com.vaadin.shared;bundle-version="[7.5.7,7.7.0)",
+Require-Bundle: com.vaadin.client;bundle-version="[7.7.6,7.8.0)",
+ com.vaadin.server;bundle-version="[7.7.6,7.8.0)",
+ com.vaadin.shared;bundle-version="[7.7.6,7.8.0)",
com.google.guava;bundle-version="[10.0.0,19.0.0)",
- org.eclipse.core.databinding;bundle-version="[1.4.1,1.5.0)",
- org.eclipse.core.databinding.beans;bundle-version="[1.2.200,1.5.0)",
- org.eclipse.core.databinding.observable;bundle-version="[1.4.1,1.5.0)",
- org.eclipse.core.databinding.property;bundle-version="[1.4.200,1.5.0)",
+ org.eclipse.core.databinding;bundle-version="[1.6.0,1.7.0)",
+ org.eclipse.core.databinding.beans;bundle-version="[1.3.100,1.4.0)",
+ org.eclipse.core.databinding.observable;bundle-version="[1.6.0,1.7.0)",
+ org.eclipse.core.databinding.property;bundle-version="[1.6.0,1.7.0)",
org.eclipse.osbp.runtime.common;bundle-version="[0.9.0,0.10.0)",
org.eclipse.osbp.runtime.web.vaadin.common;bundle-version="[0.9.0,0.10.0)",
org.eclipse.osbp.runtime.web.vaadin.databinding;bundle-version="[0.9.0,0.10.0)",
diff --git a/org.eclipse.osbp.ecview.extension.widgetset/pom-compileWidgetset.xml b/org.eclipse.osbp.ecview.extension.widgetset/pom-compileWidgetset.xml
index 735da78..75be71c 100644
--- a/org.eclipse.osbp.ecview.extension.widgetset/pom-compileWidgetset.xml
+++ b/org.eclipse.osbp.ecview.extension.widgetset/pom-compileWidgetset.xml
@@ -10,8 +10,6 @@
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<osbp.runtimeweb.version>0.9.1-SNAPSHOT</osbp.runtimeweb.version>
<osbee.version>0.1.0-SNAPSHOT</osbee.version>
- <vaadin.version>7.5.7</vaadin.version>
- <vaadin.plugin.version>7.5.7</vaadin.plugin.version>
</properties>
<repositories>
@@ -118,7 +116,7 @@
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-maven-plugin</artifactId>
- <version>0.21.0</version>
+ <version>0.26.0</version>
<extensions>true</extensions>
</plugin>
<plugin>