package org.sf.mustru.ui;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.wizard.Wizard;
import org.sf.mustru.crawl.CrawlConfig;
/**
* Build the wizard for initializing the CrawlConfiguration class
*/
public class CrawlConfigWizard extends Wizard
{
public CrawlConfig crawlConfig = null;
/**
* Create the CrawlConfig object from a file or default values
* @param setup boolean
*/
public CrawlConfigWizard(boolean setup)
{
//*-- read from the file or initialize the configuration
setWindowTitle("Crawl Configuration wizard");
crawlConfig = new CrawlConfig(setup);
}
/**
* Add three pages to the wizard
*/
public void addPages()
{ addPage(new FirstPage());
addPage(new SecondPage());
addPage(new ThirdPage());
addPage(new FourthPage());
}
/**
* Write the crawl configuration to a file
*/
public boolean performFinish()
{ if (crawlConfig.dumpConfig()) return true;
return false;
}
/**
* Verify the cancel operation
*/
public boolean performCancel()
{ if ( MessageDialog.openConfirm(getShell(), "Confirm", "Press OK to continue without saving the properties file.") ) return true;
return false;
}
}