1
|
/**
|
2
|
* Copyright (C) 2020 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.section.description.detail;
|
10
|
|
11
|
import eu.etaxonomy.cdm.model.common.ExtendedTimePeriod;
|
12
|
import eu.etaxonomy.cdm.model.description.TemporalData;
|
13
|
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
|
14
|
import eu.etaxonomy.taxeditor.ui.element.ExtendedTimePeriodElement;
|
15
|
import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
|
16
|
|
17
|
/**
|
18
|
* @author k.luther
|
19
|
* @since Jun 12, 2020
|
20
|
*/
|
21
|
public class TemporalDataDetailElement extends AbstractDetailedDescriptionDetailElement<TemporalData> {
|
22
|
|
23
|
ExtendedTimePeriodElement timePeriod;
|
24
|
|
25
|
/**
|
26
|
* @param formFactory
|
27
|
* @param formElement
|
28
|
* @param entity
|
29
|
* @param style
|
30
|
*/
|
31
|
public TemporalDataDetailElement(CdmFormFactory formFactory, ICdmFormElement formElement, TemporalData entity,
|
32
|
int style) {
|
33
|
super(formFactory, formElement, entity, style);
|
34
|
|
35
|
}
|
36
|
|
37
|
@Override
|
38
|
protected void createControls(ICdmFormElement formElement, TemporalData entity, int style) {
|
39
|
ExtendedTimePeriod period = entity.getPeriod();
|
40
|
if (period == null){
|
41
|
period = ExtendedTimePeriod.NewExtendedInstance();
|
42
|
entity.setPeriod(period);
|
43
|
}
|
44
|
timePeriod = formFactory.createExtendedTimePeriodElement(formElement, "", entity.getPeriod(), style);
|
45
|
|
46
|
|
47
|
}
|
48
|
|
49
|
}
|