1 package org.simantics.spreadsheet.synchronization;
3 import java.util.Collection;
6 import org.simantics.databoard.binding.mutable.Variant;
7 import org.simantics.spreadsheet.solver.SheetLineComponent;
8 import org.simantics.structural.synchronization.base.CommandBuilder;
9 import org.simantics.structural.synchronization.base.ModuleUpdateContext;
10 import org.simantics.structural.synchronization.base.ModuleUpdaterBase;
11 import org.simantics.structural.synchronization.base.PropertyUpdateRule;
13 public class LineNodeUpdater extends ModuleUpdaterBase<SheetLineComponent> {
15 public LineNodeUpdater(String id) {
21 addPropertyUpdateRule(new PropertyUpdateRule<SheetLineComponent>() {
24 public String getPropertyName() {
29 public void apply(ModuleUpdateContext<SheetLineComponent> context, boolean isCreating,
30 Map<String, Variant> propertyMap, Map<String, Collection<String>> connectionMap, Variant value) {
32 LinesCommandBuilder builder = context.<LinesCommandBuilder>getConcreteCommand();
33 Variant v = propertyMap.get("keys");
34 if (v != null & v.getValue() != null)
35 builder.keys = (int[])v.getValue();
44 public CommandBuilder createAddCommandBuilder(String name) {
45 return new LinesCommandBuilder(name, false);
49 public CommandBuilder createUpdateCommandBuilder(String name) {
50 return new LinesCommandBuilder(name, true);