Skip to content

Package: DataTemplateEditor

DataTemplateEditor

nameinstructionbranchcomplexitylinemethod
DataTemplateEditor()
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%
enableValidation()
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: 17 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-2019 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 Neufeld - initial API and implementation
13: ******************************************************************************/
14: package org.eclipse.emfforms.internal.datatemplate.tooling.editor;
15:
16: import org.eclipse.emf.ecore.resource.ResourceSet;
17: import org.eclipse.emfforms.datatemplate.TemplateCollection;
18: import org.eclipse.emfforms.spi.editor.GenericEditor;
19: import org.eclipse.emfforms.spi.swt.treemasterdetail.util.RootObject;
20:
21: /**
22: * The DataTemplateEditor for editing {@link TemplateCollection}.
23: *
24: * @author Eugen Neufeld
25: *
26: */
27: public class DataTemplateEditor extends GenericEditor {
28:
29:         @Override
30:         protected boolean enableValidation() {
31:                 return true;
32:         }
33:
34:         @Override
35:         protected Object modifyEditorInput(ResourceSet resourceSet) {
36:                 /* this access is save, otherwise we would have thrown a part init exception in init */
37:                 final TemplateCollection collection = TemplateCollection.class
38:                         .cast(resourceSet.getResources().get(0).getContents().get(0));
39:                 return new RootObject(collection);
40:         }
41:
42: }