Skip to content

Package: DefaultLayoutHelper

DefaultLayoutHelper

nameinstructionbranchcomplexitylinemethod
DefaultLayoutHelper()
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%
getColumnLayout(int, boolean)
M: 7 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
getLeftColumnLayoutData()
M: 9 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 3 C: 0
0%
M: 1 C: 0
0%
getRightColumnLayoutData(int)
M: 12 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 4 C: 0
0%
M: 1 C: 0
0%
getSpanningLayoutData(int, int)
M: 12 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 5 C: 0
0%
M: 1 C: 0
0%
getValidationColumnLayoutData()
M: 12 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 4 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: package org.eclipse.emf.ecp.edit.internal.swt.util;
15:
16: import org.eclipse.emf.ecp.view.spi.renderer.LayoutHelper;
17: import org.eclipse.jface.layout.GridDataFactory;
18: import org.eclipse.jface.layout.GridLayoutFactory;
19: import org.eclipse.swt.SWT;
20: import org.eclipse.swt.widgets.Layout;
21:
22: /**
23: * @author Eugen Neufeld
24: *
25: */
26: @Deprecated
27: public final class DefaultLayoutHelper implements LayoutHelper<Layout> {
28:
29:         /**
30:          * {@inheritDoc}
31:          *
32:          * @see org.eclipse.emf.ecp.view.spi.renderer.LayoutHelper#getColumnLayout(int, boolean)
33:          */
34:         @Override
35:         public Layout getColumnLayout(int numColumns, boolean equalWidth) {
36:                 return GridLayoutFactory.fillDefaults().numColumns(numColumns).equalWidth(equalWidth).create();
37:         }
38:
39:         /**
40:          * {@inheritDoc}
41:          *
42:          * @see org.eclipse.emf.ecp.view.spi.renderer.LayoutHelper#getSpanningLayoutData(int, int)
43:          */
44:         @Override
45:         public Object getSpanningLayoutData(int xSpan, int ySpan) {
46:                 return GridDataFactory.fillDefaults()
47:                         .align(SWT.FILL, SWT.FILL)
48:                         .grab(true, false)
49:                         .span(xSpan, ySpan)
50:                         .create();
51:         }
52:
53:         /**
54:          * {@inheritDoc}
55:          *
56:          * @see org.eclipse.emf.ecp.view.spi.renderer.LayoutHelper#getLeftColumnLayoutData()
57:          */
58:         @Override
59:         public Object getLeftColumnLayoutData() {
60:                 return GridDataFactory.fillDefaults().grab(false, false)
61:                         .align(SWT.FILL, SWT.CENTER)
62:                         .create();
63:         }
64:
65:         /**
66:          * {@inheritDoc}
67:          *
68:          * @see org.eclipse.emf.ecp.view.spi.renderer.LayoutHelper#getRightColumnLayoutData(int)
69:          */
70:         @Override
71:         public Object getRightColumnLayoutData(int xSpan) {
72:                 return GridDataFactory.fillDefaults()
73:                         .align(SWT.FILL, SWT.CENTER)
74:                         .grab(true, false).span(xSpan, 1)
75:                         .create();
76:         }
77:
78:         /**
79:          * {@inheritDoc}
80:          *
81:          * @see org.eclipse.emf.ecp.view.spi.renderer.LayoutHelper#getValidationColumnLayoutData()
82:          */
83:         @Override
84:         public Object getValidationColumnLayoutData() {
85:                 return GridDataFactory.fillDefaults()
86:                         .align(SWT.CENTER, SWT.CENTER).hint(16, 17)
87:                         .grab(false, false)
88:                         .create();
89:         }
90:
91: }