Skip to content

Package: MultiReferenceCellEditorTester

MultiReferenceCellEditorTester

nameinstructionbranchcomplexitylinemethod
MultiReferenceCellEditorTester()
M: 0 C: 3
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
isApplicable(EObject, EStructuralFeature, ViewModelContext)
M: 0 C: 13
100%
M: 0 C: 4
100%
M: 0 C: 3
100%
M: 0 C: 5
100%
M: 0 C: 1
100%

Coverage

1: /*******************************************************************************
2: * Copyright (c) 2017 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.view.internal.table.swt.cell;
15:
16: import org.eclipse.emf.ecore.EAttribute;
17: import org.eclipse.emf.ecore.EObject;
18: import org.eclipse.emf.ecore.EStructuralFeature;
19: import org.eclipse.emf.ecp.edit.spi.swt.table.ECPCellEditorTester;
20: import org.eclipse.emf.ecp.view.spi.context.ViewModelContext;
21:
22: /**
23: * Tester for the {@link MultiReferenceCellEditor }.
24: *
25: * @since 1.18
26: */
27: public class MultiReferenceCellEditorTester implements ECPCellEditorTester {
28:
29:         @Override
30:         public int isApplicable(EObject eObject, EStructuralFeature eStructuralFeature, ViewModelContext viewModelContext) {
31:•                if (!eStructuralFeature.isMany()) {
32:                         return NOT_APPLICABLE;
33:                 }
34:
35:•                if (EAttribute.class.isInstance(eStructuralFeature)) {
36:                         return NOT_APPLICABLE;
37:                 }
38:
39:                 return 5;
40:         }
41: }