Skip to content

Package: LinkWithEditorHandler

LinkWithEditorHandler

nameinstructionbranchcomplexitylinemethod
LinkWithEditorHandler()
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(MPart, MToolItem)
M: 11 C: 0
0%
M: 0 C: 0
100%
M: 1 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 java.util.Map;
17:
18: import org.eclipse.e4.core.di.annotations.Execute;
19: import org.eclipse.e4.ui.model.application.ui.basic.MPart;
20: import org.eclipse.e4.ui.model.application.ui.menu.MToolItem;
21: import org.eclipse.emf.ecp.ui.e4.view.ECPModelView;
22:
23: /**
24: * A Handler for linking the navigator with the part service.
25: *
26: * @author Eugen Neufeld
27: *
28: */
29: public class LinkWithEditorHandler {
30:
31:         /**
32:          * Execute Method.
33:          *
34:          * @param part the {@link MPart}
35:          * @param toolBarElement the selected {@link org.eclipse.e4.ui.model.application.ui.menu.MToolBarElement}
36:          */
37:         @Execute
38:         public void execute(MPart part, MToolItem toolBarElement) {
39:                 final Map<String, String> state = part.getPersistedState();
40:                 state.put(ECPModelView.P_LINK_WITH_EDITOR, String.valueOf(toolBarElement.isSelected()));
41:         }
42:
43: }