Skip to content

Package: ExportHandler

ExportHandler

nameinstructionbranchcomplexitylinemethod
ExportHandler()
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(Shell, EObject)
M: 13 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-2013 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: * David Soto Setzke - initial API and implementation
13: *
14: *******************************************************************************/
15: package org.eclipse.emf.ecp.ui.e4.handlers;
16:
17: import java.util.LinkedList;
18: import java.util.List;
19:
20: import javax.inject.Named;
21:
22: import org.eclipse.e4.core.di.annotations.Execute;
23: import org.eclipse.e4.ui.services.IServiceConstants;
24: import org.eclipse.emf.ecore.EObject;
25: import org.eclipse.emf.ecore.util.EcoreUtil;
26: import org.eclipse.emf.ecp.internal.ui.util.ECPExportHandlerHelper;
27: import org.eclipse.swt.widgets.Shell;
28:
29: /**
30: * Handler to export an {@link EObject}.
31: *
32: * @author David
33: *
34: */
35: public class ExportHandler {
36:
37:         /**
38:          * Exports a single {@link EObject}.
39:          *
40:          * @param shell {@link Shell} to use for the dialogs
41:          * @param eObject The {@link EObject} which should be exported
42:          */
43:         @Execute
44:         public void execute(Shell shell, @Named(IServiceConstants.ACTIVE_SELECTION) EObject eObject) {
45:                 final List<EObject> eObjects = new LinkedList<EObject>();
46:                 eObjects.add(EcoreUtil.copy(eObject));
47:                 ECPExportHandlerHelper.export(shell, eObjects);
48:         }
49: }