-
Notifications
You must be signed in to change notification settings - Fork 0
/
EmfParsleyDslNewProjectWithPredefinedViewWizard.java
65 lines (56 loc) · 2.23 KB
/
EmfParsleyDslNewProjectWithPredefinedViewWizard.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
/*******************************************************************************
* Copyright (c) 2013 RCP Vision (http://www.rcp-vision.com) and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Francesco Guidieri - initial API and implementation
*******************************************************************************/
package org.eclipse.emf.parsley.dsl.ui.wizard;
import org.eclipse.xtext.ui.wizard.IExtendedProjectInfo;
import org.eclipse.xtext.ui.wizard.IProjectCreator;
import com.google.inject.Inject;
/**
* @author Francesco Guidieri
*
*/
public class EmfParsleyDslNewProjectWithPredefinedViewWizard extends EmfParsleyDslNewProjectWizard {
private EmfParsleyDslProjectTemplateSelectionPage selectPredefinedViewPage;
private EmfParsleyDslNewProjectCreationPage mainPage;
@Inject
public EmfParsleyDslNewProjectWithPredefinedViewWizard(IProjectCreator projectCreator) {
super(projectCreator);
}
@Override
public void addPages() {
mainPage = new EmfParsleyDslNewProjectCreationPage("basicNewProjectPage");
mainPage.setTitle("EmfParsleyDsl Project");
mainPage.setDescription("Create a new EmfParsleyDsl project.");
addPage(mainPage);
selectPredefinedViewPage = new EmfParsleyDslProjectTemplateSelectionPage();
selectPredefinedViewPage.setTitle("EmfParsleyDsl Project");
selectPredefinedViewPage.setDescription("Create a new EmfParsleyDsl project.");
addPage(selectPredefinedViewPage);
}
@Override
protected IExtendedProjectInfo getProjectInfo() {
EmfParsleyDslProjectInfo projectInfo = new EmfParsleyDslProjectInfo();
projectInfo.setProjectName(mainPage.getProjectName());
if (!mainPage.useDefaults()) {
projectInfo.setLocationPath(mainPage.getLocationPath());
}
projectInfo.setSelectedTemplate(selectPredefinedViewPage.getSelectedTemplate());
projectInfo.setRapOption(mainPage.isRapOption());
return projectInfo;
}
@Override
public boolean canFinish() {
if (mainPage.isPageComplete()) {
return true;
} else {
return selectPredefinedViewPage.isPageComplete();
}
}
}