Project

General

Profile

Download (2.31 KB) Statistics
| Branch: | Tag: | Revision:
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.ui.section.classification;
12

    
13
import org.eclipse.jface.wizard.Wizard;
14
import org.eclipse.swt.widgets.Display;
15

    
16
import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
17
import eu.etaxonomy.cdm.model.reference.Reference;
18
import eu.etaxonomy.cdm.model.taxon.Classification;
19
import eu.etaxonomy.cdm.model.taxon.TaxonRelationshipType;
20
import eu.etaxonomy.taxeditor.store.CdmStore;
21
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
22

    
23
/**
24
 *
25
 * @author pplitzner
26
 * @date Nov 6, 2016
27
 *
28
 */
29

    
30
public class CloneClassificationWizard extends Wizard{
31

    
32
	private CloneClassificationWizardPage cloneClassificationWizardPage;
33

    
34
    private ConversationHolder conversationHolder;
35

    
36
    private CdmFormFactory formFactory;
37

    
38
    private String classificationName;
39

    
40
    private TaxonRelationshipType relationType;
41

    
42
    private Reference reference;
43

    
44
    public CloneClassificationWizard(Classification classification) {
45
        super();
46
        conversationHolder = CdmStore.createConversation();
47
        formFactory = new CdmFormFactory(Display.getCurrent(), null);
48
        cloneClassificationWizardPage = new CloneClassificationWizardPage(formFactory, conversationHolder, classification);
49
        addPage(cloneClassificationWizardPage);
50
    }
51

    
52

    
53
    @Override
54
    public boolean canFinish() {
55
        return cloneClassificationWizardPage.getClassificationName()!=null
56
                && cloneClassificationWizardPage.getRelationType()!=null &&
57
                        cloneClassificationWizardPage.getReference()!=null;
58
    }
59

    
60
    @Override
61
    public boolean performFinish() {
62
        classificationName = cloneClassificationWizardPage.getClassificationName();
63
        relationType = cloneClassificationWizardPage.getRelationType();
64
        reference = cloneClassificationWizardPage.getReference();
65
        return true;
66
    }
67

    
68

    
69
    public String getClassificationName(){
70
        return classificationName;
71
    }
72

    
73
    public TaxonRelationshipType getRelationType(){
74
        return relationType;
75
    }
76

    
77
    public Reference getReference(){
78
        return reference;
79
    }
80

    
81
}
(5-5/12)