3 * Copyright (C) 2007 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.
11 package eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
;
13 import eu
.etaxonomy
.cdm
.api
.conversation
.ConversationHolder
;
14 import eu
.etaxonomy
.cdm
.api
.facade
.DerivedUnitFacade
;
15 import eu
.etaxonomy
.cdm
.model
.occurrence
.DeterminationEvent
;
16 import eu
.etaxonomy
.taxeditor
.preference
.IPreferenceKeys
;
17 import eu
.etaxonomy
.taxeditor
.preference
.PreferencesUtil
;
18 import eu
.etaxonomy
.taxeditor
.ui
.element
.CdmFormFactory
;
19 import eu
.etaxonomy
.taxeditor
.ui
.element
.ICdmFormElement
;
20 import eu
.etaxonomy
.taxeditor
.ui
.section
.AbstractEntityCollectionSection
;
23 * <p>DeterminationEventDetailSection class.</p>
26 * @created Oct 13, 2010
29 public abstract class AbstractDeterminationEventDetailSection
extends
30 AbstractEntityCollectionSection
<DerivedUnitFacade
, DeterminationEvent
> {
35 * @param parentElement
39 public AbstractDeterminationEventDetailSection(CdmFormFactory formFactory
,
40 ConversationHolder conversation
, ICdmFormElement parentElement
,
41 String title
, int style
) {
42 super(formFactory
, conversation
, parentElement
, title
, style
);
46 * @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionSection#createNewElement()
50 public DeterminationEvent
createNewElement() {
51 DeterminationEvent instance
= DeterminationEvent
.NewInstance();
52 if(PreferencesUtil
.getPreferenceStore().getBoolean(IPreferenceKeys
.DETERMINATION_ONLY_FOR_FIELD_UNITS
)){
53 instance
.setIdentifiedUnit(getEntity().innerFieldUnit());
56 instance
.setIdentifiedUnit(getEntity().innerDerivedUnit());
62 * @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionSection#addElement(eu.etaxonomy.cdm.model.common.IVersionableEntity)
66 public void addElement(DeterminationEvent determination
) {
67 getEntity().addDetermination(determination
);
71 * @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionSection#removeElement(eu.etaxonomy.cdm.model.common.IVersionableEntity)
75 public void removeElement(DeterminationEvent determination
) {
76 getEntity().removeDetermination(determination
);
80 * @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionSection#getEmptyString()
84 public String
getEmptyString() {
85 return "No determinations yet.";