Skip to content

Package: EmptyDetailViewCache

EmptyDetailViewCache

nameinstructionbranchcomplexitylinemethod
EmptyDetailViewCache()
M: 0 C: 3
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 2
100%
M: 0 C: 1
100%
cacheView(ECPSWTView)
M: 0 C: 6
100%
M: 1 C: 1
50%
M: 1 C: 1
50%
M: 0 C: 3
100%
M: 0 C: 1
100%
clear()
M: 0 C: 1
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
getCachedView(EObject)
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%
isCached(EObject)
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) 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.emf.ecp.view.spi.swt.masterdetail;
15:
16: import org.eclipse.emf.ecore.EObject;
17: import org.eclipse.emf.ecp.ui.view.swt.ECPSWTView;
18:
19: /**
20: * The {@linkplain DetailViewCache#EMPTY empty detail view cache}.
21: */
22: class EmptyDetailViewCache implements DetailViewCache {
23:
24:         /**
25:          * Initializes me.
26:          */
27:         EmptyDetailViewCache() {
28:                 super();
29:         }
30:
31:         @Override
32:         public boolean isCached(EObject selection) {
33:                 return false;
34:         }
35:
36:         @Override
37:         public ECPSWTView getCachedView(EObject selection) {
38:                 return null;
39:         }
40:
41:         @Override
42:         public boolean cacheView(ECPSWTView ecpView) {
43:•                if (ecpView != null) {
44:                         // Dispose the view because we cannot cache it, so it would never be reused
45:                         ecpView.dispose();
46:                 }
47:                 return false;
48:         }
49:
50:         @Override
51:         public void clear() {
52:                 // I have nothing to clear
53:         }
54:
55: }