Skip to content

Package: ReferenceMultiControl

ReferenceMultiControl

nameinstructionbranchcomplexitylinemethod
ReferenceMultiControl()
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%
getTesterPriority(ECPStaticApplicableTester, EStructuralFeature.Setting)
M: 7 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
getUnsetButtonTooltip()
M: 5 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
getUnsetLabelText()
M: 5 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
instantiateActions()
M: 59 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 11 C: 0
0%
M: 1 C: 0
0%

Coverage

1: /*******************************************************************************
2: * Copyright (c) 2011-2013 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: * Eugen Neufeld - initial API and implementation
13: *
14: *******************************************************************************/
15: package org.eclipse.emf.ecp.edit.internal.swt.reference;
16:
17: import org.eclipse.emf.ecore.EStructuralFeature.Setting;
18: import org.eclipse.emf.ecp.edit.internal.swt.controls.MultiControl;
19: import org.eclipse.emf.ecp.edit.spi.ReferenceService;
20: import org.eclipse.emf.ecp.edit.spi.swt.actions.ECPSWTAction;
21: import org.eclipse.emf.ecp.edit.spi.swt.reference.AddReferenceAction;
22: import org.eclipse.emf.ecp.edit.spi.swt.reference.NewReferenceAction;
23: import org.eclipse.emf.ecp.edit.spi.util.ECPStaticApplicableTester;
24: import org.eclipse.emfforms.spi.common.report.ReportService;
25: import org.eclipse.emfforms.spi.core.services.editsupport.EMFFormsEditSupport;
26: import org.eclipse.emfforms.spi.core.services.label.EMFFormsLabelProvider;
27: import org.eclipse.emfforms.spi.localization.LocalizationServiceHelper;
28:
29: /**
30: * This class defines a Control which is used for displaying {@link org.eclipse.emf.ecore.EStructuralFeature}s which
31: * have a multi reference.
32: *
33: * @deprecated Use the new MultiReferenceSWTRenderer instead
34: * @author Eugen Neufeld
35: *
36: */
37: @Deprecated
38: public class ReferenceMultiControl extends MultiControl {
39:
40:         @Override
41:         protected ECPSWTAction[] instantiateActions() {
42:                 final ECPSWTAction[] actions = new ECPSWTAction[2];
43:                 final Setting firstSetting = getFirstSetting();
44:                 actions[0] = new AddReferenceAction(getEditingDomain(firstSetting), firstSetting,
45:                         getItemPropertyDescriptor(firstSetting), getService(ReferenceService.class));
46:                 actions[1] = new NewReferenceAction(getEditingDomain(firstSetting), firstSetting,
47:                         getViewModelContext().getService(EMFFormsEditSupport.class),
48:                         getViewModelContext().getService(EMFFormsLabelProvider.class),
49:                         getService(ReferenceService.class), getViewModelContext().getService(ReportService.class),
50:                         getDomainModelReference(),
51:                         getViewModelContext().getDomainModel());
52:                 return actions;
53:         }
54:
55:         @Override
56:         protected int getTesterPriority(ECPStaticApplicableTester tester, Setting setting) {
57:                 return ReferenceMultiControlTester.getTesterPriority(tester,
58:                         setting.getEStructuralFeature(), setting.getEObject());
59:         }
60:
61:         /*
62:          * (non-Javadoc)
63:          * @see org.eclipse.emf.ecp.edit.internal.swt.util.SWTControl#getUnsetLabelText()
64:          */
65:         @Override
66:         protected String getUnsetLabelText() {
67:                 return LocalizationServiceHelper.getString(getClass(),
68:                         ReferenceMessageKeys.ReferenceMultiControl_NotSetClickToSet);
69:         }
70:
71:         /*
72:          * (non-Javadoc)
73:          * @see org.eclipse.emf.ecp.edit.internal.swt.util.SWTControl#getUnsetButtonTooltip()
74:          */
75:         @Override
76:         protected String getUnsetButtonTooltip() {
77:                 return LocalizationServiceHelper.getString(getClass(), ReferenceMessageKeys.ReferenceMultiControl_Unset);
78:         }
79: }