Skip to content

Package: CustomControlStub

CustomControlStub

nameinstructionbranchcomplexitylinemethod
CustomControlStub()
M: 0 C: 3
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 2
100%
M: 0 C: 1
100%
disposeCustomControl()
M: 0 C: 1
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
getGridDescription()
M: 0 C: 6
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
getLabel()
M: 2 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
getNeededDomainModelReferences()
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%
getParent()
M: 2 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
handleContentValidation()
M: 0 C: 1
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
renderControl(SWTGridCell, Composite)
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%
setLabel(Button)
M: 0 C: 3
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 2
100%
M: 0 C: 1
100%
setParent(Composite)
M: 0 C: 3
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 2
100%
M: 0 C: 1
100%

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: * Jonas - initial API and implementation
13: ******************************************************************************/
14: package org.eclipse.emf.ecp.view.custom.ui.swt.test;
15:
16: import java.util.Collections;
17: import java.util.Set;
18:
19: import org.eclipse.emf.ecp.view.spi.custom.model.ECPHardcodedReferences;
20: import org.eclipse.emf.ecp.view.spi.custom.swt.ECPAbstractCustomControlSWT;
21: import org.eclipse.emf.ecp.view.spi.model.VDomainModelReference;
22: import org.eclipse.emf.ecp.view.spi.renderer.NoPropertyDescriptorFoundExeption;
23: import org.eclipse.emf.ecp.view.spi.renderer.NoRendererFoundException;
24: import org.eclipse.emfforms.spi.swt.core.layout.GridDescriptionFactory;
25: import org.eclipse.emfforms.spi.swt.core.layout.SWTGridCell;
26: import org.eclipse.emfforms.spi.swt.core.layout.SWTGridDescription;
27: import org.eclipse.swt.SWT;
28: import org.eclipse.swt.widgets.Button;
29: import org.eclipse.swt.widgets.Composite;
30: import org.eclipse.swt.widgets.Control;
31:
32: /**
33: * @author Jonas
34: *
35: */
36: public class CustomControlStub extends ECPAbstractCustomControlSWT implements ECPHardcodedReferences {
37:
38:         public static final String LABEL_TEXT = "labelText";
39:         private static Button label;
40:         private static Composite parent;
41:
42:         public CustomControlStub() {
43:                 super();
44:         }
45:
46:         /**
47:          * {@inheritDoc}
48:          *
49:          * @see org.eclipse.emf.ecp.view.spi.custom.ui.ECPAbstractCustomControl#disposeCustomControl()
50:          */
51:         @Override
52:         protected void disposeCustomControl() {
53:                 // TODO Auto-generated method stub
54:
55:         }
56:
57:         /**
58:          * @return the label
59:          */
60:         public static Button getLabel() {
61:                 return label;
62:         }
63:
64:         /**
65:          * @param label the label to set
66:          */
67:         public static void setLabel(Button label) {
68:                 CustomControlStub.label = label;
69:         }
70:
71:         /**
72:          * @return the parent
73:          */
74:         public static Composite getParent() {
75:                 return parent;
76:         }
77:
78:         /**
79:          * @param parent the parent to set
80:          */
81:         public static void setParent(Composite parent) {
82:                 CustomControlStub.parent = parent;
83:         }
84:
85:         /**
86:          * {@inheritDoc}
87:          *
88:          * @see org.eclipse.emf.ecp.view.spi.custom.model.ECPHardcodedReferences#getNeededDomainModelReferences()
89:          */
90:         @Override
91:         public Set<VDomainModelReference> getNeededDomainModelReferences() {
92:                 // TODO Auto-generated method stub
93:                 return Collections.emptySet();
94:         }
95:
96:         /**
97:          * {@inheritDoc}
98:          *
99:          * @see org.eclipse.emf.ecp.view.spi.custom.swt.ECPAbstractCustomControlSWT#handleContentValidation()
100:          */
101:         @Override
102:         protected void handleContentValidation() {
103:                 // TODO Auto-generated method stub
104:
105:         }
106:
107:         /**
108:          * {@inheritDoc}
109:          *
110:          * @see org.eclipse.emf.ecp.view.spi.custom.swt.ECPAbstractCustomControlSWT#getGridDescription()
111:          */
112:         @Override
113:         public SWTGridDescription getGridDescription() {
114:                 // TODO Auto-generated method stub
115:                 return GridDescriptionFactory.INSTANCE.createSimpleGrid(1, 1, null);
116:         }
117:
118:         /**
119:          * {@inheritDoc}
120:          *
121:          * @see org.eclipse.emf.ecp.view.spi.custom.swt.ECPAbstractCustomControlSWT#renderControl(org.eclipse.emfforms.spi.swt.core.layout.SWTGridCell,
122:          * org.eclipse.swt.widgets.Composite)
123:          */
124:         @Override
125:         public Control renderControl(SWTGridCell cell, Composite parent) throws NoRendererFoundException,
126:                 NoPropertyDescriptorFoundExeption {
127:                 setParent(parent);
128:                 setLabel(new Button(parent, SWT.NONE));
129:                 return label;
130:         }
131:
132: }