Skip to content

Package: ECPCellEditorTester

ECPCellEditorTester

Coverage

1: /*******************************************************************************
2: * Copyright (c) 2011-2015 EclipseSource Muenchen GmbH and others.
3: *
4: * All rights reserved. This program and the accompanying materials
5: * are made available under the terms of the Eclipse Public License 2.0
6: * which accompanies this distribution, and is available at
7: * https://www.eclipse.org/legal/epl-2.0/
8: *
9: * SPDX-License-Identifier: EPL-2.0
10: *
11: * Contributors:
12: * Eugen Neufeld - initial API and implementation
13: ******************************************************************************/
14: package org.eclipse.emf.ecp.edit.spi.swt.table;
15:
16: import org.eclipse.emf.ecore.EObject;
17: import org.eclipse.emf.ecore.EStructuralFeature;
18: import org.eclipse.emf.ecp.view.spi.context.ViewModelContext;
19:
20: /**
21: * This interface defines a {@link #isApplicable(EObject, EStructuralFeature, ViewModelContext)} method which is used to
22: * determine
23: * the priority of a celleditor. The celleditor with the highest priority for a combination of an {@link EObject} and a
24: * feature will be used.
25: *
26: * @author Eugen Neufeld
27: * @since 1.5
28: */
29: public interface ECPCellEditorTester {
30:         /**
31:          * Return this whenever the renderer should not be used for the tested {@link ViewModelContext}.
32:          */
33:         int NOT_APPLICABLE = -1;
34:
35:         /**
36:          * Returns the priority of the corresponding celleditor for the combination of the {@link EObject} and the
37:          * {@link EStructuralFeature}.
38:          *
39:          * @param eStructuralFeature the {@link EStructuralFeature} to test
40:          * @param eObject the {@link EObject} to test
41:          * @param viewModelContext the {@link ViewModelContext} to check
42:          * @return {@link #NOT_APPLICABLE} if the corresponding celleditor should not be used, a positive integer value
43:          * otherwise. The celleditor with the highest priority will be taken.
44:          * @since 1.2
45:          */
46:         int isApplicable(EObject eObject, EStructuralFeature eStructuralFeature, ViewModelContext viewModelContext);
47: }