Skip to content

Package: InstanceTypeNameSWTRenderer

InstanceTypeNameSWTRenderer

nameinstructionbranchcomplexitylinemethod
InstanceTypeNameSWTRenderer(VControl, ViewModelContext, ReportService, EMFFormsDatabinding, EMFFormsLabelProvider, VTViewTemplateProvider, EMFFormsEditSupport)
M: 0 C: 10
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 3
100%
M: 0 C: 1
100%
isUnsettable()
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%

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: * Lucas Koehler - initial API and implementation
13: ******************************************************************************/
14: package org.eclipse.emfforms.internal.editor.ecore.controls;
15:
16: import javax.inject.Inject;
17:
18: import org.eclipse.emf.ecp.view.spi.context.ViewModelContext;
19: import org.eclipse.emf.ecp.view.spi.core.swt.renderer.TextControlSWTRenderer;
20: import org.eclipse.emf.ecp.view.spi.model.VControl;
21: import org.eclipse.emf.ecp.view.template.model.VTViewTemplateProvider;
22: import org.eclipse.emfforms.spi.common.report.ReportService;
23: import org.eclipse.emfforms.spi.core.services.databinding.DatabindingFailedException;
24: import org.eclipse.emfforms.spi.core.services.databinding.EMFFormsDatabinding;
25: import org.eclipse.emfforms.spi.core.services.editsupport.EMFFormsEditSupport;
26: import org.eclipse.emfforms.spi.core.services.label.EMFFormsLabelProvider;
27:
28: /**
29: * SWT renderer for the feature {@link org.eclipse.emf.ecore.EcorePackage#getEClassifier_InstanceTypeName() Instance
30: * Type Name} of {@link org.eclipse.emf.ecore.EClassifier EClassifier}.
31: * It behaves like the normal {@link TextControlSWTRenderer} but always returns <code>false</code> for
32: * {@link #isUnsettable()}. This is necessary as the
33: * {@link org.eclipse.emf.ecore.EcorePackage#getEClassifier_InstanceTypeName() Instance Type
34: * Name} feature is modeled as an unsettable attribute but internally behaves like a normal attribute.
35: *
36: * @author Lucas Koehler
37: *
38: */
39: public class InstanceTypeNameSWTRenderer extends TextControlSWTRenderer {
40:
41:         /**
42:          * Creates a new instance of {@link InstanceTypeNameSWTRenderer}.
43:          *
44:          * @param vElement the view model element to be rendered
45:          * @param viewContext the view context
46:          * @param reportService The {@link ReportService}
47:          * @param emfFormsDatabinding The {@link EMFFormsDatabinding}
48:          * @param emfFormsLabelProvider The {@link EMFFormsLabelProvider}
49:          * @param vtViewTemplateProvider The {@link VTViewTemplateProvider}
50:          * @param emfFormsEditSupport The {@link EMFFormsEditSupport}
51:          */
52:         @Inject
53:         public InstanceTypeNameSWTRenderer(VControl vElement, ViewModelContext viewContext, ReportService reportService,
54:                 EMFFormsDatabinding emfFormsDatabinding, EMFFormsLabelProvider emfFormsLabelProvider,
55:                 VTViewTemplateProvider vtViewTemplateProvider, EMFFormsEditSupport emfFormsEditSupport) {
56:                 super(vElement, viewContext, reportService, emfFormsDatabinding, emfFormsLabelProvider, vtViewTemplateProvider,
57:                         emfFormsEditSupport);
58:         }
59:
60:         /**
61:          * {@inheritDoc}
62:          *
63:          * @see org.eclipse.emf.ecp.view.spi.core.swt.SimpleControlSWTRenderer#isUnsettable()
64:          */
65:         @Override
66:         protected boolean isUnsettable() throws DatabindingFailedException {
67:                 return false;
68:         }
69:
70: }