1 package org.simantics.spreadsheet.synchronization;
3 import java.util.Collection;
6 import org.simantics.databoard.adapter.AdaptException;
7 import org.simantics.databoard.binding.mutable.Variant;
8 import org.simantics.spreadsheet.solver.SheetLineComponent;
9 import org.simantics.structural.synchronization.base.CommandBuilder;
10 import org.simantics.structural.synchronization.base.ModuleUpdateContext;
11 import org.simantics.structural.synchronization.base.ModuleUpdaterBase;
12 import org.simantics.structural.synchronization.base.PropertyUpdateRule;
14 public class LineUpdater extends ModuleUpdaterBase<SheetLineComponent> {
16 public LineUpdater(String id) {
18 addPropertyUpdateRule(new PropertyUpdateRule<SheetLineComponent>() {
20 public String getPropertyName() {
24 public void apply(ModuleUpdateContext<SheetLineComponent> context, boolean isCreating,
25 Map<String, Variant> propertyMap, Map<String, Collection<String>> connectionMap, Variant value) {
26 System.err.println("LineUpdater.apply " + value);
27 LineCommandBuilder builder = context.<LineCommandBuilder>getConcreteCommand();
29 LineContentBean valuee = (LineContentBean) value.getValue(LineContentBean.BINDING);
30 builder.bean = valuee;
31 } catch (AdaptException e) {
33 } catch (ClassCastException e) {
41 public CommandBuilder createAddCommandBuilder(String name) {
42 return new LineCommandBuilder(name, false);
46 public CommandBuilder createUpdateCommandBuilder(String name) {
47 return new LineCommandBuilder(name, true);