Skip to content

Package: ViewModelEditor

ViewModelEditor

nameinstructionbranchcomplexitylinemethod
ViewModelEditor()
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%
getEditorTitle()
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%
getView()
M: 10 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
hasShortcuts()
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%
modifyEditorInput(ResourceSet)
M: 6 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-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: * Clemens Elflein - initial API and implementation
13: ******************************************************************************/
14: package org.eclipse.emfforms.internal.editor.viewmodel;
15:
16: import org.eclipse.emf.ecore.resource.ResourceSet;
17: import org.eclipse.emf.ecp.view.spi.model.VView;
18: import org.eclipse.emfforms.spi.editor.GenericEditor;
19: import org.eclipse.emfforms.spi.swt.treemasterdetail.util.RootObject;
20:
21: /**
22: * The Editor for ViewModels.
23: *
24: * @author Clemens Elflein
25: */
26: public class ViewModelEditor extends GenericEditor {
27:
28:         /**
29:          * {@inheritDoc}
30:          *
31:          * @see org.eclipse.emfforms.spi.editor.GenericEditor#hasShortcuts()
32:          */
33:         @Override
34:         protected boolean hasShortcuts() {
35:                 return false;
36:         }
37:
38:         /**
39:          * {@inheritDoc}
40:          *
41:          * @see org.eclipse.emfforms.spi.editor.GenericEditor#getEditorTitle()
42:          */
43:         @Override
44:         protected String getEditorTitle() {
45:                 return "View Model Editor";
46:         }
47:
48:         /**
49:          * Returns the currently edited View.
50:          *
51:          * @return The currently edited view
52:          */
53:         public VView getView() {
54:                 return (VView) getResourceSet().getResources().get(0).getAllContents().next();
55:         }
56:
57:         /**
58:          * {@inheritDoc}
59:          *
60:          * @see org.eclipse.emfforms.spi.editor.GenericEditor#modifyEditorInput(org.eclipse.emf.ecore.resource.ResourceSet)
61:          */
62:         @Override
63:         protected Object modifyEditorInput(ResourceSet resourceSet) {
64:                 return new RootObject(getView());
65:         }
66: }