Skip to content

Commit

Permalink
70: refactored self assessment project wizard
Browse files Browse the repository at this point in the history
  • Loading branch information
LorenzoBettini committed Jun 6, 2016
1 parent dade956 commit 052876a
Showing 1 changed file with 6 additions and 9 deletions.
Expand Up @@ -3,14 +3,13 @@
*/
package javamm.ui.wizard.selfassessment;

import org.eclipse.ui.dialogs.WizardNewProjectCreationPage;
import org.eclipse.xtext.ui.wizard.IExtendedProjectInfo;

import com.google.inject.Inject;

import javamm.selfassessment.builder.builder.JavammSelfAssessmentNature;
import javamm.ui.wizard.JavammNewProjectWizard;
import javamm.ui.wizard.JavammProjectInfo;
import javamm.ui.wizard.JavammWizardNewProjectCreationPage;

/**
* We need to redefine it just to change titles, descriptions and project names.
Expand All @@ -20,38 +19,36 @@
*/
public class JavammNewSelfAssessmentProjectWizard extends JavammNewProjectWizard {

private WizardNewProjectCreationPage mainPage;

@Inject
public JavammNewSelfAssessmentProjectWizard(JavammSelfAssessmentProjectCreator projectCreator) {
super(projectCreator);
setWindowTitle("New Java-- Self-Assessment Projects");
}

/**
* Use this method to add pages to the wizard.
* The one-time generated version of this class will add a default new project page to the wizard.
*/
@Override
public void addPages() {
mainPage = new WizardNewProjectCreationPage("basicNewProjectPage");
super.addPages();
JavammWizardNewProjectCreationPage mainPage = getMainPage();
mainPage.setTitle("Java-- Self-Assessment Projects");
mainPage.setDescription("Create a new Java-- self-assessment project set.");
addPage(mainPage);
}

/**
* Use this method to read the project settings from the wizard pages and feed them into the project info class.
*/
@Override
protected IExtendedProjectInfo getProjectInfo() {
JavammProjectInfo projectInfo = new JavammProjectInfo();
IExtendedProjectInfo projectInfo = super.getProjectInfo();
projectInfo.setProjectName(getTeacherStudentProjectName());
return projectInfo;
}

protected String getMainPageProjectName() {
return mainPage.getProjectName();
return getMainPage().getProjectName();
}

protected String getTeacherStudentProjectName() {
Expand Down

0 comments on commit 052876a

Please sign in to comment.