Skip to content

Package: CloseProjectHandler

CloseProjectHandler

nameinstructionbranchcomplexitylinemethod
CloseProjectHandler()
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%
execute(ECPProject)
M: 5 C: 0
0%
M: 2 C: 0
0%
M: 2 C: 0
0%
M: 3 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.ui.e4.handlers;
15:
16: import javax.inject.Named;
17:
18: import org.eclipse.e4.core.di.annotations.Execute;
19: import org.eclipse.e4.core.di.annotations.Optional;
20: import org.eclipse.e4.ui.services.IServiceConstants;
21: import org.eclipse.emf.ecp.core.ECPProject;
22:
23: /**
24: * @author Eugen
25: *
26: */
27: public class CloseProjectHandler {
28:
29:         /**
30:          * Closes the selected {@link ECPProject}.
31:          *
32:          * @param ecpProject the project to be closed
33:          */
34:         @Execute
35:         public void execute(@Named(IServiceConstants.ACTIVE_SELECTION) @Optional ECPProject ecpProject) {
36:•                if (ecpProject != null) {
37:                         ecpProject.close();
38:                 }
39:         }
40: }