Merge branch 'develop' into LibrAlign
[taxeditor.git] / eu.etaxonomy.taxeditor.store / src / main / java / eu / etaxonomy / taxeditor / ui / dialog / CloneClassificationDetailElement.java
1 /**
2 * Copyright (C) 2016 EDIT
3 * European Distributed Institute of Taxonomy
4 * http://www.e-taxonomy.eu
5 *
6 * The contents of this file are subject to the Mozilla Public License Version 1.1
7 * See LICENSE.TXT at the top of this package for the full license terms.
8 */
9 package eu.etaxonomy.taxeditor.ui.dialog;
10
11 import eu.etaxonomy.cdm.model.common.TermType;
12 import eu.etaxonomy.cdm.model.reference.Reference;
13 import eu.etaxonomy.cdm.model.taxon.Classification;
14 import eu.etaxonomy.cdm.model.taxon.TaxonRelationshipType;
15 import eu.etaxonomy.taxeditor.ui.combo.TermComboElement;
16 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
17 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
18 import eu.etaxonomy.taxeditor.ui.element.TextWithLabelElement;
19 import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
20 import eu.etaxonomy.taxeditor.ui.selection.EntitySelectionElement;
21
22 /**
23 * @author pplitzner
24 * @date Nov 6, 2016
25 *
26 */
27 public class CloneClassificationDetailElement extends
28 AbstractCdmDetailElement<Classification>{
29
30 private TextWithLabelElement txtClassificationName;
31 private TermComboElement<TaxonRelationshipType> comboRelationType;
32 private EntitySelectionElement<Reference> selectReference;
33
34 public CloneClassificationDetailElement(CdmFormFactory formFactory, ICdmFormElement formElement) {
35 super(formFactory, formElement);
36 }
37
38 @Override
39 protected void createControls(ICdmFormElement formElement, Classification entity, int style) {
40 txtClassificationName = formFactory.createTextWithLabelElement(formElement, "Classification name", null, style);
41 comboRelationType = formFactory.createDefinedTermComboElement(TermType.TaxonRelationshipType, formElement, "Taxon relation", null, style);
42 selectReference = formFactory.createSelectionElement(Reference.class, getConversationHolder(), formElement, "Reference", null, EntitySelectionElement.SELECTABLE, style);
43 }
44
45 @Override
46 public void handleEvent(Object eventSource) {
47 }
48
49 public String getClassificationName(){
50 return txtClassificationName.getText();
51 }
52
53 public TaxonRelationshipType getRelationType(){
54 return comboRelationType.getSelection();
55 }
56
57 public Reference getReference(){
58 return selectReference.getSelection();
59 }
60
61 }