View Javadoc

1   /*
2    * This file is a part of CAST project.
3    * (c) Copyright 2007, AGH University of Science & Technology
4    * https://caribou.iisg.agh.edu.pl/trac/cast
5    *
6    * Licensed under the Eclipse Public License, Version 1.0 (the "License").
7    * You may not use this file except in compliance with the License.
8    * You may obtain a copy of the License at
9    * http://www.eclipse.org/legal/epl-v10.html
10   */
11  /*
12   * File: CreateTemplateWizardStrategy.java
13   * Created: 2009-09-27
14   * Author: entrop
15   * $Id$
16   */
17  
18  package pl.edu.agh.cast.importer.wizard.strategy;
19  
20  import pl.edu.agh.cast.importer.wizard.page.AbstractImportWizardPage;
21  
22  /**
23   * New template creation wizard strategy.
24   *
25   * @author AGH CAST Team
26   */
27  public class CreateTemplateWizardStrategy extends AbstractStepByStepImportStrategy {
28  
29  	/**
30  	 * {@inheritDoc}
31  	 *
32  	 * @see pl.edu.agh.cast.importer.wizard.strategy.AbstractStepByStepImportStrategy#
33  	 *      getNextPage(pl.edu.agh.cast.importer.wizard.page.AbstractImportWizardPage)
34  	 */
35  	@Override
36  	public AbstractImportWizardPage getNextPage(AbstractImportWizardPage current) {
37  		final AbstractImportWizardPage actualPage = super.getNextPage(current);
38  		if (actualPage == conversionRulesSelectionPage) {
39  			conversionRulesSelectionPage.setMustSaveTemplate();
40  		}
41  		return actualPage;
42  	}
43  
44  	/**
45  	 * {@inheritDoc}
46  	 *
47  	 * @see pl.edu.agh.cast.importer.wizard.strategy.WithoutTemplateWizardStrategy#performFinish()
48  	 */
49  	@Override
50  	public boolean performFinish() {
51  		return saveTemplate();
52  	}
53  }