Skip to content

Package: ECPControlDescription

ECPControlDescription

nameinstructionbranchcomplexitylinemethod
ECPControlDescription(String, Class, boolean, Set)
M: 0 C: 15
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 6
100%
M: 0 C: 1
100%
getControlClass()
M: 0 C: 3
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
getId()
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%
getTester()
M: 0 C: 3
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
isShowLabel()
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%

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.spi;
16:
17: import java.util.Set;
18:
19: import org.eclipse.emf.ecp.edit.spi.util.ECPApplicableTester;
20:
21: /**
22: * This class describes the control extensionpoint. It is used to provide the possibility to access all known controls
23: * without reading the extension point.
24: *
25: * @author Eugen Neufeld
26: */
27: @Deprecated
28: public final class ECPControlDescription {
29:
30:         private final String id;
31:         private final Class<? extends ECPAbstractControl> controlClass;
32:         private final boolean showLabel;
33:         private final Set<ECPApplicableTester> tester;
34:
35:         /**
36:          * The constructor of the ControlDescription.
37:          *
38:          * @param controlClass the class implementing the control
39:          * @param showLabel whether to show a label for this control or not
40:          * @param tester the class testing whether the control is applicable for the current feature of the current eobject
41:          * @param id the id of the control that is being described
42:          */
43:         public ECPControlDescription(String id, Class<? extends ECPAbstractControl> controlClass, boolean showLabel,
44:                 Set<ECPApplicableTester> tester) {
45:                 super();
46:                 this.id = id;
47:                 this.controlClass = controlClass;
48:                 this.showLabel = showLabel;
49:                 this.tester = tester;
50:         }
51:
52:         /**
53:          * The id of this control.
54:          *
55:          * @return the id of the control
56:          */
57:         public String getId() {
58:                 return id;
59:         }
60:
61:         /**
62:          * The class implementing the Control. It extends the {@link ECPAbstractControl}.
63:          *
64:          * @return the class implementing this control
65:          */
66:         public Class<? extends ECPAbstractControl> getControlClass() {
67:                 return controlClass;
68:         }
69:
70:         /**
71:          * Whether to show a label for this control or not.
72:          *
73:          * @return true if a label should be shown
74:          */
75:         public boolean isShowLabel() {
76:                 return showLabel;
77:         }
78:
79:         /**
80:          * The tester for this control. The tester is used to check whether this control is usable on a specific feature of
81:          * a specific eobject.
82:          *
83:          * @return the {@link ECPApplicableTester} implementation
84:          */
85:         public Set<ECPApplicableTester> getTester() {
86:                 return tester;
87:         }
88: }