Skip to content

Package: DiffMergeContextFactory

DiffMergeContextFactory

nameinstructionbranchcomplexitylinemethod
createViewModelContext(VElement, EObject, EObject, EObject)
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%
createViewModelContext(VElement, EObject, EObject, EObject, Set)
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%
createViewModelContext(VElement, EObject, EObject, EObject, Set, ViewModelService[])
M: 10 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
createViewModelContext(VElement, EObject, EObject, EObject, ViewModelService[])
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%
static {...}
M: 0 C: 5
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-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 Neufeld - initial API and implementation
13: ******************************************************************************/
14: package org.eclipse.emf.ecp.diffmerge.spi.context;
15:
16: import java.util.Set;
17:
18: import org.eclipse.emf.ecore.EObject;
19: import org.eclipse.emf.ecp.diffmerge.internal.context.DiffMergeModelContextImpl;
20: import org.eclipse.emf.ecp.view.spi.context.ViewModelService;
21: import org.eclipse.emf.ecp.view.spi.model.VDomainModelReference;
22: import org.eclipse.emf.ecp.view.spi.model.VElement;
23:
24: /**
25: * This Factory can be used to instantiate {@link DiffMergeModelContext
26: * DiffMergeModelContexts}.
27: *
28: * @author Eugen Neufeld
29: *
30: */
31: public final class DiffMergeContextFactory {
32:         /**
33:          * The singleton instance of the factory.
34:          */
35:         public static final DiffMergeContextFactory INSTANCE = new DiffMergeContextFactory();
36:
37:         private DiffMergeContextFactory() {
38:         }
39:
40:         /**
41:          * Instantiates a new view model context.
42:          *
43:          * @param view
44:          * the view
45:          * @param target
46:          * the domain object
47:          * @param left the first object
48:          * @param right the second object
49:          * @return the created {@link DiffMergeModelContext}
50:          */
51:         public DiffMergeModelContext createViewModelContext(VElement view, EObject target, EObject left,
52:                 EObject right) {
53:                 return new DiffMergeModelContextImpl(view, target, left, right);
54:         }
55:
56:         /**
57:          * Instantiates a new view model context with specific services.
58:          *
59:          * @param view
60:          * the view
61:          * @param target
62:          * the domain object
63:          * @param left the first object
64:          * @param right the second object
65:          * @param modelServices
66:          * an array of services to use in the {@link DiffMergeModelContext }
67:          * @return the created {@link DiffMergeModelContext}
68:          */
69:         public DiffMergeModelContext createViewModelContext(VElement view,
70:                 EObject target, EObject left, EObject right, ViewModelService... modelServices) {
71:                 return new DiffMergeModelContextImpl(view, target, left, right, modelServices);
72:         }
73:
74:         /**
75:          * Instantiates a new view model context.
76:          *
77:          * @param view
78:          * the view
79:          * @param target
80:          * the domain object
81:          * @param left the first object
82:          * @param right the second object
83:          * @param mergedControls the set of already merged domain references
84:          * @return the created {@link DiffMergeModelContext}
85:          */
86:         public DiffMergeModelContext createViewModelContext(VElement view, EObject target, EObject left,
87:                 EObject right, Set<VDomainModelReference> mergedControls) {
88:                 return new DiffMergeModelContextImpl(view, target, left, right, mergedControls);
89:         }
90:
91:         /**
92:          * Instantiates a new view model context with specific services.
93:          *
94:          * @param view
95:          * the view
96:          * @param target
97:          * the domain object
98:          * @param left the first object
99:          * @param right the second object
100:          * @param mergedControls the set of already merged domain references
101:          * @param modelServices
102:          * an array of services to use in the {@link DiffMergeModelContext }
103:          * @return the created {@link DiffMergeModelContext}
104:          */
105:         public DiffMergeModelContext createViewModelContext(VElement view,
106:                 EObject target, EObject left, EObject right, Set<VDomainModelReference> mergedControls,
107:                 ViewModelService... modelServices) {
108:                 return new DiffMergeModelContextImpl(view, target, left, right, mergedControls, modelServices);
109:         }
110: }