| /*=============================================================================# |
| # Copyright (c) 2012, 2021 Original NatTable authors and others. |
| # |
| # This program and the accompanying materials are made available under the |
| # terms of the Eclipse Public License 2.0 which is available at |
| # https://www.eclipse.org/legal/epl-2.0. |
| # |
| # SPDX-License-Identifier: EPL-2.0 |
| # |
| # Contributors: |
| # Original NatTable authors and others - initial API and implementation |
| #=============================================================================*/ |
| |
| package org.eclipse.statet.ecommons.waltable.edit; |
| |
| import org.eclipse.statet.ecommons.waltable.coordinate.Direction; |
| import org.eclipse.statet.ecommons.waltable.edit.editor.ICellEditor; |
| |
| |
| /** |
| * Handles the updating of the data bean with the new value provided |
| * by the {@link ICellEditor}. |
| */ |
| public interface ICellEditHandler { |
| |
| /** |
| * Commit the new value and handle the selection in the current NatTable after |
| * commit. This is necessary to support spreadsheet like behaviour, e.g. after |
| * committing a value entered in a text editor by pressing tab, the selection |
| * should move to the right. To avoid unnecessary dependencies in the editors |
| * itself, this is handled in here. |
| * @param canonicalValue The value to commit. |
| * @param direction The direction to move the selection after commit. |
| * @return <code>true</code> if the data update succeeded, <code>false</code> |
| * if something went wrong |
| */ |
| public boolean commit(Object canonicalValue, Direction direction); |
| |
| } |