Skip to content

Package: GridControlSWTRendererService

GridControlSWTRendererService

nameinstructionbranchcomplexitylinemethod
GridControlSWTRendererService()
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: 0 C: 2
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
isApplicable(VElement, ViewModelContext)
M: 0 C: 17
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) 2011-2016 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: * Alexandra Buzila - initial API and implementation
13: ******************************************************************************/
14: package org.eclipse.emf.ecp.view.internal.table.nebula.grid;
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.GridControlSWTRenderer;
21: import org.eclipse.emfforms.spi.swt.core.AbstractSWTRenderer;
22: import org.eclipse.emfforms.spi.swt.core.di.EMFFormsDIRendererService;
23:
24: /** Renderer service for the {@link GridControlSWTRenderer}. */
25: public class GridControlSWTRendererService implements EMFFormsDIRendererService<VTableControl> {
26:
27:         @Override
28:         public double isApplicable(VElement vElement, ViewModelContext viewModelContext) {
29:•                if (!VTableControl.class.isInstance(vElement)) {
30:                         return NOT_APPLICABLE;
31:                 }
32:•                if (DetailEditing.NONE == VTableControl.class.cast(vElement).getDetailEditing()) {
33:                         return 12;
34:                 }
35:                 return NOT_APPLICABLE;
36:         }
37:
38:         @Override
39:         public Class<? extends AbstractSWTRenderer<VTableControl>> getRendererClass() {
40:                 return GridControlSWTRenderer.class;
41:         }
42:
43: }