Skip to content

Package: SWTGridDescription

SWTGridDescription

nameinstructionbranchcomplexitylinemethod
SWTGridDescription()
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%
SWTGridDescription(int, int, List)
M: 0 C: 6
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 2
100%
M: 0 C: 1
100%
copy()
M: 15 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 3 C: 0
0%
M: 1 C: 0
0%

Coverage

1: /*******************************************************************************
2: * Copyright (c) 2011-2014 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 - initial API and implementation
13: ******************************************************************************/
14: package org.eclipse.emfforms.spi.swt.core.layout;
15:
16: import java.util.ArrayList;
17: import java.util.List;
18:
19: import org.eclipse.emf.ecp.view.model.common.AbstractGridDescription;
20:
21: /**
22: * A {@link SWTGridDescription} describes the grid of the renderer using a list of {@link SWTGridCell GridCells} and the
23: * number of rows and columns it has.
24: *
25: * Use the {@link GridDescriptionFactory} to create {@link SWTGridDescription GridDescriptions}.
26: *
27: * @author Eugen Neufeld
28: * @since 1.3
29: *
30: */
31: public class SWTGridDescription extends AbstractGridDescription<SWTGridCell> {
32:
33:         /**
34:          * Creating an empty grid.
35:          */
36:         public SWTGridDescription() {
37:
38:         }
39:
40:         /**
41:          * Creating a filled grid.
42:          *
43:          * @param rows number of rows in this description
44:          * @param columns number of columns in this description
45:          * @param grid the List of {@link SWTGridCell GridCells} describing the grid
46:          */
47:         public SWTGridDescription(int rows, int columns, List<SWTGridCell> grid) {
48:                 super(rows, columns, grid);
49:         }
50:
51:         /**
52:          * Creates a copy of the grid.
53:          *
54:          * @return a copy of the grid
55:          */
56:         public SWTGridDescription copy() {
57:                 final SWTGridDescription gd = new SWTGridDescription(getRows(), getColumns(), new ArrayList<SWTGridCell>(
58:                         getGrid()));
59:                 return gd;
60:         }
61: }