Skip to content

Package: TreeMasterDetailSWTFactory

TreeMasterDetailSWTFactory

nameinstructionbranchcomplexitylinemethod
createTreeMasterDetail(Composite, int, Object)
M: 0 C: 8
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
createTreeMasterDetail(Composite, int, Object, TreeMasterDetailSWTCustomization)
M: 0 C: 7
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
createTreeMasterDetail(Composite, int, Object, int, TreeMasterDetailSWTCustomization)
M: 0 C: 9
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
fillDefaults(Composite, int, Object)
M: 0 C: 7
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%

Coverage

1: /*******************************************************************************
2: * Copyright (c) 2011-2015 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.emfforms.spi.swt.treemasterdetail;
15:
16: import org.eclipse.emfforms.internal.swt.treemasterdetail.DefaultTreeMasterDetailCustomization;
17: import org.eclipse.swt.widgets.Composite;
18:
19: /**
20: * This factory allows to create {@link TreeMasterDetailComposite TreeMasterDetailComposites}.
21: *
22: * @author Johannes Faltermeier
23: *
24: */
25: public final class TreeMasterDetailSWTFactory {
26:
27:         private TreeMasterDetailSWTFactory() {
28:                 // factory
29:         }
30:
31:         /**
32:          * Use this method if you want to customize any behavior of the {@link TreeMasterDetailComposite}. This will return
33:          * a {@link TreeMasterDetailSWTBuilder} which allows to customize certain aspects.
34:          *
35:          * @param composite the parent composite
36:          * @param swtStyleBits the style bits which will be passed to the {@link TreeMasterDetailComposite}
37:          * @param input the input object
38:          * @return the builder
39:          */
40:         public static TreeMasterDetailSWTBuilder fillDefaults(Composite composite, int swtStyleBits, Object input) {
41:                 return new TreeMasterDetailSWTBuilder(composite, swtStyleBits, input);
42:         }
43:
44:         /**
45:          * Creates a {@link TreeMasterDetailComposite} with the default behavior.
46:          *
47:          * @param parent the parent composite
48:          * @param style the style bits which will be passed to the {@link TreeMasterDetailComposite}
49:          * @param input the input object
50:          * @return the tree master detail
51:          */
52:         public static TreeMasterDetailComposite createTreeMasterDetail(Composite parent, int style, Object input) {
53:                 return createTreeMasterDetail(parent, style, input, new DefaultTreeMasterDetailCustomization());
54:         }
55:
56:         /**
57:          * Creates a {@link TreeMasterDetailComposite} with a customized behavior. Please note that there is also the
58:          * {@link #fillDefaults(Composite, int, Object)} method which allows to customize single aspects of the default
59:          * behavior without having to provider a full implementaion of {@link TreeMasterDetailSWTCustomization}.
60:          *
61:          * @param parent the parent composite
62:          * @param style the style bits which will be passed to the {@link TreeMasterDetailComposite}
63:          * @param input the input object
64:          * @param buildBehaviour the custom behavior
65:          * @return the tree master detail
66:          */
67:         public static TreeMasterDetailComposite createTreeMasterDetail(Composite parent, int style, Object input,
68:                 TreeMasterDetailSWTCustomization buildBehaviour) {
69:                 return createTreeMasterDetail(parent, style, input, 100, buildBehaviour);
70:         }
71:
72:         /**
73:          * Creates a {@link TreeMasterDetailComposite} with a customized behavior. Please note that there is also the
74:          * {@link #fillDefaults(Composite, int, Object)} method which allows to customize single aspects of the default
75:          * behavior without having to provider a full implementaion of {@link TreeMasterDetailSWTCustomization}.
76:          *
77:          * @param parent the parent composite
78:          * @param style the style bits which will be passed to the {@link TreeMasterDetailComposite}
79:          * @param input the input object
80:          * @param buildBehaviour the custom behavior
81:          * @param updateDelay the time between a detected selection change and updating the detail panel in ms
82:          * @return the tree master detail
83:          * @since 1.11
84:          */
85:         public static TreeMasterDetailComposite createTreeMasterDetail(Composite parent, int style, Object input,
86:                 int updateDelay, TreeMasterDetailSWTCustomization buildBehaviour) {
87:                 return new TreeMasterDetailComposite(parent, style, input, buildBehaviour, updateDelay);
88:         }
89:
90: }