Skip to content

Package: CreateBranchHelper

CreateBranchHelper

nameinstructionbranchcomplexitylinemethod
createBranch(InternalProject, Shell)
M: 17 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 4 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 java.util.Collections;
17:
18: import org.eclipse.emf.ecp.emfstore.core.internal.EMFStoreProvider;
19: import org.eclipse.emf.ecp.spi.core.InternalProject;
20: import org.eclipse.emf.emfstore.client.ESLocalProject;
21: import org.eclipse.emf.emfstore.internal.client.ui.controller.UICreateBranchController;
22: import org.eclipse.swt.widgets.Shell;
23:
24: /**
25: * A CreateBranch Helper. This allows to create a new branch.
26: *
27: * @author Eugen Neufeld
28: *
29: */
30: public final class CreateBranchHelper {
31:
32:         private CreateBranchHelper() {
33:         }
34:
35:         /**
36:          * Creates a branch of an {@link InternalProject}. Delegates the call to {@link UICreateBranchController}.
37:          *
38:          * @param project the {@link InternalProject} to create a branch from
39:          * @param shell the {@link Shell}
40:          */
41:         public static void createBranch(InternalProject project, Shell shell) {
42:                 final ESLocalProject projectSpace = EMFStoreProvider.INSTANCE.getProjectSpace(project);
43:                 // TODO EMFStore constructor missing
44:                 new UICreateBranchController(shell, projectSpace).execute();
45:                 project.notifyObjectsChanged(Collections.singleton((Object) project), false);
46:         }
47: }