1 package org.simantics.spreadsheet.graph.synchronization;
3 import java.util.Collection;
6 import org.simantics.databoard.binding.mutable.Variant;
7 import org.simantics.structural.synchronization.utils.CommandBuilder;
8 import org.simantics.structural.synchronization.utils.ModuleUpdateContext;
9 import org.simantics.structural.synchronization.utils.ModuleUpdaterBase;
10 import org.simantics.structural.synchronization.utils.PropertyUpdateRule;
12 public class LineNodeUpdater extends ModuleUpdaterBase<SheetLineComponent> {
14 public LineNodeUpdater(String id) {
20 addPropertyUpdateRule(new PropertyUpdateRule<SheetLineComponent>() {
23 public String getPropertyName() {
28 public void apply(ModuleUpdateContext<SheetLineComponent> context, boolean isCreating,
29 Map<String, Variant> propertyMap, Map<String, Collection<String>> connectionMap, Variant value) {
31 LinesCommandBuilder builder = context.<LinesCommandBuilder>getConcreteCommand();
32 Variant v = propertyMap.get("keys");
33 if (v != null & v.getValue() != null)
34 builder.keys = (int[])v.getValue();
43 public CommandBuilder createAddCommandBuilder(String name) {
44 return new LinesCommandBuilder(name, false);
48 public CommandBuilder createUpdateCommandBuilder(String name) {
49 return new LinesCommandBuilder(name, true);