Project

General

Profile

Download (3.02 KB) Statistics
| Branch: | Tag: | Revision:
1
// $Id$
2
/**
3
* Copyright (C) 2013 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
package eu.etaxonomy.taxeditor.ui.section.occurrence.media;
11

    
12
import org.eclipse.jface.viewers.ISelectionProvider;
13

    
14
import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
15
import eu.etaxonomy.cdm.model.occurrence.MediaSpecimen;
16
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
17
import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
18
import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
19
import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;
20
import eu.etaxonomy.taxeditor.view.derivateSearch.DerivateLabelProvider;
21

    
22
/**
23
 * @author pplitzner
24
 * @date 12.12.2013
25
 *
26
 */
27
public class MediaSpecimenGeneralDetailSection  extends AbstractCdmDetailSection<MediaSpecimen> {
28

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

    
42

    
43
    /* (non-Javadoc)
44
     * @see eu.etaxonomy.taxeditor.section.AbstractCdmDetailSection#getHeading()
45
     */
46
    @Override
47
    public String getHeading() {
48
        return "General Media Specimen";
49
    }
50

    
51
    /* (non-Javadoc)
52
     * @see org.eclipse.ui.forms.widgets.ExpandableComposite#setText(java.lang.String)
53
     */
54
    @Override
55
    public void setText(String title) {
56
        String text = null;
57
        if(getEntity()!=null && getEntity().getKindOfUnit()!=null){
58
            if(getEntity().getKindOfUnit().equals(DerivateLabelProvider.getArtworkTerm())){
59
                text = "Artwork";
60
            }
61
            else if(getEntity().getKindOfUnit().equals(DerivateLabelProvider.getLivingPlantPhotoTerm())){
62
                text = "Living Plant Photo";
63
            }
64
            else if(getEntity().getKindOfUnit().equals(DerivateLabelProvider.getSpecimenScanTerm())){
65
                text = "Specimen Scan";
66
            }
67
            else if(getEntity().getKindOfUnit().equals(DerivateLabelProvider.getDetailImageTerm())){
68
                text = "Detail Image";
69
            }
70
        }
71
        if(text!=null){
72
            super.setText(text);
73
        }
74
        else{
75
            super.setText(title);
76
        }
77
    }
78

    
79
    /* (non-Javadoc)
80
     * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#createCdmDetailElement(eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection, int)
81
     */
82
    @Override
83
    protected AbstractCdmDetailElement<MediaSpecimen> createCdmDetailElement(AbstractCdmDetailSection<MediaSpecimen> parentElement, int style) {
84
        return formFactory.createMediaSpecimenGeneralDetailElement(parentElement);
85
    }
86
}
(4-4/6)