X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=bundles%2Forg.simantics.spreadsheet%2Fsrc%2Forg%2Fsimantics%2Fspreadsheet%2FCellEditor.java;h=4448a87988c67f6d59447187749f736ff15e388f;hb=HEAD;hp=3fb6a7329a93e039e033855d62211109446700c0;hpb=969bd23cab98a79ca9101af33334000879fb60c5;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.spreadsheet/src/org/simantics/spreadsheet/CellEditor.java b/bundles/org.simantics.spreadsheet/src/org/simantics/spreadsheet/CellEditor.java index 3fb6a7329..4448a8798 100644 --- a/bundles/org.simantics.spreadsheet/src/org/simantics/spreadsheet/CellEditor.java +++ b/bundles/org.simantics.spreadsheet/src/org/simantics/spreadsheet/CellEditor.java @@ -1,72 +1,49 @@ -/******************************************************************************* - * Copyright (c) 2007, 2010 Association for Decentralized Information Management - * in Industry THTH ry. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * VTT Technical Research Centre of Finland - initial API and implementation - *******************************************************************************/ -package org.simantics.spreadsheet; - -import java.util.List; -import java.util.function.Consumer; - -import org.simantics.databoard.binding.Binding; -import org.simantics.databoard.binding.mutable.MutableVariant; -import org.simantics.databoard.binding.mutable.Variant; -import org.simantics.spreadsheet.ClientModel.OperationMode; - -public interface CellEditor { - - public interface Transaction { - - void setContext(Object context); - - Object getContext(); - - void add(O operation); - - /* - * Applies the operations collected with this transaction - * - */ - void commit(); - - boolean isOperationMode(); - - List needSynchronization(); - - void needSynchronization(Object synchronizable); - } - - /* - * Sets the given property of the given cell - * - * @param transaction a combined transaction, null for immediate change - * @param location a cell location e.g. 'A1' - * @param property the name of the property - * @param value the property value - * @param binding used for serializing the value - */ - void edit(Transaction transaction, String location, String property, T value, Binding binding, Consumer callback); - /* - * Edits the given cell using the given textual input - * - * @param transaction a combined transaction, null for immediate change - * @param location a cell location e.g. 'A1' - * @param value a text describing the change - */ - void edit(Transaction transaction, String location, Variant variant, Consumer callback); - - void copy(Transaction transaction, String location, MutableVariant variant, Consumer callback); - - /* - * Creates a new transaction object - * - */ - Transaction startTransaction(OperationMode mode); - -} +/******************************************************************************* + * Copyright (c) 2007, 2010 Association for Decentralized Information Management + * in Industry THTH ry. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * VTT Technical Research Centre of Finland - initial API and implementation + *******************************************************************************/ +package org.simantics.spreadsheet; + +import java.util.function.Consumer; + +import org.simantics.databoard.binding.Binding; +import org.simantics.databoard.binding.mutable.MutableVariant; +import org.simantics.databoard.binding.mutable.Variant; + +public interface CellEditor { + + /* + * Sets the given property of the given cell + * + * @param transaction a combined transaction, null for immediate change + * @param location a cell location e.g. 'A1' + * @param property the name of the property + * @param value the property value + * @param binding used for serializing the value + */ + void edit(Transaction transaction, String location, String property, T value, Binding binding, Consumer callback); + /* + * Edits the given cell using the given textual input + * + * @param transaction a combined transaction, null for immediate change + * @param location a cell location e.g. 'A1' + * @param value a text describing the change + */ + void edit(Transaction transaction, String location, Variant variant, Consumer callback); + + void copy(Transaction transaction, String location, MutableVariant variant, Consumer callback); + + /* + * Creates a new transaction object + * + */ + Transaction startTransaction(OperationMode mode); + +}