Skip to content

Package: EMFStoreHistoryAvailable

EMFStoreHistoryAvailable

nameinstructionbranchcomplexitylinemethod
EMFStoreHistoryAvailable()
M: 3 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
test(Object, String, Object[], Object)
M: 23 C: 0
0%
M: 4 C: 0
0%
M: 3 C: 0
0%
M: 7 C: 0
0%
M: 1 C: 0
0%

Coverage

1: /*******************************************************************************
2: * Copyright (c) 2011-2012 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: *******************************************************************************/
15: package org.eclipse.emf.ecp.emfstore.internal.ui.property;
16:
17: import org.eclipse.core.expressions.PropertyTester;
18: import org.eclipse.emf.ecp.core.ECPProject;
19: import org.eclipse.emf.ecp.core.ECPProvider;
20: import org.eclipse.emf.ecp.core.util.ECPUtil;
21: import org.eclipse.emf.ecp.emfstore.core.internal.EMFStoreProvider;
22:
23: /**
24: * This tests whether a historyview is available either for a project or for an EObject.
25: *
26: * @author Tobias Verhoeven
27: */
28: public class EMFStoreHistoryAvailable extends PropertyTester {
29:
30:         /** {@inheritDoc} */
31:         @Override
32:         public boolean test(Object receiver, String property, Object[] args, Object expectedValue) {
33:                 final ECPProject project = ECPUtil.getECPProjectManager().getProject(receiver);
34:•                if (project == null) {
35:                         return false;
36:                 }
37:                 final ECPProvider provider = project.getProvider();
38:•                if (provider != null) {
39:                         return Boolean.valueOf(provider.getName().equals(EMFStoreProvider.NAME)).equals(expectedValue);
40:                 }
41:                 return false;
42:         }
43: }