Skip to content

Package: CategoryRendererTestHelper

CategoryRendererTestHelper

nameinstructionbranchcomplexitylinemethod
CategoryRendererTestHelper()
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%
getDetailComposite(Control)
M: 0 C: 13
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 2
100%
M: 0 C: 1
100%
getTree(Control)
M: 0 C: 13
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-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: * jonas - initial API and implementation
13: ******************************************************************************/
14: package org.eclipse.emf.ecp.view.categorization.swt.test;
15:
16: import org.eclipse.swt.widgets.Composite;
17: import org.eclipse.swt.widgets.Control;
18: import org.eclipse.swt.widgets.Tree;
19:
20: /**
21: * @author Jonas Helming
22: *
23: */
24: public abstract class CategoryRendererTestHelper {
25:         /**
26:          * @param swtControl
27:          * @return the {@link Tree} rendered by the Categorization Renderer
28:          */
29:         public static Tree getTree(Control swtControl) {
30:                 final Composite composite = (Composite) swtControl;
31:                 return (Tree) ((Composite) composite.getChildren()[0]).getChildren()[0];
32:         }
33:
34:         /**
35:          * Returns the Composite that is used to render the view of the currently selected category (wrapped in another
36:          * composite).
37:          *
38:          * @param swtControl The Control renderered by the Categorization Renderer
39:          * @return The detail composite rendered by the Categorization Renderer
40:          */
41:         public static Composite getDetailComposite(Control swtControl) {
42:                 final Composite composite = (Composite) swtControl;
43:                 return (Composite) ((Composite) composite.getChildren()[0]).getChildren()[1];
44:         }
45: }