Skip to content

Package: GenModelEditorTMDCustomization

GenModelEditorTMDCustomization

nameinstructionbranchcomplexitylinemethod
GenModelEditorTMDCustomization(CreateElementCallback, Notifier)
M: 0 C: 9
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 3
100%
M: 0 C: 1
100%
getMenu(TreeViewer, EditingDomain)
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%

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: * Martin Fleck - initial API and implementation
13: ******************************************************************************/
14: package org.eclipse.emfforms.internal.editor.genmodel;
15:
16: import org.eclipse.emf.common.notify.Notifier;
17: import org.eclipse.emf.ecore.EObject;
18: import org.eclipse.emf.ecp.view.spi.context.ViewModelService;
19: import org.eclipse.emf.ecp.view.spi.model.VView;
20: import org.eclipse.emf.edit.domain.EditingDomain;
21: import org.eclipse.emfforms.internal.editor.genmodel.service.GenModelGroupExpansionViewModelService;
22: import org.eclipse.emfforms.internal.editor.genmodel.service.GenModelReadonlyViewModelService;
23: import org.eclipse.emfforms.internal.swt.treemasterdetail.DefaultTreeMasterDetailCustomization;
24: import org.eclipse.emfforms.spi.swt.treemasterdetail.ViewModelServiceProvider;
25: import org.eclipse.emfforms.spi.swt.treemasterdetail.util.CreateElementCallback;
26: import org.eclipse.jface.viewers.TreeViewer;
27: import org.eclipse.swt.widgets.Menu;
28:
29: /**
30: * GenModel Editor-specific customization for the
31: * {@link org.eclipse.emfforms.spi.swt.treemasterdetail.TreeMasterDetailComposite TreeMasterDetailComposite}.
32: *
33: * @author Martin Fleck
34: */
35: @SuppressWarnings("restriction")
36: public class GenModelEditorTMDCustomization extends DefaultTreeMasterDetailCustomization {
37:
38:         /**
39:          * Constructs a new {@link GenModelEditorTMDCustomization}.
40:          *
41:          * @param createElementCallback the {@link CreateElementCallback}
42:          * @param notifier The editor input that is being customized
43:          */
44:         public GenModelEditorTMDCustomization(final CreateElementCallback createElementCallback, Notifier notifier) {
45:                 setViewModelServices(new ViewModelServiceProvider() {
46:                         @Override
47:                         public ViewModelService[] getViewModelServices(VView view, EObject eObject) {
48:                                 return new ViewModelService[] { new GenModelGroupExpansionViewModelService(),
49:                                         new GenModelReadonlyViewModelService() };
50:                         }
51:                 });
52:         }
53:
54:         /**
55:          * {@inheritDoc}
56:          *
57:          * @see org.eclipse.emfforms.internal.swt.treemasterdetail.DefaultTreeViewerCustomization#getMenu(org.eclipse.jface.viewers.TreeViewer,
58:          * org.eclipse.emf.edit.domain.EditingDomain)
59:          */
60:         @Override
61:         public Menu getMenu(TreeViewer treeViewer, EditingDomain editingDomain) {
62:                 // menu not necessary: no cut/copy/paste-action, no EObject-specific actions
63:                 return null;
64:         }
65: }