diff options
author | Pierre-Charles David | 2015-11-24 16:04:51 +0000 |
---|---|---|
committer | Pierre-Charles David | 2015-11-24 16:04:51 +0000 |
commit | 1a5555a94ead10b03b046aa2dee617081e5a85f6 (patch) | |
tree | b038e163ef8c068a88e1cbb17b6ba963597e1f8c | |
parent | 4c362615ceb77f6564a0c216c1e6605124266883 (diff) | |
download | org.eclipse.eef-1a5555a94ead10b03b046aa2dee617081e5a85f6.tar.gz org.eclipse.eef-1a5555a94ead10b03b046aa2dee617081e5a85f6.tar.xz org.eclipse.eef-1a5555a94ead10b03b046aa2dee617081e5a85f6.zip |
Remove the RecordingCommand from EEFTextImpl.updateValue()
RecordingCommand implies we want a read/write transaction, which
requires eclusive lock on the ResourceSet and can not be done from a
post-commit listener (which is where we are un updateValue()), causing
EMF Tx to throw an exception.
From an EMF Tx point of view updateValue() only reads the model so
nothing special is needed.
Change-Id: Ie22c21fa5339793bae5b85350560cf1ff33cb5dd
Signed-off-by: Pierre-Charles David <pierre-charles.david@obeo.fr>
-rw-r--r-- | plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/internal/EEFTextImpl.java | 36 |
1 files changed, 10 insertions, 26 deletions
diff --git a/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/internal/EEFTextImpl.java b/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/internal/EEFTextImpl.java index 9982b6e65..66e985321 100644 --- a/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/internal/EEFTextImpl.java +++ b/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/internal/EEFTextImpl.java @@ -21,9 +21,6 @@ import org.eclipse.eef.core.api.IConsumer; import org.eclipse.eef.core.api.IVariableManager; import org.eclipse.eef.interpreter.api.IEvaluationResult; import org.eclipse.eef.interpreter.api.IInterpreter; -import org.eclipse.emf.common.command.Command; -import org.eclipse.emf.common.command.CommandStack; -import org.eclipse.emf.transaction.RecordingCommand; import org.eclipse.emf.transaction.TransactionalEditingDomain; /** @@ -120,29 +117,16 @@ public class EEFTextImpl extends AbstractEEFWidgetImpl implements EEFText { @Override public void updateValue(final Object selection, final String newValue) { - Command command = new RecordingCommand(this.editingDomain) { - @Override - protected void doExecute() { - String editExpression = EEFTextImpl.this.eefTextDescription.getEditExpression(); - if (editExpression != null) { - Map<String, Object> variables = new HashMap<String, Object>(); - variables.putAll(EEFTextImpl.this.getVariableManager().getVariables()); - variables.put(EEFExpressionUtils.EEFText.NEW_VALUE, newValue); - - // FIXME REMOVE THIS HARDCODED STUFF!!!! - variables.put("selection", selection); //$NON-NLS-1$ - EEFTextImpl.this.getInterpreter().evaluateExpression(variables, editExpression); - } - } - - @Override - public boolean canExecute() { - return true; - } - }; - - CommandStack commandStack = this.editingDomain.getCommandStack(); - commandStack.execute(command); + String editExpression = EEFTextImpl.this.eefTextDescription.getEditExpression(); + if (editExpression != null) { + Map<String, Object> variables = new HashMap<String, Object>(); + variables.putAll(EEFTextImpl.this.getVariableManager().getVariables()); + variables.put(EEFExpressionUtils.EEFText.NEW_VALUE, newValue); + + // FIXME REMOVE THIS HARDCODED STUFF!!!! + variables.put("selection", selection); //$NON-NLS-1$ + EEFTextImpl.this.getInterpreter().evaluateExpression(variables, editExpression); + } } /** |