Skip to main content
aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorStéphane Bégaudeau2015-12-04 08:57:15 +0000
committerStéphane Bégaudeau2015-12-04 16:29:26 +0000
commit0a19cc90d5975c77ef73055ab4884c4d7144055a (patch)
tree03bef3cf5ec62b130daf62f90d4a82924969992e /tests
parent18bad80596e86e825aee7b6831710ece8adfce60 (diff)
downloadorg.eclipse.eef-0a19cc90d5975c77ef73055ab4884c4d7144055a.tar.gz
org.eclipse.eef-0a19cc90d5975c77ef73055ab4884c4d7144055a.tar.xz
org.eclipse.eef-0a19cc90d5975c77ef73055ab4884c4d7144055a.zip
Improve the design of the Properties view with Eclipse Form
1) Improve the design of the view by using Eclipse Forms' sections 2) Fix an issue where the text field would trigger the update consumer for all characters typed by the user Change-Id: I70ddc5abf991b60f85148b85b0e9cc798fde0b49 Signed-off-by: Stéphane Bégaudeau <stephane.begaudeau@obeo.fr>
Diffstat (limited to 'tests')
-rw-r--r--tests/org.eclipse.eef.tests/src/org/eclipse/eef/tests/internal/controllers/EEFTextControllerTests.java27
1 files changed, 26 insertions, 1 deletions
diff --git a/tests/org.eclipse.eef.tests/src/org/eclipse/eef/tests/internal/controllers/EEFTextControllerTests.java b/tests/org.eclipse.eef.tests/src/org/eclipse/eef/tests/internal/controllers/EEFTextControllerTests.java
index d47e739b7..a46cbe89c 100644
--- a/tests/org.eclipse.eef.tests/src/org/eclipse/eef/tests/internal/controllers/EEFTextControllerTests.java
+++ b/tests/org.eclipse.eef.tests/src/org/eclipse/eef/tests/internal/controllers/EEFTextControllerTests.java
@@ -14,11 +14,17 @@ import java.util.Map;
import org.eclipse.eef.EEFTextDescription;
import org.eclipse.eef.EefFactory;
+import org.eclipse.eef.core.api.EEFExpressionUtils;
import org.eclipse.eef.core.api.EEFVariableManagerFactory;
import org.eclipse.eef.core.api.IVariableManager;
import org.eclipse.eef.core.api.controllers.EEFTextController;
import org.eclipse.eef.core.internal.controllers.EEFTextControllerImpl;
import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EcoreFactory;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
import org.eclipse.emf.edit.provider.ComposedAdapterFactory;
import org.eclipse.emf.transaction.impl.TransactionalEditingDomainImpl;
import org.eclipse.sirius.common.interpreter.api.IInterpreter;
@@ -50,10 +56,16 @@ public class EEFTextControllerTests {
*/
private IVariableManager variableManager;
+ /**
+ * The resource set.
+ */
+ private ResourceSetImpl resourceSet;
+
@Before
public void setUp() {
AdapterFactory adapterFactory = new ComposedAdapterFactory(ComposedAdapterFactory.Descriptor.Registry.INSTANCE);
- this.editingDomain = new TransactionalEditingDomainImpl(adapterFactory);
+ this.resourceSet = new ResourceSetImpl();
+ this.editingDomain = new TransactionalEditingDomainImpl(adapterFactory, this.resourceSet);
this.variableManager = new EEFVariableManagerFactory().createVariableManager();
this.description = EefFactory.eINSTANCE.createEEFTextDescription();
@@ -80,6 +92,19 @@ public class EEFTextControllerTests {
}
@Test
+ public void testUpdateValueWithEObject() {
+ String name = "TestEClass"; //$NON-NLS-1$
+
+ EClass eClass = EcoreFactory.eINSTANCE.createEClass();
+ eClass.setName(name);
+
+ Resource resource = this.resourceSet.createResource(URI.createURI("test.ecore")); //$NON-NLS-1$
+ resource.getContents().add(eClass);
+
+ this.variableManager.getVariables().put(EEFExpressionUtils.SELF, eClass);
+ }
+
+ @Test
public void testUpdateLabel() {
final String newLabel = "Label"; //$NON-NLS-1$

Back to the top