Skip to content

Package: SelectEClassForViewWizardPage

SelectEClassForViewWizardPage

nameinstructionbranchcomplexitylinemethod
SelectEClassForViewWizardPage()
M: 0 C: 8
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 3
100%
M: 0 C: 1
100%
createControl(Composite)
M: 0 C: 28
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 8
100%
M: 0 C: 1
100%
isGenerateViewModelOptionSelected()
M: 0 C: 4
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-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: * Lucas Koehler - initial API and implementation
13: ******************************************************************************/
14: package org.eclipse.emf.ecp.view.model.presentation;
15:
16: import org.eclipse.emf.ecp.view.internal.editor.handler.SelectEClassWizardPage;
17: import org.eclipse.swt.SWT;
18: import org.eclipse.swt.widgets.Button;
19: import org.eclipse.swt.widgets.Composite;
20:
21: /**
22: * Wizard page used for selecting a root EClass for a view model. In addition to the {@link SelectEClassWizardPage},
23: * this page also shows a checkbox to configure whether the view model should be filled with the default layout.
24: *
25: * @author Lucas Koehler
26: */
27: public class SelectEClassForViewWizardPage extends SelectEClassWizardPage {
28:         private Button generateViewModelChkBox;
29:
30:         /**
31:          * Create a new instance of {@link SelectEClassForViewWizardPage}.
32:          */
33:         public SelectEClassForViewWizardPage() {
34:                 setDescription(ViewEditorPlugin.getPlugin().getString("_UI_SelectEClassWizardPage_page_description")); //$NON-NLS-1$
35:         }
36:
37:         /**
38:          * Returns whether the option to generate the controls for the created view model is selected.
39:          *
40:          * @return <code>true</code> if the option is selected
41:          */
42:         public boolean isGenerateViewModelOptionSelected() {
43:                 return generateViewModelChkBox.getSelection();
44:         }
45:
46:         @Override
47:         public void createControl(Composite parent) {
48:                 super.createControl(parent);
49:
50:                 final Composite container = (Composite) getControl();
51:                 generateViewModelChkBox = new Button(container, SWT.CHECK);
52:                 generateViewModelChkBox.setText("Fill view model with default layout"); //$NON-NLS-1$
53:                 generateViewModelChkBox.setSelection(true);
54:
55:                 container.layout(true);
56:                 container.pack();
57:         }
58: }