including changes from cdmlib-print
[taxeditor.git] / taxeditor-editor / src / main / java / eu / etaxonomy / taxeditor / section / classification / ClassificationWizardPage.java
1 // $Id$
2 /**
3 * Copyright (C) 2007 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
11 package eu.etaxonomy.taxeditor.section.classification;
12
13
14 import org.apache.log4j.Logger;
15 import org.eclipse.swt.SWT;
16
17 import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
18 import eu.etaxonomy.cdm.model.taxon.Classification;
19 import eu.etaxonomy.taxeditor.forms.AbstractCdmEntityWizardPage;
20 import eu.etaxonomy.taxeditor.forms.CdmFormFactory;
21 import eu.etaxonomy.taxeditor.forms.CdmFormFactory.DetailType;
22 import eu.etaxonomy.taxeditor.forms.ICdmFormElement;
23
24 /**
25 * <p>ClassificationWizardPage class.</p>
26 *
27 * @author n.hoffmann
28 * @created 23.06.2009
29 * @version 1.0
30 */
31 public class ClassificationWizardPage extends AbstractCdmEntityWizardPage<Classification>{
32 private static final Logger logger = Logger
33 .getLogger(ClassificationWizardPage.class);
34
35 /**
36 * <p>Constructor for ClassificationWizardPage.</p>
37 *
38 * @param formFactory a {@link eu.etaxonomy.taxeditor.forms.CdmFormFactory} object.
39 * @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
40 * @param entity a {@link eu.etaxonomy.cdm.model.taxon.TaxonomicTree} object.
41 */
42 public ClassificationWizardPage(CdmFormFactory formFactory, ConversationHolder conversation, Classification entity){
43 super(formFactory, conversation, entity);
44 setTitle("Classification");
45 }
46
47 /* (non-Javadoc)
48 * @see eu.etaxonomy.taxeditor.forms.AbstractCdmEntityWizardPage#createElement(eu.etaxonomy.taxeditor.forms.ICdmFormElement)
49 */
50 /** {@inheritDoc} */
51 @Override
52 public ClassificationDetailElement createElement(ICdmFormElement rootElement) {
53 ClassificationDetailElement detailElement = (ClassificationDetailElement) formFactory.createCdmDetailElement(DetailType.CLASSIFICATION, rootElement, SWT.NULL);
54 detailElement.setEntity(getEntity());
55
56 return detailElement;
57 }
58
59 /**
60 * <p>getClassification</p>
61 *
62 * @return a {@link eu.etaxonomy.cdm.model.taxon.TaxonomicTree} object.
63 */
64 public Classification getClassification() {
65 return getDetailElement().getEntity();
66 }
67 }