Skip to content

Package: CompoundControlDIRendererService

CompoundControlDIRendererService

nameinstructionbranchcomplexitylinemethod
CompoundControlDIRendererService()
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%
getRendererClass()
M: 2 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: 2 C: 6
75%
M: 1 C: 1
50%
M: 1 C: 1
50%
M: 1 C: 2
67%
M: 0 C: 1
100%

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: * Johannes Faltermeier - initial API and implementation
13: ******************************************************************************/
14: package org.eclipse.emf.ecp.view.internal.compoundcontrol.swt;
15:
16: import org.eclipse.emf.ecp.view.spi.compoundcontrol.model.VCompoundControl;
17: import org.eclipse.emf.ecp.view.spi.compoundcontrol.swt.CompoundControlSWTRenderer;
18: import org.eclipse.emf.ecp.view.spi.context.ViewModelContext;
19: import org.eclipse.emf.ecp.view.spi.model.VElement;
20: import org.eclipse.emfforms.spi.swt.core.AbstractSWTRenderer;
21: import org.eclipse.emfforms.spi.swt.core.di.EMFFormsDIRendererService;
22: import org.osgi.service.component.annotations.Component;
23:
24: /**
25: *
26: * {@link EMFFormsDIRendererService Renderer service} for {@link CompoundControlSWTRenderer}.
27: *
28: * @author Johannes Faltermeier
29: *
30: */
31: @Component(name = "CompoundControlDIRendererService")
32: public class CompoundControlDIRendererService implements EMFFormsDIRendererService<VCompoundControl> {
33:
34:         @Override
35:         public double isApplicable(VElement vElement, ViewModelContext viewModelContext) {
36:•                if (!VCompoundControl.class.isInstance(vElement)) {
37:                         return NOT_APPLICABLE;
38:                 }
39:                 return 3d;
40:         }
41:
42:         @Override
43:         public Class<? extends AbstractSWTRenderer<VCompoundControl>> getRendererClass() {
44:                 return CompoundControlSWTRenderer.class;
45:         }
46:
47: }