Project

General

Profile

Download (3.1 KB) Statistics
| Branch: | Tag: | Revision:
1 74b9f670 n.hoffmann
// $Id$
2
/**
3
* Copyright (C) 2007 EDIT
4
* European Distributed Institute of Taxonomy 
5
* http://www.e-taxonomy.eu
6
* 
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.
9
*/
10
11 f211dd28 n.hoffmann
package eu.etaxonomy.taxeditor.ui.section.occurrence;
12 74b9f670 n.hoffmann
13
import java.util.Collection;
14
15
import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
16
import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;
17 49a64920 Cherian Mathew
import eu.etaxonomy.cdm.model.occurrence.DerivedUnit;
18 dbe52ecb Cherian Mathew
import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationType;
19 78222507 n.hoffmann
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
20 dacb59c9 Patric Plitzner
import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
21 f211dd28 n.hoffmann
import eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection;
22 74b9f670 n.hoffmann
23
/**
24 3be6ef3e n.hoffmann
 * <p>SpecimenCollectionDetailSection class.</p>
25
 *
26 74b9f670 n.hoffmann
 * @author n.hoffmann
27
 * @created Oct 14, 2010
28
 * @version 1.0
29
 */
30
public class SpecimenCollectionDetailSection extends
31 49a64920 Cherian Mathew
		AbstractEntityCollectionSection<DerivedUnitFacade, DerivedUnit> {
32 74b9f670 n.hoffmann
33
	/**
34 3be6ef3e n.hoffmann
	 * <p>Constructor for SpecimenCollectionDetailSection.</p>
35
	 *
36 78222507 n.hoffmann
	 * @param formFactory a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory} object.
37 3be6ef3e n.hoffmann
	 * @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
38 78222507 n.hoffmann
	 * @param parentElement a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement} object.
39 3be6ef3e n.hoffmann
	 * @param style a int.
40 74b9f670 n.hoffmann
	 */
41
	public SpecimenCollectionDetailSection(CdmFormFactory formFactory,
42
			ConversationHolder conversation, ICdmFormElement parentElement, int style) {
43
		super(formFactory, conversation, parentElement, "Duplicates", style);
44
	}
45
46
	/* (non-Javadoc)
47
	 * @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionSection#getCollection(java.lang.Object)
48
	 */
49 3be6ef3e n.hoffmann
	/** {@inheritDoc} */
50 74b9f670 n.hoffmann
	@Override
51 49a64920 Cherian Mathew
	public Collection<DerivedUnit> getCollection(DerivedUnitFacade entity) {
52 74b9f670 n.hoffmann
		return entity.getDuplicates();
53
	}
54
55
	/* (non-Javadoc)
56
	 * @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionSection#createNewElement()
57
	 */
58 3be6ef3e n.hoffmann
	/** {@inheritDoc} */
59 74b9f670 n.hoffmann
	@Override
60 dbe52ecb Cherian Mathew
	public DerivedUnit createNewElement() {		
61
		return DerivedUnit.NewInstance(SpecimenOrObservationType.PreservedSpecimen);		
62 74b9f670 n.hoffmann
	}
63
64
	/* (non-Javadoc)
65
	 * @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionSection#addElement(eu.etaxonomy.cdm.model.common.IVersionableEntity)
66
	 */
67 3be6ef3e n.hoffmann
	/** {@inheritDoc} */
68 74b9f670 n.hoffmann
	@Override
69 49a64920 Cherian Mathew
	public void addElement(DerivedUnit element) {
70 74b9f670 n.hoffmann
		getEntity().addDuplicate(element);
71
	}
72
73
	/* (non-Javadoc)
74
	 * @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionSection#removeElement(eu.etaxonomy.cdm.model.common.IVersionableEntity)
75
	 */
76 3be6ef3e n.hoffmann
	/** {@inheritDoc} */
77 74b9f670 n.hoffmann
	@Override
78 49a64920 Cherian Mathew
	public void removeElement(DerivedUnit element) {
79 74b9f670 n.hoffmann
		getEntity().removeDuplicate(element);
80
	}
81
82
	/* (non-Javadoc)
83
	 * @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionSection#getEmptyString()
84
	 */
85 3be6ef3e n.hoffmann
	/** {@inheritDoc} */
86 74b9f670 n.hoffmann
	@Override
87
	public String getEmptyString() {
88
		return "No duplicates yet.";
89
	}
90
91
	/* (non-Javadoc)
92
	 * @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionSection#getTooltipString()
93
	 */
94 3be6ef3e n.hoffmann
	/** {@inheritDoc} */
95 74b9f670 n.hoffmann
	@Override
96
	protected String getTooltipString() {
97
		return "Add a duplicate";
98
	}
99
100
}