Project

General

Profile

Download (1.92 KB) Statistics
| Branch: | Tag: | Revision:
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 java.util.Collection;
13
import java.util.Comparator;
14

    
15
import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
16
import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;
17
import eu.etaxonomy.cdm.model.occurrence.DeterminationEvent;
18
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
19
import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
20
import eu.etaxonomy.taxeditor.ui.section.DefaultCdmBaseComparator;
21

    
22
/**
23
 * @author n.hoffmann
24
 * @created May 11, 2011
25
 */
26
public class DeterminationHistoryDetailSection extends
27
		AbstractDeterminationEventDetailSection {
28

    
29
	/**
30
	 * @param formFactory
31
	 * @param conversation
32
	 * @param parentElement
33
	 * @param style
34
	 */
35
	public DeterminationHistoryDetailSection(CdmFormFactory formFactory,
36
			ConversationHolder conversation, ICdmFormElement parentElement,
37
			int style) {
38
		super(formFactory, conversation, parentElement, "Determination History", style);
39
	}
40

    
41
	@Override
42
	public Collection<DeterminationEvent> getCollection(DerivedUnitFacade entity) {
43
		return entity != null ? entity.getOtherDeterminations() : null;
44
	}
45

    
46
	@Override
47
	public Comparator<DeterminationEvent> getComparator() {
48
        return new DefaultCdmBaseComparator<>();
49
	}
50

    
51
	@Override
52
	public void refresh() {
53
		internalUpdateSection(false);
54
	}
55

    
56
	/** {@inheritDoc} */
57
	@Override
58
	protected String getTooltipString() {
59
		return "Add a determination event to the history";
60
	}
61

    
62
    /**
63
     * {@inheritDoc}
64
     */
65
    @Override
66
    public DeterminationEvent addExisting() {
67
        return null;
68
    }
69

    
70
    /**
71
     * {@inheritDoc}
72
     */
73
    @Override
74
    public boolean allowAddExisting() {
75
        return false;
76
    }
77

    
78
}
(18-18/37)