Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPierre-Charles David2016-04-18 08:49:33 -0400
committerPierre-Charles David2016-04-19 08:27:03 -0400
commitc67128ae4e8a3055ed3da96044a82aa44a7fdc56 (patch)
tree6d68a3a860ec4cda90a60a3ef4bbf85037d676c1
parent7e4d64ec215c0b13fcc0cea3ef91c21181d60d51 (diff)
downloadorg.eclipse.eef-c67128ae4e8a3055ed3da96044a82aa44a7fdc56.tar.gz
org.eclipse.eef-c67128ae4e8a3055ed3da96044a82aa44a7fdc56.tar.xz
org.eclipse.eef-c67128ae4e8a3055ed3da96044a82aa44a7fdc56.zip
Remove dependency to EMF Transaction
Introduce EditingContextAdapter interface to allow client code to provide the appropriate hooks for EEF to: 1. execute model-changing operations in an appropriate context; 2. detect when the model being displayed by EEF has been modified so that we can refresh our views. Bug: 490594 Change-Id: I3c3ffd62773107ddc59024e173c918d0eb6c53a4 Signed-off-by: Pierre-Charles David <pierre-charles.david@obeo.fr>
-rw-r--r--plugins/org.eclipse.eef.core/META-INF/MANIFEST.MF4
-rw-r--r--plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/api/EEFGroup.java8
-rw-r--r--plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/api/EEFView.java8
-rw-r--r--plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/api/EEFViewFactory.java17
-rw-r--r--plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/api/EditingContextAdapter.java49
-rw-r--r--plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/api/controllers/AbstractEEFCustomWidgetController.java23
-rw-r--r--plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/api/controllers/EEFControllersFactory.java42
-rw-r--r--plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/internal/EEFGroupImpl.java21
-rw-r--r--plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/internal/EEFPageImpl.java18
-rw-r--r--plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/internal/EEFViewImpl.java38
-rw-r--r--plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/internal/controllers/EEFButtonController.java23
-rw-r--r--plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/internal/controllers/EEFCheckboxController.java31
-rw-r--r--plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/internal/controllers/EEFRadioController.java31
-rw-r--r--plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/internal/controllers/EEFSelectController.java31
-rw-r--r--plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/internal/controllers/EEFTextController.java52
-rw-r--r--plugins/org.eclipse.eef.ide.ui/src/org/eclipse/eef/ide/ui/api/IEEFLifecycleManagerProvider.java8
-rw-r--r--plugins/org.eclipse.eef.ide.ui/src/org/eclipse/eef/ide/ui/api/widgets/AbstractEEFWidgetLifecycleManager.java14
-rw-r--r--plugins/org.eclipse.eef.ide.ui/src/org/eclipse/eef/ide/ui/internal/EEFIdeUiPlugin.java12
-rw-r--r--plugins/org.eclipse.eef.ide.ui/src/org/eclipse/eef/ide/ui/internal/Updater.java45
-rw-r--r--plugins/org.eclipse.eef.ide.ui/src/org/eclipse/eef/ide/ui/internal/widgets/EEFButtonLifecycleManager.java13
-rw-r--r--plugins/org.eclipse.eef.ide.ui/src/org/eclipse/eef/ide/ui/internal/widgets/EEFCheckboxLifecycleManager.java13
-rw-r--r--plugins/org.eclipse.eef.ide.ui/src/org/eclipse/eef/ide/ui/internal/widgets/EEFContainerLifecycleManager.java29
-rw-r--r--plugins/org.eclipse.eef.ide.ui/src/org/eclipse/eef/ide/ui/internal/widgets/EEFGroupLifecycleManager.java16
-rw-r--r--plugins/org.eclipse.eef.ide.ui/src/org/eclipse/eef/ide/ui/internal/widgets/EEFLabelLifecycleManager.java10
-rw-r--r--plugins/org.eclipse.eef.ide.ui/src/org/eclipse/eef/ide/ui/internal/widgets/EEFRadioLifecycleManager.java13
-rw-r--r--plugins/org.eclipse.eef.ide.ui/src/org/eclipse/eef/ide/ui/internal/widgets/EEFSectionLifecycleManager.java4
-rw-r--r--plugins/org.eclipse.eef.ide.ui/src/org/eclipse/eef/ide/ui/internal/widgets/EEFSelectLifecycleManager.java13
-rw-r--r--plugins/org.eclipse.eef.ide.ui/src/org/eclipse/eef/ide/ui/internal/widgets/EEFTextLifecycleManager.java13
-rw-r--r--samples/org.eclipse.eef.sample.custom.widget.colorpicker/src/org/eclipse/eef/sample/custom/widget/colorpicker/ColorPickerController.java34
-rw-r--r--samples/org.eclipse.eef.sample.custom.widget.colorpicker/src/org/eclipse/eef/sample/custom/widget/colorpicker/ColorPickerLifecycleManager.java12
-rw-r--r--samples/org.eclipse.eef.sample.custom.widget.colorpicker/src/org/eclipse/eef/sample/custom/widget/colorpicker/ColorPickerProvider.java7
-rw-r--r--tests/org.eclipse.eef.tests/src/org/eclipse/eef/tests/internal/controllers/AbstractEEFControllerTests.java15
-rw-r--r--tests/org.eclipse.eef.tests/src/org/eclipse/eef/tests/internal/controllers/EEFButtonControllerTests.java6
-rw-r--r--tests/org.eclipse.eef.tests/src/org/eclipse/eef/tests/internal/controllers/EEFCheckboxControllerTests.java2
-rw-r--r--tests/org.eclipse.eef.tests/src/org/eclipse/eef/tests/internal/controllers/EEFRadioControllerTests.java2
-rw-r--r--tests/org.eclipse.eef.tests/src/org/eclipse/eef/tests/internal/controllers/EEFSelectControllerTests.java2
-rw-r--r--tests/org.eclipse.eef.tests/src/org/eclipse/eef/tests/internal/controllers/EEFTextControllerTests.java2
37 files changed, 296 insertions, 385 deletions
diff --git a/plugins/org.eclipse.eef.core/META-INF/MANIFEST.MF b/plugins/org.eclipse.eef.core/META-INF/MANIFEST.MF
index 6e4f57b66..2fd5812eb 100644
--- a/plugins/org.eclipse.eef.core/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.eef.core/META-INF/MANIFEST.MF
@@ -5,8 +5,8 @@ Bundle-SymbolicName: org.eclipse.eef.core;singleton:=true
Bundle-Version: 1.6.0.qualifier
Bundle-Vendor: %providerName
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
-Require-Bundle: org.eclipse.emf.ecore;bundle-version="[2.8.0,3.0.0)",
- org.eclipse.emf.transaction;bundle-version="[1.4.0,2.0.0)",
+Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.0.0,4.0.0)",
+ org.eclipse.emf.ecore;bundle-version="[2.8.0,3.0.0)",
org.eclipse.eef.common;bundle-version="[1.6.0,2.0.0)"
Import-Package: com.google.common.base;version="[15.0.0,16.0.0)",
com.google.common.collect;version="[15.0.0,16.0.0)",
diff --git a/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/api/EEFGroup.java b/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/api/EEFGroup.java
index 624a8d3c3..cee2a8f9d 100644
--- a/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/api/EEFGroup.java
+++ b/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/api/EEFGroup.java
@@ -11,7 +11,6 @@
package org.eclipse.eef.core.api;
import org.eclipse.eef.EEFGroupDescription;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
import org.eclipse.sirius.common.interpreter.api.IInterpreter;
import org.eclipse.sirius.common.interpreter.api.IVariableManager;
@@ -48,11 +47,4 @@ public interface EEFGroup extends EEFContainerParent {
* @return The interpreter
*/
IInterpreter getInterpreter();
-
- /**
- * Returns the editing domain.
- *
- * @return The editing domain
- */
- TransactionalEditingDomain getEditingDomain();
}
diff --git a/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/api/EEFView.java b/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/api/EEFView.java
index b1325093b..c8a4d5134 100644
--- a/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/api/EEFView.java
+++ b/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/api/EEFView.java
@@ -13,7 +13,6 @@ package org.eclipse.eef.core.api;
import java.util.List;
import org.eclipse.eef.EEFViewDescription;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
import org.eclipse.sirius.common.interpreter.api.IInterpreter;
import org.eclipse.sirius.common.interpreter.api.IVariableManager;
@@ -66,10 +65,9 @@ public interface EEFView {
IInterpreter getInterpreter();
/**
- * Returns the {@link TransactionalEditingDomain} through which the current input is being edited. May be
- * <code>null</code>.
+ * Returns the editing context adapter.
*
- * @return the {@link TransactionalEditingDomain}.
+ * @return the context adapter.
*/
- TransactionalEditingDomain getEditingDomain();
+ EditingContextAdapter getContextAdapter();
}
diff --git a/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/api/EEFViewFactory.java b/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/api/EEFViewFactory.java
index d763de01e..1877c8baf 100644
--- a/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/api/EEFViewFactory.java
+++ b/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/api/EEFViewFactory.java
@@ -12,7 +12,6 @@ package org.eclipse.eef.core.api;
import org.eclipse.eef.EEFViewDescription;
import org.eclipse.eef.core.internal.EEFViewImpl;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
import org.eclipse.sirius.common.interpreter.api.IInterpreter;
import org.eclipse.sirius.common.interpreter.api.IVariableManager;
@@ -31,15 +30,15 @@ public class EEFViewFactory {
* The variable manager
* @param interpreter
* The {@link IInterpreter} to use for dynamic expressions
- * @param editingDomain
- * The editing domain
+ * @param contextAdapter
+ * the editing context adapter.
* @param input
* The input
* @return The {@link EEFView} fully initialized
*/
public EEFView createEEFView(EEFViewDescription eefViewDescription, IVariableManager variableManager, IInterpreter interpreter,
- TransactionalEditingDomain editingDomain, InputDescriptor input) {
- return this.createEEFView(eefViewDescription, variableManager, interpreter, editingDomain, new EEFDomainClassTester(), input);
+ EditingContextAdapter contextAdapter, InputDescriptor input) {
+ return this.createEEFView(eefViewDescription, variableManager, interpreter, contextAdapter, new EEFDomainClassTester(), input);
}
/**
@@ -51,8 +50,8 @@ public class EEFViewFactory {
* The variable manager
* @param interpreter
* The {@link IInterpreter} to use for dynamic expressions
- * @param editingDomain
- * The editing domain
+ * @param contextAdapter
+ * the editing context adapter.
* @param domainClassTester
* The domain class tester
* @param input
@@ -60,8 +59,8 @@ public class EEFViewFactory {
* @return The {@link EEFView} fully initialized
*/
public EEFView createEEFView(EEFViewDescription eefViewDescription, IVariableManager variableManager, IInterpreter interpreter,
- TransactionalEditingDomain editingDomain, EEFDomainClassTester domainClassTester, InputDescriptor input) {
- EEFView eefView = new EEFViewImpl(eefViewDescription, variableManager, interpreter, editingDomain, domainClassTester);
+ EditingContextAdapter contextAdapter, EEFDomainClassTester domainClassTester, InputDescriptor input) {
+ EEFView eefView = new EEFViewImpl(eefViewDescription, variableManager, interpreter, contextAdapter, domainClassTester);
eefView.setInput(input);
eefView.initialize();
return eefView;
diff --git a/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/api/EditingContextAdapter.java b/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/api/EditingContextAdapter.java
new file mode 100644
index 000000000..dcf986225
--- /dev/null
+++ b/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/api/EditingContextAdapter.java
@@ -0,0 +1,49 @@
+/*******************************************************************************
+ * Copyright (c) 2016 Obeo.
+ * 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:
+ * Obeo - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.eef.core.api;
+
+import java.util.List;
+
+import org.eclipse.eef.core.api.controllers.IConsumer;
+import org.eclipse.emf.common.notify.Notification;
+
+/**
+ * Connects EEF views with the external context (e.g. an editor) on behalf of which the views display and edit model
+ * elements. Clients which use the EEF runtime must supply an implementation of this interface so that the EEF views can
+ * be correctly integrated into the source context.
+ *
+ * @author pcdavid
+ */
+public interface EditingContextAdapter {
+
+ /**
+ * Executes an operation which which potentially makes changes to the model.
+ *
+ * @param operation
+ * the operation.
+ */
+ void performModelChange(Runnable operation);
+
+ /**
+ * Registers a listener to notify when the model is modified. The trigger will be called in a context in which it
+ * may not be possible to perform additional changes to the model itself. The list of changes supplied to the
+ * listener should be considered only as a hint and may be <code>null</code>.
+ *
+ * @param trigger
+ * the trigger to invoke when the model is modified.
+ */
+ void onModelChange(IConsumer<List<Notification>> trigger);
+
+ /**
+ * Unregisters the currently set listener. Does nothing if none is currently registered.
+ */
+ void removeModelChangeConsumer();
+}
diff --git a/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/api/controllers/AbstractEEFCustomWidgetController.java b/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/api/controllers/AbstractEEFCustomWidgetController.java
index 61ad11a08..9b369d8d7 100644
--- a/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/api/controllers/AbstractEEFCustomWidgetController.java
+++ b/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/api/controllers/AbstractEEFCustomWidgetController.java
@@ -13,10 +13,8 @@ package org.eclipse.eef.core.api.controllers;
import org.eclipse.eef.EEFCustomExpression;
import org.eclipse.eef.EEFCustomWidgetDescription;
import org.eclipse.eef.EefPackage;
-import org.eclipse.emf.common.command.Command;
+import org.eclipse.eef.core.api.EditingContextAdapter;
import org.eclipse.emf.ecore.EAttribute;
-import org.eclipse.emf.transaction.RecordingCommand;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
import org.eclipse.sirius.common.interpreter.api.IInterpreter;
import org.eclipse.sirius.common.interpreter.api.IVariableManager;
@@ -32,9 +30,9 @@ public abstract class AbstractEEFCustomWidgetController extends AbstractEEFWidge
protected EEFCustomWidgetDescription description;
/**
- * The editing domain.
+ * The editing context adapter.
*/
- protected TransactionalEditingDomain editingDomain;
+ protected EditingContextAdapter contextAdapter;
/**
* The constructor.
@@ -45,14 +43,14 @@ public abstract class AbstractEEFCustomWidgetController extends AbstractEEFWidge
* The variable manager
* @param interpreter
* The interpreter
- * @param editingDomain
- * The editing domain
+ * @param contextAdapter
+ * The editing context adapter.
*/
public AbstractEEFCustomWidgetController(EEFCustomWidgetDescription description, IVariableManager variableManager, IInterpreter interpreter,
- TransactionalEditingDomain editingDomain) {
+ EditingContextAdapter contextAdapter) {
super(variableManager, interpreter);
this.description = description;
- this.editingDomain = editingDomain;
+ this.contextAdapter = contextAdapter;
}
/**
@@ -90,15 +88,14 @@ public abstract class AbstractEEFCustomWidgetController extends AbstractEEFWidge
* Identifier of the custom expression to execute
*/
protected void executeCommandExpression(final String customExpressionId) {
- final Command command = new RecordingCommand(this.editingDomain) {
+ contextAdapter.performModelChange(new Runnable() {
@Override
- protected void doExecute() {
+ public void run() {
String pushExpression = getCustomExpression(customExpressionId);
EAttribute attr = EefPackage.Literals.EEF_CUSTOM_EXPRESSION__CUSTOM_EXPRESSION;
AbstractEEFCustomWidgetController.this.newEval().call(attr, pushExpression);
}
- };
- this.editingDomain.getCommandStack().execute(command);
+ });
}
}
diff --git a/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/api/controllers/EEFControllersFactory.java b/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/api/controllers/EEFControllersFactory.java
index 1ddfe7026..b00ddf52b 100644
--- a/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/api/controllers/EEFControllersFactory.java
+++ b/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/api/controllers/EEFControllersFactory.java
@@ -18,6 +18,7 @@ import org.eclipse.eef.EEFPageDescription;
import org.eclipse.eef.EEFRadioDescription;
import org.eclipse.eef.EEFSelectDescription;
import org.eclipse.eef.EEFTextDescription;
+import org.eclipse.eef.core.api.EditingContextAdapter;
import org.eclipse.eef.core.internal.controllers.EEFButtonController;
import org.eclipse.eef.core.internal.controllers.EEFCheckboxController;
import org.eclipse.eef.core.internal.controllers.EEFGroupController;
@@ -26,7 +27,6 @@ import org.eclipse.eef.core.internal.controllers.EEFRadioController;
import org.eclipse.eef.core.internal.controllers.EEFSectionController;
import org.eclipse.eef.core.internal.controllers.EEFSelectController;
import org.eclipse.eef.core.internal.controllers.EEFTextController;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
import org.eclipse.sirius.common.interpreter.api.IInterpreter;
import org.eclipse.sirius.common.interpreter.api.IVariableManager;
@@ -61,13 +61,13 @@ public class EEFControllersFactory {
* The variable manager
* @param interpreter
* The interpreter
- * @param editingDomain
- * The editing domain
+ * @param contextAdapter
+ * The editing context adapter
* @return A text controller
*/
public IEEFTextController createTextController(EEFTextDescription description, IVariableManager variableManager, IInterpreter interpreter,
- TransactionalEditingDomain editingDomain) {
- return new EEFTextController(description, variableManager, interpreter, editingDomain);
+ EditingContextAdapter contextAdapter) {
+ return new EEFTextController(description, variableManager, interpreter, contextAdapter);
}
/**
@@ -94,13 +94,13 @@ public class EEFControllersFactory {
* The variable manager
* @param interpreter
* The interpreter
- * @param editingDomain
- * The editing domain
+ * @param contextAdapter
+ * The editing context adapter
* @return A button controller
*/
public IEEFButtonController createButtonController(EEFButtonDescription description, IVariableManager variableManager, IInterpreter interpreter,
- TransactionalEditingDomain editingDomain) {
- return new EEFButtonController(description, variableManager, interpreter, editingDomain);
+ EditingContextAdapter contextAdapter) {
+ return new EEFButtonController(description, variableManager, interpreter, contextAdapter);
}
/**
@@ -112,13 +112,13 @@ public class EEFControllersFactory {
* The variable manager
* @param interpreter
* The interpreter
- * @param editingDomain
- * The editing domain
+ * @param contextAdapter
+ * The editing context adapter
* @return A label controller
*/
public IEEFSelectController createSelectController(EEFSelectDescription description, IVariableManager variableManager, IInterpreter interpreter,
- TransactionalEditingDomain editingDomain) {
- return new EEFSelectController(description, variableManager, interpreter, editingDomain);
+ EditingContextAdapter contextAdapter) {
+ return new EEFSelectController(description, variableManager, interpreter, contextAdapter);
}
/**
@@ -130,13 +130,13 @@ public class EEFControllersFactory {
* The variable manager
* @param interpreter
* The interpreter
- * @param editingDomain
- * The editing domain
+ * @param contextAdapter
+ * The editing context adapter
* @return A checkbox controller
*/
public IEEFCheckboxController createCheckboxController(EEFCheckboxDescription description, IVariableManager variableManager,
- IInterpreter interpreter, TransactionalEditingDomain editingDomain) {
- return new EEFCheckboxController(description, variableManager, interpreter, editingDomain);
+ IInterpreter interpreter, EditingContextAdapter contextAdapter) {
+ return new EEFCheckboxController(description, variableManager, interpreter, contextAdapter);
}
@@ -149,13 +149,13 @@ public class EEFControllersFactory {
* The variable manager
* @param interpreter
* The interpreter
- * @param editingDomain
- * The editing domain
+ * @param contextAdapter
+ * The editing context adapter
* @return A radio controller
*/
public IEEFRadioController createRadioController(EEFRadioDescription description, IVariableManager variableManager, IInterpreter interpreter,
- TransactionalEditingDomain editingDomain) {
- return new EEFRadioController(description, variableManager, interpreter, editingDomain);
+ EditingContextAdapter contextAdapter) {
+ return new EEFRadioController(description, variableManager, interpreter, contextAdapter);
}
/**
diff --git a/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/internal/EEFGroupImpl.java b/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/internal/EEFGroupImpl.java
index 8aa00eafe..da1d6cc29 100644
--- a/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/internal/EEFGroupImpl.java
+++ b/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/internal/EEFGroupImpl.java
@@ -13,7 +13,6 @@ package org.eclipse.eef.core.internal;
import org.eclipse.eef.EEFGroupDescription;
import org.eclipse.eef.core.api.EEFGroup;
import org.eclipse.eef.core.api.EEFPage;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
import org.eclipse.sirius.common.interpreter.api.IInterpreter;
import org.eclipse.sirius.common.interpreter.api.IVariableManager;
@@ -44,11 +43,6 @@ public class EEFGroupImpl implements EEFGroup {
private EEFPage eefPage;
/**
- * The editing domain.
- */
- private TransactionalEditingDomain editingDomain;
-
- /**
* The constructor.
*
* @param eefPage
@@ -59,16 +53,12 @@ public class EEFGroupImpl implements EEFGroup {
* The variable manager.
* @param interpreter
* The interpreter
- * @param editingDomain
- * The editing domain
*/
- public EEFGroupImpl(EEFPage eefPage, EEFGroupDescription eefGroupDescription, IVariableManager variableManager, IInterpreter interpreter,
- TransactionalEditingDomain editingDomain) {
+ public EEFGroupImpl(EEFPage eefPage, EEFGroupDescription eefGroupDescription, IVariableManager variableManager, IInterpreter interpreter) {
this.variableManager = variableManager;
this.interpreter = interpreter;
this.eefPage = eefPage;
this.eefGroupDescription = eefGroupDescription;
- this.editingDomain = editingDomain;
}
/**
@@ -106,13 +96,4 @@ public class EEFGroupImpl implements EEFGroup {
return this.interpreter;
}
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.eef.core.api.EEFGroup#getEditingDomain()
- */
- @Override
- public TransactionalEditingDomain getEditingDomain() {
- return this.editingDomain;
- }
}
diff --git a/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/internal/EEFPageImpl.java b/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/internal/EEFPageImpl.java
index bcf3d34d3..947e8d603 100644
--- a/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/internal/EEFPageImpl.java
+++ b/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/internal/EEFPageImpl.java
@@ -26,7 +26,6 @@ import org.eclipse.eef.core.api.EEFView;
import org.eclipse.eef.core.api.controllers.IConsumer;
import org.eclipse.eef.core.api.utils.Eval;
import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
import org.eclipse.sirius.common.interpreter.api.IInterpreter;
import org.eclipse.sirius.common.interpreter.api.IVariableManager;
@@ -62,11 +61,6 @@ public class EEFPageImpl implements EEFPage {
private List<EEFGroup> eefGroups = new ArrayList<EEFGroup>();
/**
- * The editing domain.
- */
- private TransactionalEditingDomain editingDomain;
-
- /**
* The domain class tester.
*/
private EEFDomainClassTester domainClassTester;
@@ -87,20 +81,17 @@ public class EEFPageImpl implements EEFPage {
* The variable manager
* @param interpreter
* The interpreter
- * @param editingDomain
- * The editing domain
* @param domainClassTester
* The domain class tester
* @param isUnique
* Indicates if the description from this page has been instantiated multiple times
*/
public EEFPageImpl(EEFView eefView, EEFPageDescription eefPageDescription, IVariableManager variableManager, IInterpreter interpreter,
- TransactionalEditingDomain editingDomain, EEFDomainClassTester domainClassTester, boolean isUnique) {
+ EEFDomainClassTester domainClassTester, boolean isUnique) {
this.variableManager = variableManager;
this.interpreter = interpreter;
this.eefView = eefView;
this.eefPageDescription = eefPageDescription;
- this.editingDomain = editingDomain;
this.domainClassTester = domainClassTester;
this.isUnique = isUnique;
}
@@ -120,15 +111,14 @@ public class EEFPageImpl implements EEFPage {
new Eval(this.interpreter, this.variableManager).call(semanticCandidatesExpression, new IConsumer<Object>() {
@Override
public void apply(Object value) {
- DomainClassPredicate domainClassPredicate = new DomainClassPredicate(eefGroupDescription.getDomainClass(), eefView
- .getDescription().getEPackages(), domainClassTester);
+ DomainClassPredicate domainClassPredicate = new DomainClassPredicate(eefGroupDescription.getDomainClass(),
+ eefView.getDescription().getEPackages(), domainClassTester);
Iterable<EObject> iterable = Util.asIterable(value, EObject.class);
Iterable<EObject> eObjects = Iterables.filter(iterable, domainClassPredicate);
for (EObject eObject : eObjects) {
IVariableManager childVariableManager = EEFPageImpl.this.getVariableManager().createChild();
childVariableManager.put(EEFExpressionUtils.SELF, eObject);
- EEFGroupImpl eefGroupImpl = new EEFGroupImpl(EEFPageImpl.this, eefGroupDescription, childVariableManager, interpreter,
- editingDomain);
+ EEFGroupImpl eefGroupImpl = new EEFGroupImpl(EEFPageImpl.this, eefGroupDescription, childVariableManager, interpreter);
eefGroups.add(eefGroupImpl);
}
}
diff --git a/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/internal/EEFViewImpl.java b/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/internal/EEFViewImpl.java
index 6af4f888e..bddc23195 100644
--- a/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/internal/EEFViewImpl.java
+++ b/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/internal/EEFViewImpl.java
@@ -24,11 +24,11 @@ import org.eclipse.eef.core.api.EEFExpressionUtils;
import org.eclipse.eef.core.api.EEFGroup;
import org.eclipse.eef.core.api.EEFPage;
import org.eclipse.eef.core.api.EEFView;
+import org.eclipse.eef.core.api.EditingContextAdapter;
import org.eclipse.eef.core.api.InputDescriptor;
import org.eclipse.eef.core.api.controllers.IConsumer;
import org.eclipse.eef.core.api.utils.Eval;
import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
import org.eclipse.sirius.common.interpreter.api.IInterpreter;
import org.eclipse.sirius.common.interpreter.api.IVariableManager;
@@ -54,9 +54,9 @@ public class EEFViewImpl implements EEFView {
private EEFViewDescription eefViewDescription;
/**
- * The editing domain.
+ * The editing context adapter.
*/
- private TransactionalEditingDomain editingDomain;
+ private EditingContextAdapter contextAdapter;
/**
* The {@link EEFPage} of the view.
@@ -77,17 +77,17 @@ public class EEFViewImpl implements EEFView {
* The variable manager
* @param interpreter
* The interpreter
- * @param editingDomain
- * The editing domain
+ * @param contextAdapter
+ * The editing context adapter.
* @param domainClassTester
* The domain class tester
*/
public EEFViewImpl(EEFViewDescription eefViewDescription, IVariableManager variableManager, IInterpreter interpreter,
- TransactionalEditingDomain editingDomain, EEFDomainClassTester domainClassTester) {
+ EditingContextAdapter contextAdapter, EEFDomainClassTester domainClassTester) {
this.variableManager = variableManager;
this.interpreter = interpreter;
this.eefViewDescription = eefViewDescription;
- this.editingDomain = editingDomain;
+ this.contextAdapter = contextAdapter;
this.domainClassTester = domainClassTester;
}
@@ -109,8 +109,8 @@ public class EEFViewImpl implements EEFView {
new Eval(this.interpreter, this.variableManager).call(semanticCandidatesExpression, new IConsumer<Object>() {
@Override
public void apply(Object value) {
- DomainClassPredicate domainClassPredicate = new DomainClassPredicate(eefPageDescription.getDomainClass(), eefViewDescription
- .getEPackages(), domainClassTester);
+ DomainClassPredicate domainClassPredicate = new DomainClassPredicate(eefPageDescription.getDomainClass(),
+ eefViewDescription.getEPackages(), domainClassTester);
Iterable<EObject> iterable = Util.asIterable(value, EObject.class);
Iterable<EObject> eObjects = Iterables.filter(iterable, domainClassPredicate);
@@ -150,7 +150,7 @@ public class EEFViewImpl implements EEFView {
if (semanticCandidate != null) {
childVariableManager.put(EEFExpressionUtils.SELF, semanticCandidate);
}
- return new EEFPageImpl(this, description, childVariableManager, this.interpreter, this.editingDomain, this.domainClassTester, isUnique);
+ return new EEFPageImpl(this, description, childVariableManager, this.interpreter, this.domainClassTester, isUnique);
}
/**
@@ -236,31 +236,31 @@ public class EEFViewImpl implements EEFView {
/**
* {@inheritDoc}
*
- * @see org.eclipse.eef.core.api.EEFView#getEditingDomain()
+ * @see org.eclipse.eef.core.api.EEFView#getInterpreter()
*/
@Override
- public TransactionalEditingDomain getEditingDomain() {
- return this.editingDomain;
+ public IInterpreter getInterpreter() {
+ return this.interpreter;
}
/**
* {@inheritDoc}
*
- * @see org.eclipse.eef.core.api.EEFView#getInterpreter()
+ * @see org.eclipse.eef.core.api.EEFView#getVariableManager()
*/
@Override
- public IInterpreter getInterpreter() {
- return this.interpreter;
+ public IVariableManager getVariableManager() {
+ return this.variableManager;
}
/**
* {@inheritDoc}
*
- * @see org.eclipse.eef.core.api.EEFView#getVariableManager()
+ * @see org.eclipse.eef.core.api.EEFView#getContextAdapter()
*/
@Override
- public IVariableManager getVariableManager() {
- return this.variableManager;
+ public EditingContextAdapter getContextAdapter() {
+ return this.contextAdapter;
}
}
diff --git a/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/internal/controllers/EEFButtonController.java b/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/internal/controllers/EEFButtonController.java
index f63e577a4..96ce715bd 100644
--- a/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/internal/controllers/EEFButtonController.java
+++ b/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/internal/controllers/EEFButtonController.java
@@ -13,13 +13,11 @@ package org.eclipse.eef.core.internal.controllers;
import org.eclipse.eef.EEFButtonDescription;
import org.eclipse.eef.EEFWidgetDescription;
import org.eclipse.eef.EefPackage;
+import org.eclipse.eef.core.api.EditingContextAdapter;
import org.eclipse.eef.core.api.controllers.AbstractEEFWidgetController;
import org.eclipse.eef.core.api.controllers.IConsumer;
import org.eclipse.eef.core.api.controllers.IEEFButtonController;
-import org.eclipse.emf.common.command.Command;
import org.eclipse.emf.ecore.EAttribute;
-import org.eclipse.emf.transaction.RecordingCommand;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
import org.eclipse.sirius.common.interpreter.api.IInterpreter;
import org.eclipse.sirius.common.interpreter.api.IVariableManager;
@@ -35,9 +33,9 @@ public class EEFButtonController extends AbstractEEFWidgetController implements
private EEFButtonDescription description;
/**
- * The editing domain.
+ * The editing context adapter.
*/
- private TransactionalEditingDomain editingDomain;
+ private EditingContextAdapter contextAdapter;
/**
* The consumer of a new value of the button's label.
@@ -53,14 +51,14 @@ public class EEFButtonController extends AbstractEEFWidgetController implements
* The variable manager
* @param interpreter
* The interpreter
- * @param editingDomain
- * The editing domain
+ * @param contextAdapter
+ * The editing context adapter
*/
public EEFButtonController(EEFButtonDescription description, IVariableManager variableManager, IInterpreter interpreter,
- TransactionalEditingDomain editingDomain) {
+ EditingContextAdapter contextAdapter) {
super(variableManager, interpreter);
this.description = description;
- this.editingDomain = editingDomain;
+ this.contextAdapter = contextAdapter;
}
@Override
@@ -89,14 +87,13 @@ public class EEFButtonController extends AbstractEEFWidgetController implements
@Override
public void pushed() {
- final Command command = new RecordingCommand(this.editingDomain) {
+ contextAdapter.performModelChange(new Runnable() {
@Override
- protected void doExecute() {
+ public void run() {
String pushExpression = EEFButtonController.this.description.getPushExpression();
EAttribute attr = EefPackage.Literals.EEF_BUTTON_DESCRIPTION__PUSH_EXPRESSION;
EEFButtonController.this.newEval().call(attr, pushExpression);
}
- };
- this.editingDomain.getCommandStack().execute(command);
+ });
}
}
diff --git a/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/internal/controllers/EEFCheckboxController.java b/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/internal/controllers/EEFCheckboxController.java
index e9b85bae7..9f3f8d031 100644
--- a/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/internal/controllers/EEFCheckboxController.java
+++ b/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/internal/controllers/EEFCheckboxController.java
@@ -17,15 +17,12 @@ import org.eclipse.eef.EEFCheckboxDescription;
import org.eclipse.eef.EEFWidgetDescription;
import org.eclipse.eef.EefPackage;
import org.eclipse.eef.core.api.EEFExpressionUtils;
+import org.eclipse.eef.core.api.EditingContextAdapter;
import org.eclipse.eef.core.api.controllers.AbstractEEFWidgetController;
import org.eclipse.eef.core.api.controllers.IConsumer;
import org.eclipse.eef.core.api.controllers.IEEFCheckboxController;
import org.eclipse.eef.core.api.utils.Eval;
-import org.eclipse.emf.common.command.Command;
-import org.eclipse.emf.common.command.CommandStack;
import org.eclipse.emf.ecore.EAttribute;
-import org.eclipse.emf.transaction.RecordingCommand;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
import org.eclipse.sirius.common.interpreter.api.IInterpreter;
import org.eclipse.sirius.common.interpreter.api.IVariableManager;
@@ -41,9 +38,9 @@ public class EEFCheckboxController extends AbstractEEFWidgetController implement
private EEFCheckboxDescription description;
/**
- * The editing domain.
+ * The editing context adapter.
*/
- private TransactionalEditingDomain editingDomain;
+ private EditingContextAdapter contextAdapter;
/**
* The consumer of a new value of the checkbox.
@@ -59,21 +56,21 @@ public class EEFCheckboxController extends AbstractEEFWidgetController implement
* The variable manager
* @param interpreter
* The interpreter
- * @param editingDomain
- * The editing domain
+ * @param contextAdapter
+ * The editing context adapter
*/
public EEFCheckboxController(EEFCheckboxDescription description, IVariableManager variableManager, IInterpreter interpreter,
- TransactionalEditingDomain editingDomain) {
+ EditingContextAdapter contextAdapter) {
super(variableManager, interpreter);
this.description = description;
- this.editingDomain = editingDomain;
+ this.contextAdapter = contextAdapter;
}
@Override
public void updateValue(final boolean checkbox) {
- final Command command = new RecordingCommand(this.editingDomain) {
+ contextAdapter.performModelChange(new Runnable() {
@Override
- protected void doExecute() {
+ public void run() {
String editExpression = EEFCheckboxController.this.description.getEditExpression();
EAttribute eAttribute = EefPackage.Literals.EEF_CHECKBOX_DESCRIPTION__EDIT_EXPRESSION;
@@ -83,15 +80,7 @@ public class EEFCheckboxController extends AbstractEEFWidgetController implement
new Eval(EEFCheckboxController.this.interpreter, variables).call(eAttribute, editExpression);
}
-
- @Override
- public boolean canExecute() {
- return true;
- }
- };
-
- CommandStack commandStack = EEFCheckboxController.this.editingDomain.getCommandStack();
- commandStack.execute(command);
+ });
}
/**
diff --git a/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/internal/controllers/EEFRadioController.java b/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/internal/controllers/EEFRadioController.java
index 584bd8bb3..0213f7461 100644
--- a/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/internal/controllers/EEFRadioController.java
+++ b/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/internal/controllers/EEFRadioController.java
@@ -19,15 +19,12 @@ import org.eclipse.eef.EEFRadioDescription;
import org.eclipse.eef.EEFWidgetDescription;
import org.eclipse.eef.EefPackage;
import org.eclipse.eef.core.api.EEFExpressionUtils;
+import org.eclipse.eef.core.api.EditingContextAdapter;
import org.eclipse.eef.core.api.controllers.AbstractEEFWidgetController;
import org.eclipse.eef.core.api.controllers.IConsumer;
import org.eclipse.eef.core.api.controllers.IEEFRadioController;
import org.eclipse.eef.core.api.utils.Eval;
-import org.eclipse.emf.common.command.Command;
-import org.eclipse.emf.common.command.CommandStack;
import org.eclipse.emf.ecore.EAttribute;
-import org.eclipse.emf.transaction.RecordingCommand;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
import org.eclipse.sirius.common.interpreter.api.IInterpreter;
import org.eclipse.sirius.common.interpreter.api.IVariableManager;
@@ -43,9 +40,9 @@ public class EEFRadioController extends AbstractEEFWidgetController implements I
private EEFRadioDescription description;
/**
- * The editing domain.
+ * The editing context adapter.
*/
- private TransactionalEditingDomain editingDomain;
+ private EditingContextAdapter contextAdapter;
/**
* The consumer of a new value of the combo.
@@ -66,21 +63,21 @@ public class EEFRadioController extends AbstractEEFWidgetController implements I
* The variable manager
* @param interpreter
* The interpreter
- * @param editingDomain
- * The editing domain
+ * @param contextAdapter
+ * The editing context adapter
*/
public EEFRadioController(EEFRadioDescription description, IVariableManager variableManager, IInterpreter interpreter,
- TransactionalEditingDomain editingDomain) {
+ EditingContextAdapter contextAdapter) {
super(variableManager, interpreter);
this.description = description;
- this.editingDomain = editingDomain;
+ this.contextAdapter = contextAdapter;
}
@Override
public void updateValue(final Object text) {
- final Command command = new RecordingCommand(this.editingDomain) {
+ contextAdapter.performModelChange(new Runnable() {
@Override
- protected void doExecute() {
+ public void run() {
String editExpression = EEFRadioController.this.description.getEditExpression();
EAttribute eAttribute = EefPackage.Literals.EEF_RADIO_DESCRIPTION__EDIT_EXPRESSION;
@@ -90,15 +87,7 @@ public class EEFRadioController extends AbstractEEFWidgetController implements I
new Eval(EEFRadioController.this.interpreter, variables).call(eAttribute, editExpression);
}
-
- @Override
- public boolean canExecute() {
- return true;
- }
- };
-
- CommandStack commandStack = EEFRadioController.this.editingDomain.getCommandStack();
- commandStack.execute(command);
+ });
}
/**
diff --git a/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/internal/controllers/EEFSelectController.java b/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/internal/controllers/EEFSelectController.java
index f867455e6..a04df3b7d 100644
--- a/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/internal/controllers/EEFSelectController.java
+++ b/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/internal/controllers/EEFSelectController.java
@@ -19,15 +19,12 @@ import org.eclipse.eef.EEFSelectDescription;
import org.eclipse.eef.EEFWidgetDescription;
import org.eclipse.eef.EefPackage;
import org.eclipse.eef.core.api.EEFExpressionUtils;
+import org.eclipse.eef.core.api.EditingContextAdapter;
import org.eclipse.eef.core.api.controllers.AbstractEEFWidgetController;
import org.eclipse.eef.core.api.controllers.IConsumer;
import org.eclipse.eef.core.api.controllers.IEEFSelectController;
import org.eclipse.eef.core.api.utils.Eval;
-import org.eclipse.emf.common.command.Command;
-import org.eclipse.emf.common.command.CommandStack;
import org.eclipse.emf.ecore.EAttribute;
-import org.eclipse.emf.transaction.RecordingCommand;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
import org.eclipse.sirius.common.interpreter.api.IInterpreter;
import org.eclipse.sirius.common.interpreter.api.IVariableManager;
@@ -43,9 +40,9 @@ public class EEFSelectController extends AbstractEEFWidgetController implements
private EEFSelectDescription description;
/**
- * The editing domain.
+ * The editing context adapter.
*/
- private TransactionalEditingDomain editingDomain;
+ private EditingContextAdapter contextAdapter;
/**
* The consumer of a new value of the combo.
@@ -66,21 +63,21 @@ public class EEFSelectController extends AbstractEEFWidgetController implements
* The variable manager
* @param interpreter
* The interpreter
- * @param editingDomain
- * The editing domain
+ * @param contextAdapter
+ * The editing context adapter
*/
public EEFSelectController(EEFSelectDescription description, IVariableManager variableManager, IInterpreter interpreter,
- TransactionalEditingDomain editingDomain) {
+ EditingContextAdapter contextAdapter) {
super(variableManager, interpreter);
this.description = description;
- this.editingDomain = editingDomain;
+ this.contextAdapter = contextAdapter;
}
@Override
public void updateValue(final Object text) {
- final Command command = new RecordingCommand(this.editingDomain) {
+ contextAdapter.performModelChange(new Runnable() {
@Override
- protected void doExecute() {
+ public void run() {
String editExpression = EEFSelectController.this.description.getEditExpression();
EAttribute eAttribute = EefPackage.Literals.EEF_SELECT_DESCRIPTION__EDIT_EXPRESSION;
@@ -90,15 +87,7 @@ public class EEFSelectController extends AbstractEEFWidgetController implements
new Eval(EEFSelectController.this.interpreter, variables).call(eAttribute, editExpression);
}
-
- @Override
- public boolean canExecute() {
- return true;
- }
- };
-
- CommandStack commandStack = EEFSelectController.this.editingDomain.getCommandStack();
- commandStack.execute(command);
+ });
}
/**
diff --git a/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/internal/controllers/EEFTextController.java b/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/internal/controllers/EEFTextController.java
index 801d727b6..9f9268fe7 100644
--- a/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/internal/controllers/EEFTextController.java
+++ b/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/internal/controllers/EEFTextController.java
@@ -21,15 +21,12 @@ import org.eclipse.eef.EEFTextDescription;
import org.eclipse.eef.EEFWidgetDescription;
import org.eclipse.eef.EefPackage;
import org.eclipse.eef.core.api.EEFExpressionUtils;
+import org.eclipse.eef.core.api.EditingContextAdapter;
import org.eclipse.eef.core.api.controllers.AbstractEEFWidgetController;
import org.eclipse.eef.core.api.controllers.IConsumer;
import org.eclipse.eef.core.api.controllers.IEEFTextController;
import org.eclipse.eef.core.api.utils.Eval;
-import org.eclipse.emf.common.command.Command;
-import org.eclipse.emf.common.command.CommandStack;
import org.eclipse.emf.ecore.EAttribute;
-import org.eclipse.emf.transaction.RecordingCommand;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
import org.eclipse.sirius.common.interpreter.api.IInterpreter;
import org.eclipse.sirius.common.interpreter.api.IVariableManager;
@@ -45,9 +42,9 @@ public class EEFTextController extends AbstractEEFWidgetController implements IE
private EEFTextDescription description;
/**
- * The editing domain.
+ * The editing context adapter.
*/
- private TransactionalEditingDomain editingDomain;
+ private EditingContextAdapter contextAdapter;
/**
* The consumer of a new value of the text.
@@ -73,14 +70,13 @@ public class EEFTextController extends AbstractEEFWidgetController implements IE
* The variable manager
* @param interpreter
* The interpreter
- * @param editingDomain
- * The editing domain
+ * @param contextAdapter
+ * The editing context adapter
*/
- public EEFTextController(EEFTextDescription description, IVariableManager variableManager, IInterpreter interpreter,
- TransactionalEditingDomain editingDomain) {
+ public EEFTextController(EEFTextDescription description, IVariableManager variableManager, IInterpreter interpreter, EditingContextAdapter contextAdapter) {
super(variableManager, interpreter);
this.description = description;
- this.editingDomain = editingDomain;
+ this.contextAdapter = contextAdapter;
}
@Override
@@ -89,30 +85,22 @@ public class EEFTextController extends AbstractEEFWidgetController implements IE
this.currentUpdatedValueFuture.cancel(true);
}
- final Command command = new RecordingCommand(this.editingDomain) {
- @Override
- protected void doExecute() {
- String editExpression = EEFTextController.this.description.getEditExpression();
- EAttribute eAttribute = EefPackage.Literals.EEF_TEXT_DESCRIPTION__EDIT_EXPRESSION;
-
- Map<String, Object> variables = new HashMap<String, Object>();
- variables.putAll(EEFTextController.this.variableManager.getVariables());
- variables.put(EEFExpressionUtils.EEFText.NEW_VALUE, text);
-
- new Eval(EEFTextController.this.interpreter, variables).call(eAttribute, editExpression);
- }
-
- @Override
- public boolean canExecute() {
- return true;
- }
- };
-
Runnable runnable = new Runnable() {
@Override
public void run() {
- CommandStack commandStack = EEFTextController.this.editingDomain.getCommandStack();
- commandStack.execute(command);
+ EEFTextController.this.contextAdapter.performModelChange(new Runnable() {
+ @Override
+ public void run() {
+ String editExpression = EEFTextController.this.description.getEditExpression();
+ EAttribute eAttribute = EefPackage.Literals.EEF_TEXT_DESCRIPTION__EDIT_EXPRESSION;
+
+ Map<String, Object> variables = new HashMap<String, Object>();
+ variables.putAll(EEFTextController.this.variableManager.getVariables());
+ variables.put(EEFExpressionUtils.EEFText.NEW_VALUE, text);
+
+ new Eval(EEFTextController.this.interpreter, variables).call(eAttribute, editExpression);
+ }
+ });
}
};
final long scheduleTime = 500L;
diff --git a/plugins/org.eclipse.eef.ide.ui/src/org/eclipse/eef/ide/ui/api/IEEFLifecycleManagerProvider.java b/plugins/org.eclipse.eef.ide.ui/src/org/eclipse/eef/ide/ui/api/IEEFLifecycleManagerProvider.java
index b39311648..8db274665 100644
--- a/plugins/org.eclipse.eef.ide.ui/src/org/eclipse/eef/ide/ui/api/IEEFLifecycleManagerProvider.java
+++ b/plugins/org.eclipse.eef.ide.ui/src/org/eclipse/eef/ide/ui/api/IEEFLifecycleManagerProvider.java
@@ -11,7 +11,7 @@
package org.eclipse.eef.ide.ui.api;
import org.eclipse.eef.EEFCustomWidgetDescription;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.eef.core.api.EditingContextAdapter;
import org.eclipse.sirius.common.interpreter.api.IInterpreter;
import org.eclipse.sirius.common.interpreter.api.IVariableManager;
@@ -30,12 +30,12 @@ public interface IEEFLifecycleManagerProvider {
* The variable manager
* @param interpreter
* The interpreter
- * @param editingDomain
- * The editing domain
+ * @param contextAdapter
+ * The editing context adapter
*
* @return An {@link ILifecycleManager}
*/
ILifecycleManager getLifecycleManager(EEFCustomWidgetDescription customWidgetDescription, IVariableManager variableManager,
- IInterpreter interpreter, TransactionalEditingDomain editingDomain);
+ IInterpreter interpreter, EditingContextAdapter contextAdapter);
}
diff --git a/plugins/org.eclipse.eef.ide.ui/src/org/eclipse/eef/ide/ui/api/widgets/AbstractEEFWidgetLifecycleManager.java b/plugins/org.eclipse.eef.ide.ui/src/org/eclipse/eef/ide/ui/api/widgets/AbstractEEFWidgetLifecycleManager.java
index 2da28ec4b..ed5984d73 100644
--- a/plugins/org.eclipse.eef.ide.ui/src/org/eclipse/eef/ide/ui/api/widgets/AbstractEEFWidgetLifecycleManager.java
+++ b/plugins/org.eclipse.eef.ide.ui/src/org/eclipse/eef/ide/ui/api/widgets/AbstractEEFWidgetLifecycleManager.java
@@ -22,6 +22,7 @@ import org.eclipse.eef.EefPackage;
import org.eclipse.eef.common.api.utils.Util;
import org.eclipse.eef.common.ui.api.EEFWidgetFactory;
import org.eclipse.eef.common.ui.api.IEEFFormContainer;
+import org.eclipse.eef.core.api.EditingContextAdapter;
import org.eclipse.eef.core.api.controllers.IConsumer;
import org.eclipse.eef.core.api.controllers.IEEFWidgetController;
import org.eclipse.eef.core.api.utils.Eval;
@@ -31,7 +32,6 @@ import org.eclipse.eef.ide.ui.internal.Messages;
import org.eclipse.eef.ide.ui.internal.widgets.styles.EEFColor;
import org.eclipse.eef.ide.ui.internal.widgets.styles.EEFFont;
import org.eclipse.emf.ecore.EAttribute;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.StructuredViewer;
@@ -91,9 +91,9 @@ public abstract class AbstractEEFWidgetLifecycleManager extends AbstractEEFLifec
protected IInterpreter interpreter;
/**
- * The editing domain.
+ * The editing context adapter.
*/
- protected TransactionalEditingDomain editingDomain;
+ protected EditingContextAdapter contextAdapter;
/**
* The label.
@@ -112,13 +112,13 @@ public abstract class AbstractEEFWidgetLifecycleManager extends AbstractEEFLifec
* The variable manager
* @param interpreter
* The interpreter
- * @param editingDomain
- * The editing domain
+ * @param contextAdapter
+ * The editing context adapter
*/
- public AbstractEEFWidgetLifecycleManager(IVariableManager variableManager, IInterpreter interpreter, TransactionalEditingDomain editingDomain) {
+ public AbstractEEFWidgetLifecycleManager(IVariableManager variableManager, IInterpreter interpreter, EditingContextAdapter contextAdapter) {
this.variableManager = variableManager;
this.interpreter = interpreter;
- this.editingDomain = editingDomain;
+ this.contextAdapter = contextAdapter;
}
/**
diff --git a/plugins/org.eclipse.eef.ide.ui/src/org/eclipse/eef/ide/ui/internal/EEFIdeUiPlugin.java b/plugins/org.eclipse.eef.ide.ui/src/org/eclipse/eef/ide/ui/internal/EEFIdeUiPlugin.java
index 486b3d3b6..734dfdec5 100644
--- a/plugins/org.eclipse.eef.ide.ui/src/org/eclipse/eef/ide/ui/internal/EEFIdeUiPlugin.java
+++ b/plugins/org.eclipse.eef.ide.ui/src/org/eclipse/eef/ide/ui/internal/EEFIdeUiPlugin.java
@@ -17,6 +17,7 @@ import org.eclipse.core.runtime.IExtensionRegistry;
import org.eclipse.core.runtime.Platform;
import org.eclipse.eef.EEFCustomWidgetDescription;
import org.eclipse.eef.common.api.AbstractEEFEclipsePlugin;
+import org.eclipse.eef.core.api.EditingContextAdapter;
import org.eclipse.eef.ide.api.extensions.AbstractRegistryEventListener;
import org.eclipse.eef.ide.api.extensions.IItemDescriptor;
import org.eclipse.eef.ide.api.extensions.IItemRegistry;
@@ -26,7 +27,6 @@ import org.eclipse.eef.ide.ui.api.IEEFLifecycleManagerProvider;
import org.eclipse.eef.ide.ui.api.ILifecycleManager;
import org.eclipse.emf.common.EMFPlugin;
import org.eclipse.emf.common.util.ResourceLocator;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.resource.ImageRegistry;
import org.eclipse.sirius.common.interpreter.api.IInterpreter;
@@ -165,7 +165,7 @@ public class EEFIdeUiPlugin extends EMFPlugin {
/**
* Returns the image for the given URL.
- *
+ *
* @param url
* The url of the image
* @return The image found or <code>null</code> if it could not be found
@@ -232,19 +232,19 @@ public class EEFIdeUiPlugin extends EMFPlugin {
* The variable manager to use for the widget to create
* @param interpreter
* The interpreter
- * @param editingDomain
- * The editing domain
+ * @param contextAdapter
+ * The editing context adapter
* @return The lifecycle manager
*/
public ILifecycleManager getEEFLifecycleManager(EEFCustomWidgetDescription eefWidgetDescription, IVariableManager variableManager,
- IInterpreter interpreter, TransactionalEditingDomain editingDomain) {
+ IInterpreter interpreter, EditingContextAdapter contextAdapter) {
for (IItemDescriptor<IEEFLifecycleManagerProvider> itemDescriptor : this.eefLifecycleManagerProviderRegistry.getItemDescriptors()) {
String eefLifecyleManagerID = itemDescriptor.getID();
// Search the lifecycle manager in the contribution
if (eefWidgetDescription.getIdentifier().equals(eefLifecyleManagerID)) {
IEEFLifecycleManagerProvider eefLifecycleManagerProvider = itemDescriptor.getItem();
ILifecycleManager eefLifecycleManager = eefLifecycleManagerProvider.getLifecycleManager(eefWidgetDescription, variableManager,
- interpreter, editingDomain);
+ interpreter, contextAdapter);
if (eefLifecycleManager != null) {
return eefLifecycleManager;
} else {
diff --git a/plugins/org.eclipse.eef.ide.ui/src/org/eclipse/eef/ide/ui/internal/Updater.java b/plugins/org.eclipse.eef.ide.ui/src/org/eclipse/eef/ide/ui/internal/Updater.java
index 5eecb37a1..681a6799f 100644
--- a/plugins/org.eclipse.eef.ide.ui/src/org/eclipse/eef/ide/ui/internal/Updater.java
+++ b/plugins/org.eclipse.eef.ide.ui/src/org/eclipse/eef/ide/ui/internal/Updater.java
@@ -10,13 +10,12 @@
*******************************************************************************/
package org.eclipse.eef.ide.ui.internal;
+import java.util.List;
+
import org.eclipse.eef.common.ui.api.IEEFFormContainer;
+import org.eclipse.eef.core.api.controllers.IConsumer;
import org.eclipse.eef.ide.ui.api.EEFTab;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.transaction.NotificationFilter;
-import org.eclipse.emf.transaction.ResourceSetChangeEvent;
-import org.eclipse.emf.transaction.ResourceSetListenerImpl;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.emf.common.notify.Notification;
/**
* A post-commit listener which refreshes the whole page when a significant change (an actual modification of a model
@@ -24,11 +23,7 @@ import org.eclipse.emf.transaction.TransactionalEditingDomain;
*
* @author pcdavid
*/
-public class Updater extends ResourceSetListenerImpl {
- /**
- * Describes the changes we want to react to.
- */
- private static final NotificationFilter FILTER = NotificationFilter.NOT_TOUCH.and(NotificationFilter.createNotifierTypeFilter(EObject.class));
+public class Updater implements IConsumer<List<Notification>> {
/**
* The top-level page the section is part of.
@@ -41,11 +36,6 @@ public class Updater extends ResourceSetListenerImpl {
private final EEFTab section;
/**
- * The editing domain to which we are attached.
- */
- private TransactionalEditingDomain editingDomain;
-
- /**
* Creates a new updater.
*
* @param section
@@ -54,38 +44,27 @@ public class Updater extends ResourceSetListenerImpl {
* The container of the form.
*/
public Updater(EEFTab section, IEEFFormContainer formContainer) {
- super(FILTER);
this.section = section;
this.formContainer = formContainer;
}
- @Override
- public boolean isPostcommitOnly() {
- return true;
- }
-
- @Override
- public void resourceSetChanged(final ResourceSetChangeEvent event) {
- formContainer.refreshPage();
- }
-
/**
* Start listening to changes from the current editing domain.
*/
public void enable() {
disable();
- editingDomain = section.getEEFPage().getView().getEditingDomain();
- if (editingDomain != null) {
- editingDomain.addResourceSetListener(this);
- }
+ section.getEEFPage().getView().getContextAdapter().onModelChange(this);
}
/**
* Stop listening to changes from the editing domain.
*/
public void disable() {
- if (editingDomain != null) {
- editingDomain.removeResourceSetListener(this);
- }
+ section.getEEFPage().getView().getContextAdapter().removeModelChangeConsumer();
+ }
+
+ @Override
+ public void apply(List<Notification> value) {
+ formContainer.refreshPage();
}
} \ No newline at end of file
diff --git a/plugins/org.eclipse.eef.ide.ui/src/org/eclipse/eef/ide/ui/internal/widgets/EEFButtonLifecycleManager.java b/plugins/org.eclipse.eef.ide.ui/src/org/eclipse/eef/ide/ui/internal/widgets/EEFButtonLifecycleManager.java
index 77b432fde..0d7ff67ac 100644
--- a/plugins/org.eclipse.eef.ide.ui/src/org/eclipse/eef/ide/ui/internal/widgets/EEFButtonLifecycleManager.java
+++ b/plugins/org.eclipse.eef.ide.ui/src/org/eclipse/eef/ide/ui/internal/widgets/EEFButtonLifecycleManager.java
@@ -22,12 +22,12 @@ import org.eclipse.eef.EEFWidgetDescription;
import org.eclipse.eef.EEFWidgetStyle;
import org.eclipse.eef.common.ui.api.EEFWidgetFactory;
import org.eclipse.eef.common.ui.api.IEEFFormContainer;
+import org.eclipse.eef.core.api.EditingContextAdapter;
import org.eclipse.eef.core.api.controllers.EEFControllersFactory;
import org.eclipse.eef.core.api.controllers.IConsumer;
import org.eclipse.eef.core.api.controllers.IEEFButtonController;
import org.eclipse.eef.core.api.controllers.IEEFWidgetController;
import org.eclipse.eef.ide.ui.api.widgets.AbstractEEFWidgetLifecycleManager;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
import org.eclipse.sirius.common.interpreter.api.IInterpreter;
import org.eclipse.sirius.common.interpreter.api.IVariableManager;
import org.eclipse.swt.SWT;
@@ -75,12 +75,12 @@ public class EEFButtonLifecycleManager extends AbstractEEFWidgetLifecycleManager
* The variable manager
* @param interpreter
* The interpreter
- * @param editingDomain
- * The editing domain
+ * @param contextAdapter
+ * The editing context adapter
*/
public EEFButtonLifecycleManager(EEFButtonDescription description, IVariableManager variableManager, IInterpreter interpreter,
- TransactionalEditingDomain editingDomain) {
- super(variableManager, interpreter, editingDomain);
+ EditingContextAdapter contextAdapter) {
+ super(variableManager, interpreter, contextAdapter);
this.description = description;
}
@@ -105,8 +105,7 @@ public class EEFButtonLifecycleManager extends AbstractEEFWidgetLifecycleManager
widgetFactory.paintBordersFor(parent);
- this.controller = new EEFControllersFactory().createButtonController(this.description, this.variableManager, this.interpreter,
- this.editingDomain);
+ this.controller = new EEFControllersFactory().createButtonController(this.description, this.variableManager, this.interpreter, this.contextAdapter);
}
/**
diff --git a/plugins/org.eclipse.eef.ide.ui/src/org/eclipse/eef/ide/ui/internal/widgets/EEFCheckboxLifecycleManager.java b/plugins/org.eclipse.eef.ide.ui/src/org/eclipse/eef/ide/ui/internal/widgets/EEFCheckboxLifecycleManager.java
index 500f404f0..fc6738fc5 100644
--- a/plugins/org.eclipse.eef.ide.ui/src/org/eclipse/eef/ide/ui/internal/widgets/EEFCheckboxLifecycleManager.java
+++ b/plugins/org.eclipse.eef.ide.ui/src/org/eclipse/eef/ide/ui/internal/widgets/EEFCheckboxLifecycleManager.java
@@ -20,12 +20,12 @@ import org.eclipse.eef.EEFWidgetDescription;
import org.eclipse.eef.EEFWidgetStyle;
import org.eclipse.eef.common.ui.api.EEFWidgetFactory;
import org.eclipse.eef.common.ui.api.IEEFFormContainer;
+import org.eclipse.eef.core.api.EditingContextAdapter;
import org.eclipse.eef.core.api.controllers.EEFControllersFactory;
import org.eclipse.eef.core.api.controllers.IConsumer;
import org.eclipse.eef.core.api.controllers.IEEFCheckboxController;
import org.eclipse.eef.core.api.controllers.IEEFWidgetController;
import org.eclipse.eef.ide.ui.api.widgets.AbstractEEFWidgetLifecycleManager;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
import org.eclipse.sirius.common.interpreter.api.IInterpreter;
import org.eclipse.sirius.common.interpreter.api.IVariableManager;
import org.eclipse.swt.SWT;
@@ -72,12 +72,12 @@ public class EEFCheckboxLifecycleManager extends AbstractEEFWidgetLifecycleManag
* The variable manager
* @param interpreter
* The interpreter
- * @param editingDomain
- * The editing domain
+ * @param contextAdapter
+ * The editing context adapter
*/
public EEFCheckboxLifecycleManager(EEFCheckboxDescription description, IVariableManager variableManager, IInterpreter interpreter,
- TransactionalEditingDomain editingDomain) {
- super(variableManager, interpreter, editingDomain);
+ EditingContextAdapter contextAdapter) {
+ super(variableManager, interpreter, contextAdapter);
this.description = description;
}
@@ -97,8 +97,7 @@ public class EEFCheckboxLifecycleManager extends AbstractEEFWidgetLifecycleManag
this.checkbox = widgetFactory.createButton(parent, "", SWT.CHECK); //$NON-NLS-1$
this.checkbox.setLayoutData(buttonFormData);
- this.controller = new EEFControllersFactory().createCheckboxController(this.description, this.variableManager, this.interpreter,
- this.editingDomain);
+ this.controller = new EEFControllersFactory().createCheckboxController(this.description, this.variableManager, this.interpreter, this.contextAdapter);
}
/**
diff --git a/plugins/org.eclipse.eef.ide.ui/src/org/eclipse/eef/ide/ui/internal/widgets/EEFContainerLifecycleManager.java b/plugins/org.eclipse.eef.ide.ui/src/org/eclipse/eef/ide/ui/internal/widgets/EEFContainerLifecycleManager.java
index 3d6d2a9bd..7781c6f34 100644
--- a/plugins/org.eclipse.eef.ide.ui/src/org/eclipse/eef/ide/ui/internal/widgets/EEFContainerLifecycleManager.java
+++ b/plugins/org.eclipse.eef.ide.ui/src/org/eclipse/eef/ide/ui/internal/widgets/EEFContainerLifecycleManager.java
@@ -31,13 +31,13 @@ import org.eclipse.eef.EefPackage;
import org.eclipse.eef.common.api.utils.Util;
import org.eclipse.eef.common.ui.api.IEEFFormContainer;
import org.eclipse.eef.core.api.EEFExpressionUtils;
+import org.eclipse.eef.core.api.EditingContextAdapter;
import org.eclipse.eef.core.api.utils.Eval;
import org.eclipse.eef.ide.ui.api.ILifecycleManager;
import org.eclipse.eef.ide.ui.internal.EEFIdeUiPlugin;
import org.eclipse.eef.ide.ui.internal.Messages;
import org.eclipse.emf.ecore.EAttribute;
import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
import org.eclipse.sirius.common.interpreter.api.IInterpreter;
import org.eclipse.sirius.common.interpreter.api.IVariableManager;
import org.eclipse.swt.widgets.Composite;
@@ -60,9 +60,9 @@ public class EEFContainerLifecycleManager implements ILifecycleManager {
private IInterpreter interpreter;
/**
- * The editing domain.
+ * The editing context adapter.
*/
- private TransactionalEditingDomain editingDomain;
+ private EditingContextAdapter contextAdapter;
/**
* The description of the container.
@@ -83,15 +83,15 @@ public class EEFContainerLifecycleManager implements ILifecycleManager {
* The variable manager
* @param interpreter
* The interpreter
- * @param editingDomain
- * The editing domain
+ * @param contextAdapter
+ * The editing context adapter
*/
public EEFContainerLifecycleManager(EEFContainerDescription description, IVariableManager variableManager, IInterpreter interpreter,
- TransactionalEditingDomain editingDomain) {
+ EditingContextAdapter contextAdapter) {
this.description = description;
this.variableManager = variableManager;
this.interpreter = interpreter;
- this.editingDomain = editingDomain;
+ this.contextAdapter = contextAdapter;
}
/**
@@ -130,8 +130,7 @@ public class EEFContainerLifecycleManager implements ILifecycleManager {
if (eefWidgetDescription instanceof EEFTextDescription) {
EEFTextDescription eefTextDescription = (EEFTextDescription) eefWidgetDescription;
- EEFTextLifecycleManager eefTextLifecycleManager = new EEFTextLifecycleManager(eefTextDescription, childVariableManager, interpreter,
- editingDomain);
+ EEFTextLifecycleManager eefTextLifecycleManager = new EEFTextLifecycleManager(eefTextDescription, childVariableManager, interpreter, contextAdapter);
eefTextLifecycleManager.createControl(parent, formContainer);
this.lifecycleManagers.add(eefTextLifecycleManager);
@@ -139,7 +138,7 @@ public class EEFContainerLifecycleManager implements ILifecycleManager {
EEFLabelDescription eefLabelDescription = (EEFLabelDescription) eefWidgetDescription;
EEFLabelLifecycleManager eefLabelLifecycleManager = new EEFLabelLifecycleManager(eefLabelDescription, childVariableManager, interpreter,
- editingDomain);
+ contextAdapter);
eefLabelLifecycleManager.createControl(parent, formContainer);
this.lifecycleManagers.add(eefLabelLifecycleManager);
@@ -147,7 +146,7 @@ public class EEFContainerLifecycleManager implements ILifecycleManager {
EEFSelectDescription eefSelectDescription = (EEFSelectDescription) eefWidgetDescription;
EEFSelectLifecycleManager eefSelectLifecycleManager = new EEFSelectLifecycleManager(eefSelectDescription, childVariableManager,
- interpreter, editingDomain);
+ interpreter, contextAdapter);
eefSelectLifecycleManager.createControl(parent, formContainer);
this.lifecycleManagers.add(eefSelectLifecycleManager);
@@ -155,7 +154,7 @@ public class EEFContainerLifecycleManager implements ILifecycleManager {
EEFRadioDescription eefRadioDescription = (EEFRadioDescription) eefWidgetDescription;
EEFRadioLifecycleManager eefRadioLifecycleManager = new EEFRadioLifecycleManager(eefRadioDescription, childVariableManager, interpreter,
- editingDomain);
+ contextAdapter);
eefRadioLifecycleManager.createControl(parent, formContainer);
this.lifecycleManagers.add(eefRadioLifecycleManager);
@@ -163,7 +162,7 @@ public class EEFContainerLifecycleManager implements ILifecycleManager {
EEFCheckboxDescription eefCheckboxDescription = (EEFCheckboxDescription) eefWidgetDescription;
EEFCheckboxLifecycleManager eefCheckboxLifecycleManager = new EEFCheckboxLifecycleManager(eefCheckboxDescription, childVariableManager,
- interpreter, editingDomain);
+ interpreter, contextAdapter);
eefCheckboxLifecycleManager.createControl(parent, formContainer);
this.lifecycleManagers.add(eefCheckboxLifecycleManager);
@@ -171,14 +170,14 @@ public class EEFContainerLifecycleManager implements ILifecycleManager {
EEFButtonDescription eefButtonDescription = (EEFButtonDescription) eefWidgetDescription;
EEFButtonLifecycleManager eefButtonLifecycleManager = new EEFButtonLifecycleManager(eefButtonDescription, childVariableManager,
- interpreter, editingDomain);
+ interpreter, contextAdapter);
eefButtonLifecycleManager.createControl(parent, formContainer);
this.lifecycleManagers.add(eefButtonLifecycleManager);
} else if (eefWidgetDescription instanceof EEFCustomWidgetDescription) {
EEFCustomWidgetDescription eefCustomDescription = (EEFCustomWidgetDescription) eefWidgetDescription;
ILifecycleManager eefCustomWidgetLifecycleManager = EEFIdeUiPlugin.getPlugin().getEEFLifecycleManager(eefCustomDescription,
- childVariableManager, interpreter, editingDomain);
+ childVariableManager, interpreter, contextAdapter);
if (eefCustomWidgetLifecycleManager != null) {
eefCustomWidgetLifecycleManager.createControl(parent, formContainer);
this.lifecycleManagers.add(eefCustomWidgetLifecycleManager);
diff --git a/plugins/org.eclipse.eef.ide.ui/src/org/eclipse/eef/ide/ui/internal/widgets/EEFGroupLifecycleManager.java b/plugins/org.eclipse.eef.ide.ui/src/org/eclipse/eef/ide/ui/internal/widgets/EEFGroupLifecycleManager.java
index 5c98419eb..da61614bd 100644
--- a/plugins/org.eclipse.eef.ide.ui/src/org/eclipse/eef/ide/ui/internal/widgets/EEFGroupLifecycleManager.java
+++ b/plugins/org.eclipse.eef.ide.ui/src/org/eclipse/eef/ide/ui/internal/widgets/EEFGroupLifecycleManager.java
@@ -19,6 +19,7 @@ import org.eclipse.eef.EEFContainerDescription;
import org.eclipse.eef.EEFGroupDescription;
import org.eclipse.eef.common.ui.api.EEFWidgetFactory;
import org.eclipse.eef.common.ui.api.IEEFFormContainer;
+import org.eclipse.eef.core.api.EditingContextAdapter;
import org.eclipse.eef.core.api.controllers.EEFControllersFactory;
import org.eclipse.eef.core.api.controllers.IConsumer;
import org.eclipse.eef.core.api.controllers.IEEFController;
@@ -26,7 +27,6 @@ import org.eclipse.eef.core.api.controllers.IEEFGroupController;
import org.eclipse.eef.core.api.utils.Eval;
import org.eclipse.eef.ide.ui.api.ILifecycleManager;
import org.eclipse.eef.ide.ui.api.widgets.AbstractEEFLifecycleManager;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
import org.eclipse.sirius.common.interpreter.api.IInterpreter;
import org.eclipse.sirius.common.interpreter.api.IVariableManager;
import org.eclipse.swt.layout.GridData;
@@ -53,9 +53,9 @@ public class EEFGroupLifecycleManager extends AbstractEEFLifecycleManager {
private IInterpreter interpreter;
/**
- * The editing domain.
+ * The editing context adapter.
*/
- private TransactionalEditingDomain editingDomain;
+ private EditingContextAdapter contextAdapter;
/**
* The description of the container.
@@ -86,15 +86,15 @@ public class EEFGroupLifecycleManager extends AbstractEEFLifecycleManager {
* The variable manager
* @param interpreter
* The interpreter
- * @param editingDomain
- * The editing domain
+ * @param contextAdapter
+ * The editing context adapter
*/
public EEFGroupLifecycleManager(EEFGroupDescription description, IVariableManager variableManager, IInterpreter interpreter,
- TransactionalEditingDomain editingDomain) {
+ EditingContextAdapter contextAdapter) {
this.description = description;
this.variableManager = variableManager;
this.interpreter = interpreter;
- this.editingDomain = editingDomain;
+ this.contextAdapter = contextAdapter;
}
/**
@@ -137,7 +137,7 @@ public class EEFGroupLifecycleManager extends AbstractEEFLifecycleManager {
EEFContainerDescription containerDescription = this.description.getContainer();
if (containerDescription != null) {
EEFContainerLifecycleManager containerLifecycleManager = new EEFContainerLifecycleManager(containerDescription,
- this.variableManager.createChild(), this.interpreter, this.editingDomain);
+ this.variableManager.createChild(), this.interpreter, this.contextAdapter);
containerLifecycleManager.createControl(group, formContainer);
parent.layout();
diff --git a/plugins/org.eclipse.eef.ide.ui/src/org/eclipse/eef/ide/ui/internal/widgets/EEFLabelLifecycleManager.java b/plugins/org.eclipse.eef.ide.ui/src/org/eclipse/eef/ide/ui/internal/widgets/EEFLabelLifecycleManager.java
index ee1f8b698..8d02e07c1 100644
--- a/plugins/org.eclipse.eef.ide.ui/src/org/eclipse/eef/ide/ui/internal/widgets/EEFLabelLifecycleManager.java
+++ b/plugins/org.eclipse.eef.ide.ui/src/org/eclipse/eef/ide/ui/internal/widgets/EEFLabelLifecycleManager.java
@@ -23,13 +23,13 @@ import org.eclipse.eef.EEFWidgetDescription;
import org.eclipse.eef.EEFWidgetStyle;
import org.eclipse.eef.EefPackage;
import org.eclipse.eef.common.ui.api.IEEFFormContainer;
+import org.eclipse.eef.core.api.EditingContextAdapter;
import org.eclipse.eef.core.api.controllers.EEFControllersFactory;
import org.eclipse.eef.core.api.controllers.IConsumer;
import org.eclipse.eef.core.api.controllers.IEEFLabelController;
import org.eclipse.eef.core.api.controllers.IEEFWidgetController;
import org.eclipse.eef.core.api.utils.Eval;
import org.eclipse.eef.ide.ui.api.widgets.AbstractEEFWidgetLifecycleManager;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
import org.eclipse.sirius.common.interpreter.api.IInterpreter;
import org.eclipse.sirius.common.interpreter.api.IVariableManager;
import org.eclipse.swt.SWT;
@@ -69,12 +69,12 @@ public class EEFLabelLifecycleManager extends AbstractEEFWidgetLifecycleManager
* The variable manager
* @param interpreter
* The interpreter
- * @param editingDomain
- * The editing domain
+ * @param contextAdapter
+ * The editing context adapter
*/
public EEFLabelLifecycleManager(EEFLabelDescription description, IVariableManager variableManager, IInterpreter interpreter,
- TransactionalEditingDomain editingDomain) {
- super(variableManager, interpreter, editingDomain);
+ EditingContextAdapter contextAdapter) {
+ super(variableManager, interpreter, contextAdapter);
this.description = description;
}
diff --git a/plugins/org.eclipse.eef.ide.ui/src/org/eclipse/eef/ide/ui/internal/widgets/EEFRadioLifecycleManager.java b/plugins/org.eclipse.eef.ide.ui/src/org/eclipse/eef/ide/ui/internal/widgets/EEFRadioLifecycleManager.java
index 5a2f17db2..07552fff4 100644
--- a/plugins/org.eclipse.eef.ide.ui/src/org/eclipse/eef/ide/ui/internal/widgets/EEFRadioLifecycleManager.java
+++ b/plugins/org.eclipse.eef.ide.ui/src/org/eclipse/eef/ide/ui/internal/widgets/EEFRadioLifecycleManager.java
@@ -25,6 +25,7 @@ import org.eclipse.eef.common.ui.api.EEFWidgetFactory;
import org.eclipse.eef.common.ui.api.IEEFFormContainer;
import org.eclipse.eef.core.api.EEFExpressionUtils;
import org.eclipse.eef.core.api.EEFExpressionUtils.EEFSelect;
+import org.eclipse.eef.core.api.EditingContextAdapter;
import org.eclipse.eef.core.api.controllers.EEFControllersFactory;
import org.eclipse.eef.core.api.controllers.IConsumer;
import org.eclipse.eef.core.api.controllers.IEEFRadioController;
@@ -32,7 +33,6 @@ import org.eclipse.eef.core.api.controllers.IEEFWidgetController;
import org.eclipse.eef.core.api.utils.Eval;
import org.eclipse.eef.ide.ui.api.widgets.AbstractEEFWidgetLifecycleManager;
import org.eclipse.emf.ecore.EAttribute;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
import org.eclipse.jface.viewers.ArrayContentProvider;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
@@ -89,12 +89,12 @@ public class EEFRadioLifecycleManager extends AbstractEEFWidgetLifecycleManager
* The variable manager
* @param interpreter
* The interpreter
- * @param editingDomain
- * The editing domain
+ * @param contextAdapter
+ * The editing context adapter
*/
public EEFRadioLifecycleManager(EEFRadioDescription description, IVariableManager variableManager, IInterpreter interpreter,
- TransactionalEditingDomain editingDomain) {
- super(variableManager, interpreter, editingDomain);
+ EditingContextAdapter contextAdapter) {
+ super(variableManager, interpreter, contextAdapter);
this.description = description;
}
@@ -120,8 +120,7 @@ public class EEFRadioLifecycleManager extends AbstractEEFWidgetLifecycleManager
radioGroupFormData.left = new FormAttachment(0, LABEL_WIDTH);
this.radioGroup.setLayoutData(radioGroupFormData);
- this.controller = new EEFControllersFactory().createRadioController(this.description, this.variableManager, this.interpreter,
- this.editingDomain);
+ this.controller = new EEFControllersFactory().createRadioController(this.description, this.variableManager, this.interpreter, this.contextAdapter);
}
/**
diff --git a/plugins/org.eclipse.eef.ide.ui/src/org/eclipse/eef/ide/ui/internal/widgets/EEFSectionLifecycleManager.java b/plugins/org.eclipse.eef.ide.ui/src/org/eclipse/eef/ide/ui/internal/widgets/EEFSectionLifecycleManager.java
index 40472a80c..17cede7e2 100644
--- a/plugins/org.eclipse.eef.ide.ui/src/org/eclipse/eef/ide/ui/internal/widgets/EEFSectionLifecycleManager.java
+++ b/plugins/org.eclipse.eef.ide.ui/src/org/eclipse/eef/ide/ui/internal/widgets/EEFSectionLifecycleManager.java
@@ -16,6 +16,7 @@ import java.util.List;
import org.eclipse.eef.common.ui.api.IEEFFormContainer;
import org.eclipse.eef.core.api.EEFGroup;
import org.eclipse.eef.core.api.EEFPage;
+import org.eclipse.eef.core.api.EditingContextAdapter;
import org.eclipse.eef.core.api.controllers.EEFControllersFactory;
import org.eclipse.eef.core.api.controllers.IEEFController;
import org.eclipse.eef.core.api.controllers.IEEFSectionController;
@@ -71,8 +72,9 @@ public class EEFSectionLifecycleManager extends AbstractEEFLifecycleManager {
List<EEFGroup> eefGroups = this.eefPage.getGroups();
for (EEFGroup eefGroup : eefGroups) {
+ EditingContextAdapter contextAdapter = eefGroup.getPage().getView().getContextAdapter();
EEFGroupLifecycleManager groupLifecycleManager = new EEFGroupLifecycleManager(eefGroup.getDescription(), eefGroup.getVariableManager(),
- eefGroup.getInterpreter(), eefGroup.getEditingDomain());
+ eefGroup.getInterpreter(), contextAdapter);
groupLifecycleManager.createControl(parent, formContainer);
this.lifecycleManagers.add(groupLifecycleManager);
diff --git a/plugins/org.eclipse.eef.ide.ui/src/org/eclipse/eef/ide/ui/internal/widgets/EEFSelectLifecycleManager.java b/plugins/org.eclipse.eef.ide.ui/src/org/eclipse/eef/ide/ui/internal/widgets/EEFSelectLifecycleManager.java
index 9d975ba4d..c16b2206b 100644
--- a/plugins/org.eclipse.eef.ide.ui/src/org/eclipse/eef/ide/ui/internal/widgets/EEFSelectLifecycleManager.java
+++ b/plugins/org.eclipse.eef.ide.ui/src/org/eclipse/eef/ide/ui/internal/widgets/EEFSelectLifecycleManager.java
@@ -25,6 +25,7 @@ import org.eclipse.eef.common.ui.api.EEFWidgetFactory;
import org.eclipse.eef.common.ui.api.IEEFFormContainer;
import org.eclipse.eef.core.api.EEFExpressionUtils;
import org.eclipse.eef.core.api.EEFExpressionUtils.EEFSelect;
+import org.eclipse.eef.core.api.EditingContextAdapter;
import org.eclipse.eef.core.api.controllers.EEFControllersFactory;
import org.eclipse.eef.core.api.controllers.IConsumer;
import org.eclipse.eef.core.api.controllers.IEEFSelectController;
@@ -32,7 +33,6 @@ import org.eclipse.eef.core.api.controllers.IEEFWidgetController;
import org.eclipse.eef.core.api.utils.Eval;
import org.eclipse.eef.ide.ui.api.widgets.AbstractEEFWidgetLifecycleManager;
import org.eclipse.emf.ecore.EAttribute;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
import org.eclipse.jface.viewers.ArrayContentProvider;
import org.eclipse.jface.viewers.ComboViewer;
import org.eclipse.jface.viewers.ISelection;
@@ -91,12 +91,12 @@ public class EEFSelectLifecycleManager extends AbstractEEFWidgetLifecycleManager
* The variable manager
* @param interpreter
* The interpreter
- * @param editingDomain
- * The editing domain
+ * @param contextAdapter
+ * The editing context adapter
*/
public EEFSelectLifecycleManager(EEFSelectDescription description, IVariableManager variableManager, IInterpreter interpreter,
- TransactionalEditingDomain editingDomain) {
- super(variableManager, interpreter, editingDomain);
+ EditingContextAdapter contextAdapter) {
+ super(variableManager, interpreter, contextAdapter);
this.description = description;
}
@@ -123,8 +123,7 @@ public class EEFSelectLifecycleManager extends AbstractEEFWidgetLifecycleManager
comboFormData.right = new FormAttachment(100, 0);
this.comboViewer.getCombo().setLayoutData(comboFormData);
- this.controller = new EEFControllersFactory().createSelectController(this.description, this.variableManager, this.interpreter,
- this.editingDomain);
+ this.controller = new EEFControllersFactory().createSelectController(this.description, this.variableManager, this.interpreter, this.contextAdapter);
}
/**
diff --git a/plugins/org.eclipse.eef.ide.ui/src/org/eclipse/eef/ide/ui/internal/widgets/EEFTextLifecycleManager.java b/plugins/org.eclipse.eef.ide.ui/src/org/eclipse/eef/ide/ui/internal/widgets/EEFTextLifecycleManager.java
index d82c7b772..a6f405a76 100644
--- a/plugins/org.eclipse.eef.ide.ui/src/org/eclipse/eef/ide/ui/internal/widgets/EEFTextLifecycleManager.java
+++ b/plugins/org.eclipse.eef.ide.ui/src/org/eclipse/eef/ide/ui/internal/widgets/EEFTextLifecycleManager.java
@@ -23,13 +23,13 @@ import org.eclipse.eef.EEFWidgetDescription;
import org.eclipse.eef.EEFWidgetStyle;
import org.eclipse.eef.common.ui.api.EEFWidgetFactory;
import org.eclipse.eef.common.ui.api.IEEFFormContainer;
+import org.eclipse.eef.core.api.EditingContextAdapter;
import org.eclipse.eef.core.api.controllers.EEFControllersFactory;
import org.eclipse.eef.core.api.controllers.IConsumer;
import org.eclipse.eef.core.api.controllers.IEEFTextController;
import org.eclipse.eef.core.api.controllers.IEEFWidgetController;
import org.eclipse.eef.core.api.utils.Eval;
import org.eclipse.eef.ide.ui.api.widgets.AbstractEEFWidgetLifecycleManager;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
import org.eclipse.sirius.common.interpreter.api.IInterpreter;
import org.eclipse.sirius.common.interpreter.api.IVariableManager;
import org.eclipse.swt.SWT;
@@ -78,12 +78,12 @@ public class EEFTextLifecycleManager extends AbstractEEFWidgetLifecycleManager {
* The variable manager
* @param interpreter
* The interpreter
- * @param editingDomain
- * The editing domain
+ * @param contextAdapter
+ * The editing context adapter
*/
public EEFTextLifecycleManager(EEFTextDescription description, IVariableManager variableManager, IInterpreter interpreter,
- TransactionalEditingDomain editingDomain) {
- super(variableManager, interpreter, editingDomain);
+ EditingContextAdapter contextAdapter) {
+ super(variableManager, interpreter, contextAdapter);
this.description = description;
}
@@ -117,8 +117,7 @@ public class EEFTextLifecycleManager extends AbstractEEFWidgetLifecycleManager {
this.text.setLayoutData(formData);
- this.controller = new EEFControllersFactory().createTextController(this.description, this.variableManager, this.interpreter,
- this.editingDomain);
+ this.controller = new EEFControllersFactory().createTextController(this.description, this.variableManager, this.interpreter, this.contextAdapter);
}
/**
diff --git a/samples/org.eclipse.eef.sample.custom.widget.colorpicker/src/org/eclipse/eef/sample/custom/widget/colorpicker/ColorPickerController.java b/samples/org.eclipse.eef.sample.custom.widget.colorpicker/src/org/eclipse/eef/sample/custom/widget/colorpicker/ColorPickerController.java
index d13b07a73..c23cc3332 100644
--- a/samples/org.eclipse.eef.sample.custom.widget.colorpicker/src/org/eclipse/eef/sample/custom/widget/colorpicker/ColorPickerController.java
+++ b/samples/org.eclipse.eef.sample.custom.widget.colorpicker/src/org/eclipse/eef/sample/custom/widget/colorpicker/ColorPickerController.java
@@ -16,14 +16,11 @@ import java.util.Map;
import org.eclipse.eef.EEFCustomWidgetDescription;
import org.eclipse.eef.EefPackage;
import org.eclipse.eef.core.api.EEFExpressionUtils;
+import org.eclipse.eef.core.api.EditingContextAdapter;
import org.eclipse.eef.core.api.controllers.AbstractEEFCustomWidgetController;
import org.eclipse.eef.core.api.controllers.IConsumer;
import org.eclipse.eef.core.api.utils.Eval;
-import org.eclipse.emf.common.command.Command;
-import org.eclipse.emf.common.command.CommandStack;
import org.eclipse.emf.ecore.EAttribute;
-import org.eclipse.emf.transaction.RecordingCommand;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
import org.eclipse.sirius.common.interpreter.api.IInterpreter;
import org.eclipse.sirius.common.interpreter.api.IVariableManager;
import org.eclipse.swt.graphics.Color;
@@ -71,11 +68,11 @@ public class ColorPickerController extends AbstractEEFCustomWidgetController imp
* The variable manager
* @param interpreter
* The interpreter
- * @param editingDomain
- * The editing domain
+ * @param contextAdapter
+ * The editing context adapter
*/
- public ColorPickerController(EEFCustomWidgetDescription description, IVariableManager variableManager, IInterpreter interpreter, TransactionalEditingDomain editingDomain) {
- super(description, variableManager, interpreter, editingDomain);
+ public ColorPickerController(EEFCustomWidgetDescription description, IVariableManager variableManager, IInterpreter interpreter, EditingContextAdapter contextAdapter) {
+ super(description, variableManager, interpreter, contextAdapter);
}
/**
@@ -131,10 +128,9 @@ public class ColorPickerController extends AbstractEEFCustomWidgetController imp
@Override
public void updateValue(final RGB color) {
-
- final Command command = new RecordingCommand(this.editingDomain) {
+ contextAdapter.performModelChange(new Runnable() {
@Override
- protected void doExecute() {
+ public void run() {
String editExpression = getCustomExpression(EDIT_EXPRESSION_ID);
EAttribute eAttribute = EefPackage.Literals.EEF_CUSTOM_EXPRESSION__CUSTOM_EXPRESSION;
@@ -144,21 +140,7 @@ public class ColorPickerController extends AbstractEEFCustomWidgetController imp
new Eval(ColorPickerController.this.interpreter, variables).call(eAttribute, editExpression);
}
-
- @Override
- public boolean canExecute() {
- return true;
- }
- };
-
- Runnable runnable = new Runnable() {
- @Override
- public void run() {
- CommandStack commandStack = ColorPickerController.this.editingDomain.getCommandStack();
- commandStack.execute(command);
- }
- };
- runnable.run();
+ });
}
}
diff --git a/samples/org.eclipse.eef.sample.custom.widget.colorpicker/src/org/eclipse/eef/sample/custom/widget/colorpicker/ColorPickerLifecycleManager.java b/samples/org.eclipse.eef.sample.custom.widget.colorpicker/src/org/eclipse/eef/sample/custom/widget/colorpicker/ColorPickerLifecycleManager.java
index b5e6041e5..87a8e114c 100644
--- a/samples/org.eclipse.eef.sample.custom.widget.colorpicker/src/org/eclipse/eef/sample/custom/widget/colorpicker/ColorPickerLifecycleManager.java
+++ b/samples/org.eclipse.eef.sample.custom.widget.colorpicker/src/org/eclipse/eef/sample/custom/widget/colorpicker/ColorPickerLifecycleManager.java
@@ -20,10 +20,10 @@ import org.eclipse.eef.EEFWidgetDescription;
import org.eclipse.eef.EEFWidgetStyle;
import org.eclipse.eef.common.ui.api.EEFWidgetFactory;
import org.eclipse.eef.common.ui.api.IEEFFormContainer;
+import org.eclipse.eef.core.api.EditingContextAdapter;
import org.eclipse.eef.core.api.controllers.IConsumer;
import org.eclipse.eef.core.api.controllers.IEEFWidgetController;
import org.eclipse.eef.ide.ui.api.widgets.AbstractEEFWidgetLifecycleManager;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
import org.eclipse.sirius.common.interpreter.api.IInterpreter;
import org.eclipse.sirius.common.interpreter.api.IVariableManager;
import org.eclipse.swt.SWT;
@@ -74,12 +74,12 @@ public class ColorPickerLifecycleManager extends AbstractEEFWidgetLifecycleManag
* The variable manager
* @param interpreter
* The interpreter
- * @param editingDomain
- * The editing domain
+ * @param contextAdapter
+ * The editing context adapter
* @param singleReferenceViewerProvider
*/
- public ColorPickerLifecycleManager(EEFCustomWidgetDescription description, IVariableManager variableManager, IInterpreter interpreter, TransactionalEditingDomain editingDomain) {
- super(variableManager, interpreter, editingDomain);
+ public ColorPickerLifecycleManager(EEFCustomWidgetDescription description, IVariableManager variableManager, IInterpreter interpreter, EditingContextAdapter contextAdapter) {
+ super(variableManager, interpreter, contextAdapter);
this.description = description;
}
@@ -97,7 +97,7 @@ public class ColorPickerLifecycleManager extends AbstractEEFWidgetLifecycleManag
this.colorPicker.setLayoutData(formData);
- this.controller = new ColorPickerController(this.description, this.variableManager, this.interpreter, this.editingDomain);
+ this.controller = new ColorPickerController(this.description, this.variableManager, this.interpreter, this.contextAdapter);
}
/**
diff --git a/samples/org.eclipse.eef.sample.custom.widget.colorpicker/src/org/eclipse/eef/sample/custom/widget/colorpicker/ColorPickerProvider.java b/samples/org.eclipse.eef.sample.custom.widget.colorpicker/src/org/eclipse/eef/sample/custom/widget/colorpicker/ColorPickerProvider.java
index 53ff07071..db28f13c1 100644
--- a/samples/org.eclipse.eef.sample.custom.widget.colorpicker/src/org/eclipse/eef/sample/custom/widget/colorpicker/ColorPickerProvider.java
+++ b/samples/org.eclipse.eef.sample.custom.widget.colorpicker/src/org/eclipse/eef/sample/custom/widget/colorpicker/ColorPickerProvider.java
@@ -11,9 +11,9 @@
package org.eclipse.eef.sample.custom.widget.colorpicker;
import org.eclipse.eef.EEFCustomWidgetDescription;
+import org.eclipse.eef.core.api.EditingContextAdapter;
import org.eclipse.eef.ide.ui.api.IEEFLifecycleManagerProvider;
import org.eclipse.eef.ide.ui.api.ILifecycleManager;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
import org.eclipse.sirius.common.interpreter.api.IInterpreter;
import org.eclipse.sirius.common.interpreter.api.IVariableManager;
@@ -25,8 +25,7 @@ import org.eclipse.sirius.common.interpreter.api.IVariableManager;
public class ColorPickerProvider implements IEEFLifecycleManagerProvider {
@Override
- public ILifecycleManager getLifecycleManager(EEFCustomWidgetDescription customWidgetDescription, IVariableManager variableManager, IInterpreter interpreter,
- TransactionalEditingDomain editingDomain) {
- return new ColorPickerLifecycleManager(customWidgetDescription, variableManager, interpreter, editingDomain);
+ public ILifecycleManager getLifecycleManager(EEFCustomWidgetDescription customWidgetDescription, IVariableManager variableManager, IInterpreter interpreter, EditingContextAdapter contextAdapter) {
+ return new ColorPickerLifecycleManager(customWidgetDescription, variableManager, interpreter, contextAdapter);
}
}
diff --git a/tests/org.eclipse.eef.tests/src/org/eclipse/eef/tests/internal/controllers/AbstractEEFControllerTests.java b/tests/org.eclipse.eef.tests/src/org/eclipse/eef/tests/internal/controllers/AbstractEEFControllerTests.java
index 2cba5bd06..8ce854aa7 100644
--- a/tests/org.eclipse.eef.tests/src/org/eclipse/eef/tests/internal/controllers/AbstractEEFControllerTests.java
+++ b/tests/org.eclipse.eef.tests/src/org/eclipse/eef/tests/internal/controllers/AbstractEEFControllerTests.java
@@ -20,6 +20,7 @@ import org.eclipse.eef.EEFViewDescription;
import org.eclipse.eef.EEFWidgetDescription;
import org.eclipse.eef.EefPackage;
import org.eclipse.eef.core.api.EEFExpressionUtils;
+import org.eclipse.eef.core.api.EditingContextAdapter;
import org.eclipse.eef.core.api.controllers.IEEFWidgetController;
import org.eclipse.eef.tests.internal.AQLInterpreter;
import org.eclipse.eef.tests.internal.EEFDataTests;
@@ -32,7 +33,6 @@ import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
import org.eclipse.emf.ecore.xmi.impl.EcoreResourceFactoryImpl;
import org.eclipse.emf.ecore.xmi.impl.XMIResourceFactoryImpl;
import org.eclipse.emf.edit.provider.ComposedAdapterFactory;
-import org.eclipse.emf.transaction.impl.TransactionalEditingDomainImpl;
import org.eclipse.sirius.common.interpreter.api.IInterpreter;
import org.eclipse.sirius.common.interpreter.api.IVariableManager;
import org.eclipse.sirius.common.interpreter.api.VariableManagerFactory;
@@ -41,7 +41,6 @@ import org.junit.Before;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.core.Is.is;
import static org.hamcrest.core.IsNull.notNullValue;
-
import static org.junit.Assert.assertTrue;
/**
@@ -57,11 +56,6 @@ public abstract class AbstractEEFControllerTests {
public static final String DART_ECORE = "/data/dart.ecore"; //$NON-NLS-1$
/**
- * The editing domain.
- */
- protected TransactionalEditingDomainImpl editingDomain;
-
- /**
* The resource set.
*/
protected ResourceSetImpl resourceSet;
@@ -71,6 +65,11 @@ public abstract class AbstractEEFControllerTests {
*/
protected IInterpreter interpreter;
+ /**
+ * The editing context adapter.
+ */
+ protected EditingContextAdapter contextAdapter;
+
@Before
public void setUp() {
this.resourceSet = new ResourceSetImpl();
@@ -79,8 +78,6 @@ public abstract class AbstractEEFControllerTests {
this.resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put("ecore", new EcoreResourceFactoryImpl()); //$NON-NLS-1$
AdapterFactory adapterFactory = new ComposedAdapterFactory(ComposedAdapterFactory.Descriptor.Registry.INSTANCE);
- this.editingDomain = new TransactionalEditingDomainImpl(adapterFactory, this.resourceSet);
-
this.interpreter = new AQLInterpreter();
}
diff --git a/tests/org.eclipse.eef.tests/src/org/eclipse/eef/tests/internal/controllers/EEFButtonControllerTests.java b/tests/org.eclipse.eef.tests/src/org/eclipse/eef/tests/internal/controllers/EEFButtonControllerTests.java
index b25e11725..8b9140872 100644
--- a/tests/org.eclipse.eef.tests/src/org/eclipse/eef/tests/internal/controllers/EEFButtonControllerTests.java
+++ b/tests/org.eclipse.eef.tests/src/org/eclipse/eef/tests/internal/controllers/EEFButtonControllerTests.java
@@ -39,7 +39,7 @@ public class EEFButtonControllerTests extends AbstractEEFControllerTests {
private IEEFButtonController buttonController(String modelPath) {
EClassifier eClassifier = this.ePackage(DART_ECORE, 0).getEClassifier(PROJECT_ECLASS_NAME);
EEFButtonDescription description = widget(group(page(modelPath, 0), 0), EEFButtonDescription.class, 0);
- return new EEFButtonController(description, newVariableManager(eClassifier), this.interpreter, this.editingDomain);
+ return new EEFButtonController(description, newVariableManager(eClassifier), this.interpreter, this.contextAdapter);
}
@Test
@@ -58,8 +58,8 @@ public class EEFButtonControllerTests extends AbstractEEFControllerTests {
IEEFButtonController controller = this.buttonController(EEFDataTests.EEFBUTTONCONTROLLERTESTS_BUTTONLABEL);
controller.onNewButtonLabel(label -> {
assertThat(label, is("OK")); //$NON-NLS-1$
- atomicBoolean.set(true);
- });
+ atomicBoolean.set(true);
+ });
controller.refresh();
assertTrue(atomicBoolean.get());
}
diff --git a/tests/org.eclipse.eef.tests/src/org/eclipse/eef/tests/internal/controllers/EEFCheckboxControllerTests.java b/tests/org.eclipse.eef.tests/src/org/eclipse/eef/tests/internal/controllers/EEFCheckboxControllerTests.java
index f034e1dfa..88a0f8da2 100644
--- a/tests/org.eclipse.eef.tests/src/org/eclipse/eef/tests/internal/controllers/EEFCheckboxControllerTests.java
+++ b/tests/org.eclipse.eef.tests/src/org/eclipse/eef/tests/internal/controllers/EEFCheckboxControllerTests.java
@@ -39,7 +39,7 @@ public class EEFCheckboxControllerTests extends AbstractEEFControllerTests {
private IEEFCheckboxController checkboxController(String modelPath) {
EClassifier eClassifier = this.ePackage(DART_ECORE, 0).getEClassifier(PROJECT_ECLASS_NAME);
EEFCheckboxDescription description = widget(group(page(modelPath, 0), 0), EEFCheckboxDescription.class, 0);
- return new EEFCheckboxController(description, newVariableManager(eClassifier), this.interpreter, this.editingDomain);
+ return new EEFCheckboxController(description, newVariableManager(eClassifier), this.interpreter, this.contextAdapter);
}
@Test
diff --git a/tests/org.eclipse.eef.tests/src/org/eclipse/eef/tests/internal/controllers/EEFRadioControllerTests.java b/tests/org.eclipse.eef.tests/src/org/eclipse/eef/tests/internal/controllers/EEFRadioControllerTests.java
index 7d17c5aa1..215ae7fe4 100644
--- a/tests/org.eclipse.eef.tests/src/org/eclipse/eef/tests/internal/controllers/EEFRadioControllerTests.java
+++ b/tests/org.eclipse.eef.tests/src/org/eclipse/eef/tests/internal/controllers/EEFRadioControllerTests.java
@@ -39,7 +39,7 @@ public class EEFRadioControllerTests extends AbstractEEFControllerTests {
private IEEFRadioController radioController(String modelPath) {
EClassifier eClassifier = this.ePackage(DART_ECORE, 0).getEClassifier(PROJECT_ECLASS_NAME);
EEFRadioDescription description = widget(group(page(modelPath, 0), 0), EEFRadioDescription.class, 0);
- return new EEFRadioController(description, newVariableManager(eClassifier), this.interpreter, this.editingDomain);
+ return new EEFRadioController(description, newVariableManager(eClassifier), this.interpreter, this.contextAdapter);
}
@Test
diff --git a/tests/org.eclipse.eef.tests/src/org/eclipse/eef/tests/internal/controllers/EEFSelectControllerTests.java b/tests/org.eclipse.eef.tests/src/org/eclipse/eef/tests/internal/controllers/EEFSelectControllerTests.java
index a9c09963c..78e0a22bf 100644
--- a/tests/org.eclipse.eef.tests/src/org/eclipse/eef/tests/internal/controllers/EEFSelectControllerTests.java
+++ b/tests/org.eclipse.eef.tests/src/org/eclipse/eef/tests/internal/controllers/EEFSelectControllerTests.java
@@ -39,7 +39,7 @@ public class EEFSelectControllerTests extends AbstractEEFControllerTests {
private IEEFSelectController selectController(String modelPath) {
EClassifier eClassifier = this.ePackage(DART_ECORE, 0).getEClassifier(PROJECT_ECLASS_NAME);
EEFSelectDescription description = widget(group(page(modelPath, 0), 0), EEFSelectDescription.class, 0);
- return new EEFSelectController(description, newVariableManager(eClassifier), this.interpreter, this.editingDomain);
+ return new EEFSelectController(description, newVariableManager(eClassifier), this.interpreter, this.contextAdapter);
}
@Test
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 0c032b046..68dbf56ba 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
@@ -40,7 +40,7 @@ public class EEFTextControllerTests extends AbstractEEFControllerTests {
private IEEFTextController textController(String modelPath) {
EClassifier eClassifier = this.ePackage(DART_ECORE, 0).getEClassifier(PROJECT_ECLASS_NAME);
EEFTextDescription description = widget(group(page(modelPath, 0), 0), EEFTextDescription.class, 0);
- return new EEFTextController(description, newVariableManager(eClassifier), this.interpreter, this.editingDomain);
+ return new EEFTextController(description, newVariableManager(eClassifier), this.interpreter, this.contextAdapter);
}
@Test

Back to the top