1 |
5d3fd02f
|
Patrick Plitzner
|
/**
|
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 |
f5979052
|
Katja Luther
|
selectReference = formFactory.createSelectionElement(Reference.class, //getConversationHolder(),
|
43 |
|
|
formElement, "Reference", null, EntitySelectionElement.SELECTABLE, style);
|
44 |
5d3fd02f
|
Patrick Plitzner
|
}
|
45 |
|
|
|
46 |
|
|
@Override
|
47 |
|
|
public void handleEvent(Object eventSource) {
|
48 |
|
|
}
|
49 |
|
|
|
50 |
|
|
public String getClassificationName(){
|
51 |
|
|
return txtClassificationName.getText();
|
52 |
|
|
}
|
53 |
|
|
|
54 |
|
|
public TaxonRelationshipType getRelationType(){
|
55 |
|
|
return comboRelationType.getSelection();
|
56 |
|
|
}
|
57 |
|
|
|
58 |
|
|
public Reference getReference(){
|
59 |
|
|
return selectReference.getSelection();
|
60 |
|
|
}
|
61 |
|
|
|
62 |
|
|
}
|