Skip to content

Package: ReadOnlyConfigurationSWTRenderer

ReadOnlyConfigurationSWTRenderer

nameinstructionbranchcomplexitylinemethod
ReadOnlyConfigurationSWTRenderer(VControl, ViewModelContext, ReportService, EMFFormsDatabinding, EMFFormsLabelProvider, VTViewTemplateProvider, ImageRegistryService)
M: 10 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 3 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) 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: * Lucas Koehler - 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.control.multireference.LinkOnlyMultiReferenceRenderer;
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.VReadOnlyColumnConfiguration;
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:
29: /**
30: * Renderer to configure the linked column DMRs for {@link VReadOnlyColumnConfiguration ReadOnlyColumnConfigurations}.
31: * Uses a custom reference service to only show suitable column dmrs for linking.
32: *
33: * @author Lucas Koehler
34: *
35: */
36: public class ReadOnlyConfigurationSWTRenderer extends LinkOnlyMultiReferenceRenderer {
37:
38:         private ReferenceService referenceService;
39:
40:         /**
41:          * Default constructor.
42:          *
43:          * @param vElement the view model element to be rendered
44:          * @param viewContext the view context
45:          * @param emfFormsDatabinding The {@link EMFFormsDatabinding}
46:          * @param emfFormsLabelProvider The {@link EMFFormsLabelProvider}
47:          * @param reportService The {@link ReportService}
48:          * @param vtViewTemplateProvider The {@link VTViewTemplateProvider}
49:          * @param imageRegistryService The {@link ImageRegistryService}
50:          */
51:         @Inject
52:         public ReadOnlyConfigurationSWTRenderer(VControl vElement, ViewModelContext viewContext,
53:                 ReportService reportService, EMFFormsDatabinding emfFormsDatabinding,
54:                 EMFFormsLabelProvider emfFormsLabelProvider, VTViewTemplateProvider vtViewTemplateProvider,
55:                 ImageRegistryService imageRegistryService) {
56:                 super(vElement, viewContext, reportService, emfFormsDatabinding, emfFormsLabelProvider, vtViewTemplateProvider,
57:                         imageRegistryService);
58:         }
59:
60:         @Override
61:         protected ReferenceService getReferenceService() {
62:•                if (referenceService == null) {
63:                         referenceService = new ColumnConfigurationDMRRendererReferenceService(VReadOnlyColumnConfiguration.class);
64:                 }
65:                 return referenceService;
66:         }
67: }