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.facade.DerivedUnitFacade;
|
13
|
import eu.etaxonomy.taxeditor.store.StoreUtil;
|
14
|
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
|
15
|
import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
|
16
|
import eu.etaxonomy.taxeditor.ui.element.LayoutConstants;
|
17
|
import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
|
18
|
|
19
|
/**
|
20
|
* @author n.hoffmann
|
21
|
* @created May 11, 2011
|
22
|
* @version 1.0
|
23
|
*/
|
24
|
public class DeterminationDetailElement extends AbstractCdmDetailElement<DerivedUnitFacade> {
|
25
|
|
26
|
private CurrentDeterminationDetailSection section_currentDetermination;
|
27
|
|
28
|
private DeterminationHistoryDetailSection section_determinationHistory;
|
29
|
|
30
|
/**
|
31
|
* @param formFactory
|
32
|
* @param formElement
|
33
|
*/
|
34
|
public DeterminationDetailElement(CdmFormFactory formFactory,
|
35
|
ICdmFormElement formElement) {
|
36
|
super(formFactory, formElement);
|
37
|
}
|
38
|
|
39
|
/* (non-Javadoc)
|
40
|
* @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement#createControls(eu.etaxonomy.taxeditor.ui.forms.ICdmFormElement, java.lang.Object, int)
|
41
|
*/
|
42
|
@Override
|
43
|
protected void createControls(ICdmFormElement formElement,
|
44
|
DerivedUnitFacade entity, int style) {
|
45
|
|
46
|
section_currentDetermination = formFactory.createCurrentDeterminationDetailSection(getConversationHolder(), formElement, StoreUtil.getSectionStyle(CurrentDeterminationDetailSection.class, entity.getClass().getCanonicalName(), true));
|
47
|
section_currentDetermination.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
|
48
|
section_currentDetermination.setEntity(entity);
|
49
|
|
50
|
section_determinationHistory = formFactory.createDeterminationHistoryDetailSection(getConversationHolder(), formElement, StoreUtil.getSectionStyle(DeterminationHistoryDetailSection.class, entity.getClass().getCanonicalName()));
|
51
|
section_determinationHistory.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
|
52
|
section_determinationHistory.setEntity(entity);
|
53
|
|
54
|
}
|
55
|
|
56
|
/* (non-Javadoc)
|
57
|
* @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement#handleEvent(java.lang.Object)
|
58
|
*/
|
59
|
@Override
|
60
|
public void handleEvent(Object eventSource) {
|
61
|
if(eventSource == section_currentDetermination){
|
62
|
section_determinationHistory.refresh();
|
63
|
}
|
64
|
}
|
65
|
|
66
|
}
|