1 package org.simantics.db.layer0.variable;
3 import org.simantics.databoard.binding.Binding;
4 import org.simantics.databoard.binding.error.BindingException;
5 import org.simantics.db.common.utils.Logger;
6 import org.simantics.db.service.ExternalOperation;
7 import org.simantics.simulator.variable.NodeManager;
8 import org.simantics.simulator.variable.exceptions.NodeManagerException;
10 public class ExternalSetValue implements ExternalOperation {
12 @SuppressWarnings("rawtypes")
13 final private NodeManager manager;
14 final private Object node;
15 final private Object oldValue;
16 final private Object newValue;
17 final private Binding binding;
19 public ExternalSetValue(@SuppressWarnings("rawtypes") NodeManager manager, Object node, Object oldValue, Object newValue, Binding binding) {
20 this.manager = manager;
22 this.oldValue = oldValue;
23 this.newValue = newValue;
24 this.binding = binding;
27 @SuppressWarnings("unchecked")
31 manager.setValue(node, oldValue, binding);
32 } catch (NodeManagerException | BindingException e) {
33 Logger.defaultLogError(e);
37 @SuppressWarnings("unchecked")
41 manager.setValue(node, newValue, binding);
42 } catch (NodeManagerException | BindingException e) {
43 Logger.defaultLogError(e);
48 public boolean isDisposed() {