3 * Copyright (C) 2016 EDIT
4 * European Distributed Institute of Taxonomy
5 * http://www.e-taxonomy.eu
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.
10 package eu
.etaxonomy
.taxeditor
.ui
.dialog
;
12 import eu
.etaxonomy
.cdm
.model
.common
.TermType
;
13 import eu
.etaxonomy
.cdm
.model
.reference
.Reference
;
14 import eu
.etaxonomy
.cdm
.model
.taxon
.Classification
;
15 import eu
.etaxonomy
.cdm
.model
.taxon
.TaxonRelationshipType
;
16 import eu
.etaxonomy
.taxeditor
.ui
.combo
.TermComboElement
;
17 import eu
.etaxonomy
.taxeditor
.ui
.element
.CdmFormFactory
;
18 import eu
.etaxonomy
.taxeditor
.ui
.element
.ICdmFormElement
;
19 import eu
.etaxonomy
.taxeditor
.ui
.element
.TextWithLabelElement
;
20 import eu
.etaxonomy
.taxeditor
.ui
.section
.AbstractCdmDetailElement
;
21 import eu
.etaxonomy
.taxeditor
.ui
.selection
.EntitySelectionElement
;
28 public class CloneClassificationDetailElement
extends
29 AbstractCdmDetailElement
<Classification
>{
31 private TextWithLabelElement txtClassificationName
;
32 private TermComboElement
<TaxonRelationshipType
> comboRelationType
;
33 private EntitySelectionElement
<Reference
> selectReference
;
35 public CloneClassificationDetailElement(CdmFormFactory formFactory
, ICdmFormElement formElement
) {
36 super(formFactory
, formElement
);
40 protected void createControls(ICdmFormElement formElement
, Classification entity
, int style
) {
41 txtClassificationName
= formFactory
.createTextWithLabelElement(formElement
, "Classification name", null, style
);
42 comboRelationType
= formFactory
.createDefinedTermComboElement(TermType
.TaxonRelationshipType
, formElement
, "Taxon relation", null, style
);
43 selectReference
= formFactory
.createSelectionElement(Reference
.class, getConversationHolder(), formElement
, "Reference", null, EntitySelectionElement
.SELECTABLE
, style
);
47 public void handleEvent(Object eventSource
) {
50 public String
getClassificationName(){
51 return txtClassificationName
.getText();
54 public TaxonRelationshipType
getRelationType(){
55 return comboRelationType
.getSelection();
58 public Reference
getReference(){
59 return selectReference
.getSelection();