Skip to content

Package: LeafRendererTester

LeafRendererTester

nameinstructionbranchcomplexitylinemethod
LeafRendererTester()
M: 3 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
isApplicable(VElement, ViewModelContext)
M: 17 C: 0
0%
M: 4 C: 0
0%
M: 3 C: 0
0%
M: 5 C: 0
0%
M: 1 C: 0
0%

Coverage

1: /*******************************************************************************
2: * Copyright (c) 2011-2013 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: * Johannes Faltermeier - initial API and implementation
13: ******************************************************************************/
14: package org.eclipse.emf.ecp.view.internal.section.swt;
15:
16: import org.eclipse.emf.ecp.view.model.common.ECPRendererTester;
17: import org.eclipse.emf.ecp.view.spi.context.ViewModelContext;
18: import org.eclipse.emf.ecp.view.spi.model.VElement;
19: import org.eclipse.emf.ecp.view.spi.section.model.VSection;
20:
21: /**
22: * {@link ECPRendererTester} for {@link org.eclipse.emf.ecp.view.spi.section.swt.SectionLeafSWTRenderer
23: * SectionLeafSWTRenderer}.
24: *
25: * @author jfaltermeier
26: *
27: */
28: public class LeafRendererTester implements ECPRendererTester {
29:
30:         @Override
31:         public int isApplicable(VElement vElement, ViewModelContext viewModelContext) {
32:•                if (!VSection.class.isInstance(vElement)) {
33:                         return NOT_APPLICABLE;
34:                 }
35:•                if (VSection.class.cast(vElement).getChildItems().size() == 0) {
36:                         return 6;
37:                 }
38:                 return NOT_APPLICABLE;
39:         }
40:
41: }