Skip to content

Package: RAPGridControlSWTRendererService

RAPGridControlSWTRendererService

nameinstructionbranchcomplexitylinemethod
RAPGridControlSWTRendererService()
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%
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: 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-2019 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: * EclipseSource Munich - initial API and implementation
13: */
14: package org.eclipse.emf.ecp.view.internal.table.ui.nebula.grid.rap;
15:
16: import org.eclipse.emf.ecp.view.spi.context.ViewModelContext;
17: import org.eclipse.emf.ecp.view.spi.model.VElement;
18: import org.eclipse.emf.ecp.view.spi.table.model.DetailEditing;
19: import org.eclipse.emf.ecp.view.spi.table.model.VTableControl;
20: import org.eclipse.emf.ecp.view.spi.table.nebula.grid.rap.RAPGridControlSWTRenderer;
21: import org.eclipse.emfforms.spi.swt.core.AbstractSWTRenderer;
22: import org.eclipse.emfforms.spi.swt.core.di.EMFFormsDIRendererService;
23: import org.osgi.service.component.annotations.Component;
24:
25: /** Renderer service for the {@link RAPGridControlSWTRenderer}. */
26: @Component(name = "RAPGridControlSWTRendererService")
27: public class RAPGridControlSWTRendererService implements EMFFormsDIRendererService<VTableControl> {
28:
29:         @Override
30:         public double isApplicable(VElement vElement, ViewModelContext viewModelContext) {
31:•                if (!VTableControl.class.isInstance(vElement)) {
32:                         return NOT_APPLICABLE;
33:                 }
34:•                if (DetailEditing.NONE == VTableControl.class.cast(vElement).getDetailEditing()) {
35:                         return 200;
36:                 }
37:                 return NOT_APPLICABLE;
38:         }
39:
40:         @Override
41:         public Class<? extends AbstractSWTRenderer<VTableControl>> getRendererClass() {
42:                 return RAPGridControlSWTRenderer.class;
43:         }
44:
45: }