Package org.sf.mustru.ui

Source Code of org.sf.mustru.ui.CrawlConfigWizard

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;
 

}
TOP

Related Classes of org.sf.mustru.ui.CrawlConfigWizard

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.