Skip to content

Package: EmptyVElementSWTRenderer

EmptyVElementSWTRenderer

nameinstructionbranchcomplexitylinemethod
EmptyVElementSWTRenderer(VElement, ViewModelContext, ReportService)
M: 41 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 11 C: 0
0%
M: 1 C: 0
0%
applyEnable()
M: 1 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
applyValidation()
M: 1 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
applyVisible()
M: 1 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
getGridDescription(SWTGridDescription)
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%
renderControl(SWTGridCell, Composite)
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%

Coverage

1: /*******************************************************************************
2: * Copyright (c) 2011-2014 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: * Edgar Mueller - initial API and implementation
13: ******************************************************************************/
14: package org.eclipse.emf.ecp.view.internal.swt;
15:
16: import java.util.ArrayList;
17: import java.util.List;
18:
19: import org.eclipse.emf.ecp.view.spi.context.ViewModelContext;
20: import org.eclipse.emf.ecp.view.spi.model.VElement;
21: import org.eclipse.emf.ecp.view.spi.renderer.NoPropertyDescriptorFoundExeption;
22: import org.eclipse.emf.ecp.view.spi.renderer.NoRendererFoundException;
23: import org.eclipse.emfforms.spi.common.report.ReportService;
24: import org.eclipse.emfforms.spi.swt.core.AbstractSWTRenderer;
25: import org.eclipse.emfforms.spi.swt.core.layout.GridDescriptionFactory;
26: import org.eclipse.emfforms.spi.swt.core.layout.SWTGridCell;
27: import org.eclipse.emfforms.spi.swt.core.layout.SWTGridDescription;
28: import org.eclipse.swt.widgets.Composite;
29: import org.eclipse.swt.widgets.Control;
30:
31: /**
32: * An no-op renderer.
33: *
34: * @author emueller
35: * @since 1.3
36: *
37: */
38: public final class EmptyVElementSWTRenderer extends AbstractSWTRenderer<VElement> {
39:
40:         private final SWTGridDescription gridDescription;
41:
42:         /**
43:          * @param vElement the view model element to be rendered
44:          * @param viewContext the view context
45:          * @param reportService teh {@link ReportService}
46:          */
47:         public EmptyVElementSWTRenderer(VElement vElement, ViewModelContext viewContext, ReportService reportService) {
48:                 super(vElement, viewContext, reportService);
49:                 gridDescription = GridDescriptionFactory.INSTANCE.createEmptyGridDescription();
50:                 final SWTGridCell gc = new SWTGridCell(0, 0, this);
51:                 gc.setHorizontalFill(true);
52:                 gc.setHorizontalGrab(true);
53:                 gc.setVerticalFill(false);
54:                 gc.setVerticalGrab(false);
55:                 final List<SWTGridCell> grid = new ArrayList<SWTGridCell>();
56:                 grid.add(gc);
57:                 gridDescription.setGrid(grid);
58:         }
59:
60:         /**
61:          * {@inheritDoc}
62:          *
63:          * @see org.eclipse.emfforms.spi.swt.core.AbstractSWTRenderer#getGridDescription(org.eclipse.emfforms.spi.swt.core.layout.SWTGridDescription)
64:          */
65:         @Override
66:         public SWTGridDescription getGridDescription(SWTGridDescription gridDescription) {
67:                 return this.gridDescription;
68:         }
69:
70:         /**
71:          * {@inheritDoc}
72:          *
73:          * @see org.eclipse.emfforms.spi.swt.core.AbstractSWTRenderer#renderControl(org.eclipse.emfforms.spi.swt.core.layout.SWTGridCell,
74:          * org.eclipse.swt.widgets.Composite)
75:          */
76:         @Override
77:         protected Control renderControl(SWTGridCell cell, Composite parent) throws NoRendererFoundException,
78:                 NoPropertyDescriptorFoundExeption {
79:                 // do not render anything
80:                 return parent;
81:         }
82:
83:         /**
84:          * {@inheritDoc}
85:          *
86:          * @see org.eclipse.emfforms.spi.swt.core.AbstractSWTRenderer#applyEnable()
87:          */
88:         @Override
89:         protected void applyEnable() {
90:                 // do nothing
91:         }
92:
93:         /**
94:          * {@inheritDoc}
95:          *
96:          * @see org.eclipse.emfforms.spi.swt.core.AbstractSWTRenderer#applyValidation()
97:          */
98:         @Override
99:         protected void applyValidation() {
100:                 // do nothing
101:         }
102:
103:         /**
104:          * {@inheritDoc}
105:          *
106:          * @see org.eclipse.emfforms.spi.swt.core.AbstractSWTRenderer#applyVisible()
107:          */
108:         @Override
109:         protected void applyVisible() {
110:                 // do nothing
111:         }
112:
113: }