Skip to content

Package: SelectAttributesWizard

SelectAttributesWizard

nameinstructionbranchcomplexitylinemethod
SelectAttributesWizard(VView)
M: 0 C: 10
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 4
100%
M: 0 C: 1
100%
addPages()
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%
canFinish()
M: 0 C: 9
100%
M: 0 C: 2
100%
M: 0 C: 2
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
getSelectedFeatures()
M: 0 C: 3
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
performFinish()
M: 0 C: 7
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 2
100%
M: 0 C: 1
100%

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: * Alexandra Buzila - initial API and implementation
13: ******************************************************************************/
14: package org.eclipse.emf.ecp.view.internal.editor.handler;
15:
16: import java.util.Set;
17:
18: import org.eclipse.emf.ecore.EClass;
19: import org.eclipse.emf.ecore.EStructuralFeature;
20: import org.eclipse.emf.ecp.view.spi.model.VView;
21: import org.eclipse.jface.wizard.Wizard;
22:
23: /**
24: * @author Alexandra Buzila
25: *
26: */
27: public class SelectAttributesWizard extends Wizard {
28:
29:         private SelectAttributesWizardPage selectAttributesWizardPage;
30:         private final EClass rootClass;
31:         private final VView view;
32:         private Set<EStructuralFeature> selectedFeatures;
33:
34:         /**
35:          * Constructor.
36:          *
37:          * @param view The {@link VView} the Controls are generated for.
38:          */
39:         public SelectAttributesWizard(VView view) {
40:                 this.view = view;
41:                 rootClass = view.getRootEClass();
42:         }
43:
44:         @Override
45:         public void addPages() {
46:                 selectAttributesWizardPage = new SelectAttributesWizardPage();
47:                 selectAttributesWizardPage
48:                         .setDescription("Select the attributes for which controls should be generated."); //$NON-NLS-1$
49:                 selectAttributesWizardPage.setTitle("Select Attributes"); //$NON-NLS-1$
50:
51:                 selectAttributesWizardPage.setRootClass(rootClass);
52:                 selectAttributesWizardPage.setView(view);
53:                 addPage(selectAttributesWizardPage);
54:
55:         }
56:
57:         @Override
58:         public boolean canFinish() {
59:•                return !selectAttributesWizardPage.getSelectedFeatures().isEmpty();
60:         }
61:
62:         @Override
63:         public boolean performFinish() {
64:                 selectedFeatures = selectAttributesWizardPage.getSelectedFeatures();
65:                 return true;
66:         }
67:
68:         /**
69:          *
70:          * @return a {@link Set} of selected {@link EStructuralFeature}
71:          */
72:         public Set<EStructuralFeature> getSelectedFeatures() {
73:                 return selectedFeatures;
74:         }
75: }