Skip to content

Package: IntermediateStep

IntermediateStep

nameinstructionbranchcomplexitylinemethod
IntermediateStep(VElement, EObject, RevealStep, Runnable)
M: 0 C: 15
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 6
100%
M: 0 C: 1
100%
drillDown()
M: 0 C: 5
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 2
100%
M: 0 C: 1
100%
getDomainModel()
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%
getFeature()
M: 2 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
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%
getViewModel()
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%
reveal()
M: 0 C: 7
100%
M: 1 C: 1
50%
M: 1 C: 1
50%
M: 0 C: 3
100%
M: 0 C: 1
100%

Coverage

1: /*******************************************************************************
2: * Copyright (c) 2019 Christian W. Damus 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: * Christian W. Damus - initial API and implementation
13: ******************************************************************************/
14: package org.eclipse.emfforms.spi.core.services.reveal;
15:
16: import org.eclipse.emf.ecore.EObject;
17: import org.eclipse.emf.ecore.EStructuralFeature;
18: import org.eclipse.emf.ecp.view.spi.model.VElement;
19:
20: /**
21: * An intermediate step in a successful reveal.
22: *
23: * @since 1.22
24: */
25: final class IntermediateStep implements RevealStep {
26:
27:         private final VElement viewModel;
28:         private final EObject domainModel;
29:         private final RevealStep nextStep;
30:         private final Runnable revealAction;
31:
32:         /**
33:          * Initializes me.
34:          *
35:          * @param viewModel the view model in which I reveal the object
36:          * @param domainModel the object that I reveal
37:          * @param nextStep the next step in the drill-down sequence
38:          * @param revealAction the action that performs the reveal in the UI
39:          */
40:         IntermediateStep(VElement viewModel, EObject domainModel, RevealStep nextStep, Runnable revealAction) {
41:                 super();
42:
43:                 this.viewModel = viewModel;
44:                 this.domainModel = domainModel;
45:                 this.nextStep = nextStep;
46:                 this.revealAction = revealAction;
47:         }
48:
49:         @Override
50:         public RevealStepKind getType() {
51:                 return RevealStepKind.INTERMEDIATE;
52:         }
53:
54:         @Override
55:         public VElement getViewModel() {
56:                 return viewModel;
57:         }
58:
59:         @Override
60:         public EObject getDomainModel() {
61:                 return domainModel;
62:         }
63:
64:         @Override
65:         public EStructuralFeature getFeature() {
66:                 return null;
67:         }
68:
69:         @Override
70:         public RevealStep drillDown() {
71:                 reveal();
72:
73:                 return nextStep;
74:         }
75:
76:         @Override
77:         public void reveal() {
78:•                if (revealAction != null) {
79:                         revealAction.run();
80:                 }
81:         }
82:
83: }