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.occurrence;
|
11
|
|
12
|
import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
|
13
|
import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;
|
14
|
import eu.etaxonomy.cdm.model.occurrence.DeterminationEvent;
|
15
|
import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
|
16
|
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
|
17
|
import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
|
18
|
import eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection;
|
19
|
|
20
|
/**
|
21
|
* <p>DeterminationEventDetailSection class.</p>
|
22
|
*
|
23
|
* @author n.hoffmann
|
24
|
* @created Oct 13, 2010
|
25
|
*/
|
26
|
public abstract class AbstractDeterminationEventDetailSection extends
|
27
|
AbstractEntityCollectionSection<DerivedUnitFacade, DeterminationEvent> {
|
28
|
|
29
|
public AbstractDeterminationEventDetailSection(CdmFormFactory formFactory,
|
30
|
ConversationHolder conversation, ICdmFormElement parentElement,
|
31
|
String title, int style) {
|
32
|
super(formFactory, conversation, parentElement, title, style);
|
33
|
}
|
34
|
|
35
|
@Override
|
36
|
public DeterminationEvent createNewElement() {
|
37
|
DeterminationEvent instance = DeterminationEvent.NewInstance();
|
38
|
if(PreferencesUtil.isDeterminationOnlyForFieldUnits()){
|
39
|
instance.setIdentifiedUnit(getEntity().innerFieldUnit());
|
40
|
}
|
41
|
else{
|
42
|
instance.setIdentifiedUnit(getEntity().innerDerivedUnit());
|
43
|
}
|
44
|
return instance;
|
45
|
}
|
46
|
|
47
|
@Override
|
48
|
public void addElement(DeterminationEvent determination) {
|
49
|
getEntity().addDetermination(determination);
|
50
|
}
|
51
|
|
52
|
@Override
|
53
|
public void removeElement(DeterminationEvent determination) {
|
54
|
getEntity().removeDetermination(determination);
|
55
|
}
|
56
|
|
57
|
@Override
|
58
|
public String getEmptyString() {
|
59
|
return "No determinations yet.";
|
60
|
}
|
61
|
}
|