--- /dev/null
+/*******************************************************************************\r
+ * Copyright (c) 2007, 2010 Association for Decentralized Information Management\r
+ * in Industry THTH ry.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * VTT Technical Research Centre of Finland - initial API and implementation\r
+ *******************************************************************************/\r
+package org.simantics.spreadsheet;\r
+\r
+import java.util.List;\r
+import java.util.function.Consumer;\r
+\r
+import org.simantics.databoard.binding.Binding;\r
+import org.simantics.databoard.binding.mutable.MutableVariant;\r
+import org.simantics.databoard.binding.mutable.Variant;\r
+import org.simantics.spreadsheet.ClientModel.OperationMode;\r
+\r
+public interface CellEditor<O> {\r
+ \r
+ public interface Transaction<O> {\r
+ \r
+ void setContext(Object context);\r
+ \r
+ Object getContext();\r
+ \r
+ void add(O operation);\r
+ \r
+ /*\r
+ * Applies the operations collected with this transaction\r
+ * \r
+ */\r
+ void commit();\r
+ \r
+ boolean isOperationMode();\r
+ \r
+ List<Object> needSynchronization();\r
+\r
+ void needSynchronization(Object synchronizable);\r
+ }\r
+ \r
+ /*\r
+ * Sets the given property of the given cell\r
+ * \r
+ * @param transaction a combined transaction, null for immediate change\r
+ * @param location a cell location e.g. 'A1'\r
+ * @param property the name of the property\r
+ * @param value the property value\r
+ * @param binding used for serializing the value \r
+ */\r
+ <T> void edit(Transaction<O> transaction, String location, String property, T value, Binding binding, Consumer<?> callback);\r
+ /*\r
+ * Edits the given cell using the given textual input\r
+ * \r
+ * @param transaction a combined transaction, null for immediate change\r
+ * @param location a cell location e.g. 'A1'\r
+ * @param value a text describing the change\r
+ */\r
+ void edit(Transaction<O> transaction, String location, Variant variant, Consumer<?> callback);\r
+\r
+ void copy(Transaction<O> transaction, String location, MutableVariant variant, Consumer<?> callback);\r
+ \r
+ /*\r
+ * Creates a new transaction object\r
+ * \r
+ */\r
+ Transaction<O> startTransaction(OperationMode mode);\r
+ \r
+}\r