merge-update from trunk
[taxeditor.git] / eu.etaxonomy.taxeditor.store / src / main / java / eu / etaxonomy / taxeditor / newWizard / AmplificationGeneralWizardPage.java
1 // $Id$
2 /**
3 * Copyright (C) 2014 EDIT
4 * European Distributed Institute of Taxonomy
5 * http://www.e-taxonomy.eu
6 *
7 * The contents of this file are subject to the Mozilla Public License Version 1.1
8 * See LICENSE.TXT at the top of this package for the full license terms.
9 */
10 package eu.etaxonomy.taxeditor.newWizard;
11
12 import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
13 import eu.etaxonomy.cdm.model.molecular.Amplification;
14 import eu.etaxonomy.taxeditor.ui.element.AbstractCdmEntityWizardPage;
15 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
16 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
17 import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
18 import eu.etaxonomy.taxeditor.ui.section.occurrence.dna.AmplificationGeneralDetailElement;
19
20 /**
21 * @author pplitzner
22 * @date 11.03.2014
23 *
24 */
25 public class AmplificationGeneralWizardPage extends AbstractCdmEntityWizardPage<Amplification> {
26
27 /**
28 * @param formFactory
29 * @param conversation
30 * @param entity
31 */
32 public AmplificationGeneralWizardPage(CdmFormFactory formFactory,
33 ConversationHolder conversation, Amplification entity) {
34 super(formFactory, conversation, entity);
35 setTitle("General Amplification Data");
36 }
37
38 /* (non-Javadoc)
39 * @see eu.etaxonomy.taxeditor.ui.forms.AbstractCdmEntityWizardPage#checkComplete()
40 */
41 @Override
42 protected void checkComplete() {
43 //TODO: check for institution, staff and date
44 //one of them has to be set otherwise setPageComplete(false);
45 setPageComplete(true);
46 }
47
48 /* (non-Javadoc)
49 * @see eu.etaxonomy.taxeditor.forms.AbstractCdmEntityWizardPage#createElement(eu.etaxonomy.taxeditor.forms.ICdmFormElement)
50 */
51 @Override
52 public AbstractCdmDetailElement<Amplification> createElement(ICdmFormElement rootElement) {
53 AmplificationGeneralDetailElement detailElement = formFactory.createAmplificationGeneralDetailElement(rootElement);
54 detailElement.setEntity(getEntity());
55 checkComplete();
56 return detailElement;
57 }
58
59 }