]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.spreadsheet/src/org/simantics/spreadsheet/CellEditor.java
Adopt spreadsheet changes made in Balas development
[simantics/platform.git] / bundles / org.simantics.spreadsheet / src / org / simantics / spreadsheet / CellEditor.java
1 /*******************************************************************************
2  * Copyright (c) 2007, 2010 Association for Decentralized Information Management
3  * in Industry THTH ry.
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
8  *
9  * Contributors:
10  *     VTT Technical Research Centre of Finland - initial API and implementation
11  *******************************************************************************/
12 package org.simantics.spreadsheet;
13
14 import java.util.function.Consumer;
15
16 import org.simantics.databoard.binding.Binding;
17 import org.simantics.databoard.binding.mutable.MutableVariant;
18 import org.simantics.databoard.binding.mutable.Variant;
19
20 public interface CellEditor<O> {
21
22     /*
23      * Sets the given property of the given cell
24      * 
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 
30      */
31     <T> void edit(Transaction<O> transaction, String location, String property, T value, Binding binding, Consumer<?> callback);
32     /*
33      * Edits the given cell using the given textual input
34      * 
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
38      */
39     void edit(Transaction<O> transaction, String location, Variant variant, Consumer<?> callback);
40
41     void copy(Transaction<O> transaction, String location, MutableVariant variant, Consumer<?> callback);
42
43     /*
44      * Creates a new transaction object
45      * 
46      */
47     Transaction<O> startTransaction(OperationMode mode);
48
49 }