Skip to content

Package: GridTableViewerFactory

GridTableViewerFactory

nameinstructionbranchcomplexitylinemethod
GridTableViewerFactory()
M: 3 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
fillDefaults(Composite, int, Object)
M: 13 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 3 C: 0
0%
M: 1 C: 0
0%
fillDefaults(Composite, int, Object, IObservableValue, IObservableValue)
M: 9 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
fillDefaults(Composite, int, Object, String, String)
M: 13 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-2019 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: * Johannes Faltermeier - initial API and implementation
13: ******************************************************************************/
14: package org.eclipse.emf.ecp.view.spi.table.nebula.grid.rap;
15:
16: import org.eclipse.core.databinding.observable.Observables;
17: import org.eclipse.core.databinding.observable.value.IObservableValue;
18: import org.eclipse.emfforms.spi.swt.table.TableViewerFactory;
19: import org.eclipse.swt.widgets.Composite;
20:
21: /**
22: * A factory to create {@link GridTableViewerComposite GridTableViewerComposites}.
23: *
24: * @author Johannes Faltermeier
25: *
26: */
27: public final class GridTableViewerFactory extends TableViewerFactory {
28:
29:         /** Default constructor. */
30:         public GridTableViewerFactory() {
31:                 super();
32:         }
33:
34:         /**
35:          * Use this method if you want to customize any behavior of the {@link GridTableViewerComposite}. This will return
36:          * a {@link GridTableViewerSWTBuilder} which allows to customize certain aspects.
37:          *
38:          * @param composite the parent composite
39:          * @param swtStyleBits the style bits which will be passed to the {@link GridTableViewerComposite}
40:          * @param input the input object
41:          * @return the builder
42:          */
43:         public static GridTableViewerSWTBuilder fillDefaults(Composite composite, int swtStyleBits, Object input) {
44:                 return new GridTableViewerSWTBuilder(composite, swtStyleBits, input,
45:                         Observables.constantObservableValue("", String.class), //$NON-NLS-1$
46:                         Observables.constantObservableValue("", String.class)); //$NON-NLS-1$
47:         }
48:
49:         /**
50:          * Use this method if you want to customize any behavior of the {@link GridTableViewerComposite}. This will return
51:          * a {@link GridTableViewerSWTBuilder} which allows to customize certain aspects.
52:          *
53:          * @param composite the parent composite
54:          * @param swtStyleBits the style bits which will be passed to the {@link GridTableViewerComposite}
55:          * @param input the input object
56:          * @param title the title
57:          * @param tooltip the tooltip
58:          * @return the builder
59:          */
60:         public static GridTableViewerSWTBuilder fillDefaults(Composite composite, int swtStyleBits, Object input,
61:                 IObservableValue title, IObservableValue tooltip) {
62:                 return new GridTableViewerSWTBuilder(composite, swtStyleBits, input, title, tooltip);
63:         }
64:
65:         /**
66:          * Use this method if you want to customize any behavior of the {@link GridTableViewerComposite}. This will return
67:          * a {@link GridTableViewerSWTBuilder} which allows to customize certain aspects.
68:          *
69:          * @param composite the parent composite
70:          * @param swtStyleBits the style bits which will be passed to the {@link GridTableViewerComposite}
71:          * @param input the input object
72:          * @param title the title
73:          * @param tooltip the tooltip
74:          * @return the builder
75:          */
76:         public static GridTableViewerSWTBuilder fillDefaults(Composite composite, int swtStyleBits, Object input,
77:                 String title, String tooltip) {
78:                 return new GridTableViewerSWTBuilder(composite, swtStyleBits, input,
79:                         Observables.constantObservableValue(title, String.class),
80:                         Observables.constantObservableValue(tooltip, String.class));
81:         }
82: }