/**
  * Imports example project from JBoss Central from "Start from a sample" section
  *
  * @param project
  */
 public void importExampleProjectFromCentral(CentralExampleProject project) {
   NewProjectExamplesWizardDialogCentral dialog = new NewProjectExamplesWizardDialogCentral();
   dialog.open(project);
   MavenExamplesRequirementPage reqPage = new MavenExamplesRequirementPage();
   checkRequirements(reqPage.getRequirements());
   try {
     new WaitUntil(new MavenRepositoryNotFound());
     fail("Maven repository is not present. Link with message: " + new DefaultLink().getText());
   } catch (WaitTimeoutExpiredException ex) {
     // Do nothing
   }
   dialog.next();
   new WaitWhile(new JobIsRunning(), TimePeriod.VERY_LONG);
   try {
     dialog.finish(project.getProjectName());
   } catch (WaitTimeoutExpiredException ex) { // waiting in dialog.finish()
     // is not enough!
     new WaitWhile(new ShellWithTextIsActive("New Project Example"), TimePeriod.VERY_LONG);
     new WaitWhile(new JobIsRunning(), TimePeriod.LONG);
   }
   checkForErrors();
 }
 /**
  * Imports archetype project from JBoss Central from section "Start from scratch"
  *
  * @param project
  */
 public void importArchetypeProject(ArchetypeProject project) {
   log.step("Import project start");
   JBossCentralProjectWizard dialog = new JBossCentralProjectWizard(project);
   dialog.open();
   NewProjectExamplesStacksRequirementsPage firstPage =
       new NewProjectExamplesStacksRequirementsPage();
   firstPage.setTargetRuntime(1);
   log.step("Import project first page");
   new DefaultLink();
   if (project.isBlank()) {
     firstPage.toggleBlank(project.isBlank());
   }
   checkRequirements(firstPage.getRequirements());
   dialog.next();
   ArchetypeExamplesWizardFirstPage secondPage = new ArchetypeExamplesWizardFirstPage();
   assertFalse("Project Name cannot be empty", secondPage.getProjectName().equals(""));
   dialog.next();
   ArchetypeExamplesWizardPage thirdPage = new ArchetypeExamplesWizardPage();
   assertFalse("Group ID cannot be empty", thirdPage.getGroupID().equals(""));
   NewProjectExamplesReadyPage projectReadyPage = dialog.finishAndWait();
   checkProjectReadyPage(projectReadyPage, project);
   projectReadyPage.finish();
   checkForErrors();
 }