Project

General

Profile

Download (2.33 KB) Statistics
| Branch: | Tag: | Revision:
1
// $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
package eu.etaxonomy.taxeditor.ui.section.occurrence;
12

    
13
import org.eclipse.ui.forms.widgets.ExpandableComposite;
14

    
15
import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;
16
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
17
import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
18
import eu.etaxonomy.taxeditor.ui.element.LayoutConstants;
19
import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
20

    
21
/**
22
 * @author n.hoffmann
23
 * @created May 11, 2011
24
 * @version 1.0
25
 */
26
public class DeterminationDetailElement extends AbstractCdmDetailElement<DerivedUnitFacade> {
27

    
28
	private CurrentDeterminationDetailSection section_currentDetermination;
29

    
30
	private DeterminationHistoryDetailSection section_determinationHistory;
31

    
32
	/**
33
	 * @param formFactory
34
	 * @param formElement
35
	 */
36
	public DeterminationDetailElement(CdmFormFactory formFactory,
37
			ICdmFormElement formElement) {
38
		super(formFactory, formElement);
39
	}
40

    
41
	/* (non-Javadoc)
42
	 * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement#createControls(eu.etaxonomy.taxeditor.ui.forms.ICdmFormElement, java.lang.Object, int)
43
	 */
44
	@Override
45
	protected void createControls(ICdmFormElement formElement,
46
			DerivedUnitFacade entity, int style) {
47

    
48
        section_currentDetermination = formFactory.createCurrentDeterminationDetailSection(getConversationHolder(), formElement, ExpandableComposite.EXPANDED);
49
        section_currentDetermination.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
50
        section_currentDetermination.setEntity(entity);
51

    
52
        section_determinationHistory = formFactory.createDeterminationHistoryDetailSection(getConversationHolder(), formElement, ExpandableComposite.TWISTIE);
53
        section_determinationHistory.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
54
        section_determinationHistory.setEntity(entity);
55

    
56
	}
57

    
58
	/* (non-Javadoc)
59
	 * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement#handleEvent(java.lang.Object)
60
	 */
61
	@Override
62
	public void handleEvent(Object eventSource) {
63
		if(eventSource == section_currentDetermination){
64
			section_determinationHistory.refresh();
65
		}
66
	}
67

    
68
}
(13-13/36)