Skip to content

Package: EcoreShortcutHandler

EcoreShortcutHandler

nameinstructionbranchcomplexitylinemethod
EcoreShortcutHandler()
M: 0 C: 3
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
createNewElementDialog(EditingDomain, ISelectionProvider, EObject, String)
M: 9 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
getDeleteCmdName()
M: 0 C: 2
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
getNewChildCmdName()
M: 2 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
getNewSiblingCmdName()
M: 2 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%

Coverage

1: /*******************************************************************************
2: * Copyright (c) 2011-2016 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: * Johannes Faltermeier - initial API and implementation
13: ******************************************************************************/
14: package org.eclipse.emfforms.internal.editor.ecore;
15:
16: import org.eclipse.emf.ecore.EObject;
17: import org.eclipse.emf.edit.domain.EditingDomain;
18: import org.eclipse.emfforms.internal.editor.handlers.ShortcutHandler;
19: import org.eclipse.jface.dialogs.Dialog;
20: import org.eclipse.jface.viewers.ISelectionProvider;
21: import org.eclipse.swt.widgets.Display;
22:
23: /**
24: * {@link ShortcutHandler} for the EcoreEditor. Uses an accelerator when creating new elements.
25: *
26: * @author Johannes Faltermeier
27: *
28: */
29: public class EcoreShortcutHandler extends ShortcutHandler {
30:
31:         @Override
32:         protected Dialog createNewElementDialog(EditingDomain editingDomain, ISelectionProvider selectionProvider,
33:                 EObject selection, String title) {
34:                 return new EcoreCreateNewChildDialog(Display.getCurrent().getActiveShell(), title, selection,
35:                         selectionProvider);
36:         }
37:
38:         @Override
39:         protected String getNewSiblingCmdName() {
40:                 return "org.eclipse.emfforms.editor.ecore.new.sibling";
41:         }
42:
43:         @Override
44:         protected String getNewChildCmdName() {
45:                 return "org.eclipse.emfforms.editor.ecore.new";
46:         }
47:
48:         @Override
49:         protected String getDeleteCmdName() {
50:                 return "org.eclipse.emfforms.editor.ecore.delete";
51:         }
52: }