1 /*******************************************************************************
2 * Copyright (c) 2007, 2010 Association for Decentralized Information Management
4 * All rights reserved. This program and the accompanying materials
5 * are made available under the terms of the Eclipse Public License v1.0
6 * which accompanies this distribution, and is available at
7 * http://www.eclipse.org/legal/epl-v10.html
10 * VTT Technical Research Centre of Finland - initial API and implementation
11 *******************************************************************************/
12 package org.simantics.spreadsheet;
14 import java.util.function.Consumer;
16 import org.simantics.databoard.binding.Binding;
17 import org.simantics.databoard.binding.mutable.MutableVariant;
18 import org.simantics.databoard.binding.mutable.Variant;
20 public interface CellEditor<O> {
23 * Sets the given property of the given cell
25 * @param transaction a combined transaction, null for immediate change
26 * @param location a cell location e.g. 'A1'
27 * @param property the name of the property
28 * @param value the property value
29 * @param binding used for serializing the value
31 <T> void edit(Transaction<O> transaction, String location, String property, T value, Binding binding, Consumer<?> callback);
33 * Edits the given cell using the given textual input
35 * @param transaction a combined transaction, null for immediate change
36 * @param location a cell location e.g. 'A1'
37 * @param value a text describing the change
39 void edit(Transaction<O> transaction, String location, Variant variant, Consumer<?> callback);
41 void copy(Transaction<O> transaction, String location, MutableVariant variant, Consumer<?> callback);
44 * Creates a new transaction object
47 Transaction<O> startTransaction(OperationMode mode);