Skip to content

Package: CutMasterDetailAction

CutMasterDetailAction

nameinstructionbranchcomplexitylinemethod
CutMasterDetailAction(EditingDomain)
M: 0 C: 4
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 2
100%
M: 0 C: 1
100%
createDelegatedAction(EditingDomain)
M: 0 C: 5
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
getEMFImagePath()
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%
isExecuteOnKeyRelease(KeyEvent)
M: 0 C: 5
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%

Coverage

1: /*******************************************************************************
2: * Copyright (c) 2011-2015 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: * Stefan Dirix - initial API and implementation
13: ******************************************************************************/
14: package org.eclipse.emfforms.spi.swt.treemasterdetail.actions.delegating;
15:
16: import org.eclipse.emf.edit.domain.EditingDomain;
17: import org.eclipse.emf.edit.ui.action.CommandActionHandler;
18: import org.eclipse.emf.edit.ui.action.CutAction;
19: import org.eclipse.swt.SWT;
20: import org.eclipse.swt.events.KeyEvent;
21:
22: /**
23: * Delegates to {@link CutAction}.
24: *
25: * @author Stefan Dirix
26: * @since 1.8
27: *
28: */
29: public class CutMasterDetailAction extends DelegatingMasterDetailAction {
30:
31:         private static final String ICON_PATH = "icons/cut.gif"; //$NON-NLS-1$
32:
33:         /**
34:          * Constructor.
35:          *
36:          * @param editingDomain
37:          * The {@link EditingDomain} for the {@link CutAction}.
38:          */
39:         public CutMasterDetailAction(EditingDomain editingDomain) {
40:                 super(editingDomain);
41:         }
42:
43:         @Override
44:         protected String getEMFImagePath() {
45:                 return ICON_PATH;
46:         }
47:
48:         @Override
49:         protected CommandActionHandler createDelegatedAction(EditingDomain editingDomain) {
50:                 return new CutAction(editingDomain);
51:         }
52:
53:         @Override
54:         protected boolean isExecuteOnKeyRelease(KeyEvent event) {
55:                 return isActivated(event, SWT.CTRL, 'x');
56:         }
57:
58: }