Skip to content

Package: ShowHistoryViewHelper

ShowHistoryViewHelper

nameinstructionbranchcomplexitylinemethod
showHistoryView(EObject, Shell)
M: 8 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
showHistoryView(InternalProject, Shell)
M: 12 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 3 C: 0
0%
M: 1 C: 0
0%
showHistoryView(Object, Shell)
M: 16 C: 0
0%
M: 4 C: 0
0%
M: 3 C: 0
0%
M: 5 C: 0
0%
M: 1 C: 0
0%

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 - initial API and implementation
13: ******************************************************************************/
14: package org.eclipse.emf.ecp.emfstore.internal.ui.handler;
15:
16: import org.eclipse.emf.ecore.EObject;
17: import org.eclipse.emf.ecp.emfstore.core.internal.EMFStoreProvider;
18: import org.eclipse.emf.ecp.spi.core.InternalProject;
19: import org.eclipse.emf.emfstore.client.ESLocalProject;
20: import org.eclipse.emf.emfstore.internal.client.ui.controller.UIShowHistoryController;
21: import org.eclipse.swt.widgets.Shell;
22:
23: /**
24: * This is the EMFStore ShowHistory Helper delegating to the EMFStore {@link UIShowHistoryController}.
25: *
26: * @author Eugen Neufeld
27: *
28: */
29: public final class ShowHistoryViewHelper {
30:         private ShowHistoryViewHelper() {
31:         }
32:
33:         /**
34:          * Shows an HistoryView based on an {@link Object}. Delegates to {@link UIShowHistoryController}.
35:          *
36:          * @param object the {@link Object}
37:          * @param shell the {@link Shell}
38:          */
39:         public static void showHistoryView(Object object, Shell shell) {
40:•                if (object instanceof EObject) {
41:                         showHistoryView((EObject) object, shell);
42:•                } else if (object instanceof InternalProject) {
43:                         showHistoryView((InternalProject) object, shell);
44:                 }
45:         }
46:
47:         private static void showHistoryView(InternalProject internalProject, Shell shell) {
48:                 final ESLocalProject localProject = EMFStoreProvider.INSTANCE.getProjectSpace(internalProject);
49:                 new UIShowHistoryController(shell, localProject).execute();
50:         }
51:
52:         private static void showHistoryView(EObject object, Shell shell) {
53:                 new UIShowHistoryController(shell, object).execute();
54:         }
55: }