Skip to content

Package: DmrToSegmentsViewServiceFactory

DmrToSegmentsViewServiceFactory

nameinstructionbranchcomplexitylinemethod
DmrToSegmentsViewServiceFactory()
M: 0 C: 3
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
createService(EMFFormsViewContext)
M: 5 C: 4
44%
M: 1 C: 1
50%
M: 1 C: 1
50%
M: 1 C: 2
67%
M: 0 C: 1
100%
getPolicy()
M: 0 C: 2
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
getPriority()
M: 0 C: 2
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
getScope()
M: 0 C: 2
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
getType()
M: 0 C: 2
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-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: * Lucas Koehler - initial API and implementation
13: ******************************************************************************/
14: package org.eclipse.emfforms.internal.core.services.segments;
15:
16: import org.eclipse.emfforms.spi.core.services.segments.RuntimeModeUtil;
17: import org.eclipse.emfforms.spi.core.services.view.EMFFormsViewContext;
18: import org.eclipse.emfforms.spi.core.services.view.EMFFormsViewServiceFactory;
19: import org.eclipse.emfforms.spi.core.services.view.EMFFormsViewServicePolicy;
20: import org.eclipse.emfforms.spi.core.services.view.EMFFormsViewServiceScope;
21: import org.osgi.service.component.annotations.Component;
22:
23: /**
24: * View service factory that creates {@link DmrToSegmentsViewService DmrToSegmentsViewServices}.
25: *
26: * @author Lucas Koehler
27: */
28: @Component(name = "DmrToSegmentsViewServiceFactory")
29: public class DmrToSegmentsViewServiceFactory implements EMFFormsViewServiceFactory<DmrToSegmentsViewService> {
30:
31:         @Override
32:         public EMFFormsViewServicePolicy getPolicy() {
33:                 return EMFFormsViewServicePolicy.IMMEDIATE;
34:         }
35:
36:         @Override
37:         public EMFFormsViewServiceScope getScope() {
38:                 return EMFFormsViewServiceScope.LOCAL;
39:         }
40:
41:         @Override
42:         public double getPriority() {
43:                 return -1000d;
44:         }
45:
46:         @Override
47:         public Class<DmrToSegmentsViewService> getType() {
48:                 return DmrToSegmentsViewService.class;
49:         }
50:
51:         @Override
52:         public DmrToSegmentsViewService createService(EMFFormsViewContext emfFormsViewContext) {
53:•                if (RuntimeModeUtil.isSegmentMode()) {
54:                         return new DmrToSegmentsViewService(emfFormsViewContext);
55:                 }
56:                 return null;
57:         }
58:
59: }