Skip to content

Package: ColumnEnablementConfigurationDMRRenderer

ColumnEnablementConfigurationDMRRenderer

nameinstructionbranchcomplexitylinemethod
ColumnEnablementConfigurationDMRRenderer(VControl, ViewModelContext, ReportService, EMFFormsDatabinding, EMFFormsLabelProvider, VTViewTemplateProvider, EMFFormsLocalizationService, ImageRegistryService)
M: 11 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 10 C: 0
0%
M: 1 C: 0
0%
createNewReferenceButton(Composite, String)
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%
getReferenceService()
M: 12 C: 0
0%
M: 2 C: 0
0%
M: 2 C: 0
0%
M: 3 C: 0
0%
M: 1 C: 0
0%

Coverage

1: /*******************************************************************************
2: * Copyright (c) 2017 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.editor.controls;
15:
16: import javax.inject.Inject;
17:
18: import org.eclipse.emf.ecp.edit.spi.ReferenceService;
19: import org.eclipse.emf.ecp.view.internal.core.swt.renderer.LinkControlSWTRenderer;
20: import org.eclipse.emf.ecp.view.spi.context.ViewModelContext;
21: import org.eclipse.emf.ecp.view.spi.model.VControl;
22: import org.eclipse.emf.ecp.view.spi.table.model.VEnablementConfiguration;
23: import org.eclipse.emf.ecp.view.spi.util.swt.ImageRegistryService;
24: import org.eclipse.emf.ecp.view.template.model.VTViewTemplateProvider;
25: import org.eclipse.emfforms.spi.common.report.ReportService;
26: import org.eclipse.emfforms.spi.core.services.databinding.EMFFormsDatabinding;
27: import org.eclipse.emfforms.spi.core.services.label.EMFFormsLabelProvider;
28: import org.eclipse.emfforms.spi.localization.EMFFormsLocalizationService;
29: import org.eclipse.swt.widgets.Composite;
30:
31: /**
32: * Special {@link LinkControlSWTRenderer} which will streamline the column dmr selection.
33: *
34: * @author Edgar Mueller
35: *
36: */
37: public class ColumnEnablementConfigurationDMRRenderer extends LinkControlSWTRenderer {
38:
39:         private ColumnConfigurationDMRRendererReferenceService referenceService;
40:
41:         /**
42:          * @param vElement the element to render
43:          * @param viewContext the view model context
44:          * @param reportService the report service
45:          * @param emfFormsDatabinding the data binding service
46:          * @param emfFormsLabelProvider the label provider
47:          * @param vtViewTemplateProvider the view template provider
48:          * @param localizationService the localization service
49:          * @param imageRegistryService the image registry service
50:          */
51:         @Inject
52:         // CHECKSTYLE.OFF: ParameterNumber
53:         public ColumnEnablementConfigurationDMRRenderer(
54:                 VControl vElement,
55:                 ViewModelContext viewContext,
56:                 ReportService reportService,
57:                 EMFFormsDatabinding emfFormsDatabinding,
58:                 EMFFormsLabelProvider emfFormsLabelProvider,
59:                 VTViewTemplateProvider vtViewTemplateProvider,
60:                 EMFFormsLocalizationService localizationService,
61:                 ImageRegistryService imageRegistryService) {
62:                 // CHECKSTYLE.ON: ParameterNumber
63:                 super(
64:                         vElement,
65:                         viewContext,
66:                         reportService,
67:                         emfFormsDatabinding,
68:                         emfFormsLabelProvider,
69:                         vtViewTemplateProvider,
70:                         localizationService,
71:                         imageRegistryService);
72:         }
73:
74:         @Override
75:         protected void createNewReferenceButton(Composite parent, String elementDisplayName) {
76:                 /* we only want users to select existing DMRs -> no-op */
77:         }
78:
79:         @Override
80:         protected ReferenceService getReferenceService() {
81:•                if (referenceService == null) {
82:                         referenceService = new ColumnConfigurationDMRRendererReferenceService(VEnablementConfiguration.class);
83:                 }
84:                 return referenceService;
85:         }
86:
87: }