1
|
/**
|
2
|
* Copyright (C) 2007 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
|
|
10
|
package eu.etaxonomy.taxeditor.ui.section.description.detail;
|
11
|
|
12
|
import org.eclipse.swt.SWT;
|
13
|
|
14
|
import eu.etaxonomy.cdm.model.description.DescriptionElementBase;
|
15
|
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
|
16
|
import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
|
17
|
import eu.etaxonomy.taxeditor.ui.element.TimePeriodElement;
|
18
|
import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
|
19
|
|
20
|
/**
|
21
|
* <p>Abstract AbstractDetailedDescriptionDetailElement class.</p>
|
22
|
*
|
23
|
* @author n.hoffmann
|
24
|
* @created Jun 10, 2010
|
25
|
* @version 1.0
|
26
|
*/
|
27
|
public abstract class AbstractDetailedDescriptionDetailElement<T extends DescriptionElementBase> extends AbstractCdmDetailElement<T>{
|
28
|
|
29
|
TimePeriodElement timePeriod;
|
30
|
|
31
|
/**
|
32
|
* <p>Constructor for AbstractDetailedDescriptionDetailElement.</p>
|
33
|
*
|
34
|
* @param formFactory a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory} object.
|
35
|
* @param formElement a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement} object.
|
36
|
* @param entity a T object.
|
37
|
* @param style a int.
|
38
|
* @param <T> a T object.
|
39
|
*/
|
40
|
public AbstractDetailedDescriptionDetailElement(CdmFormFactory formFactory,
|
41
|
ICdmFormElement formElement, T entity, int style) {
|
42
|
super(formFactory, formElement);
|
43
|
setEntity(entity);
|
44
|
}
|
45
|
|
46
|
|
47
|
protected void createTimePeriod(ICdmFormElement formElement, DescriptionElementBase entity,
|
48
|
int style) {
|
49
|
timePeriod = formFactory.createTimePeriodElement(this, "Time period", entity.getTimeperiod(), SWT.WRAP);
|
50
|
|
51
|
}
|
52
|
|
53
|
@Override
|
54
|
public void handleEvent(Object eventSource) {
|
55
|
if(eventSource == timePeriod){
|
56
|
getEntity().setTimeperiod(timePeriod.getTimePeriod());
|
57
|
}
|
58
|
}
|
59
|
}
|