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.description;
|
11
|
|
12
|
import org.eclipse.jface.viewers.ISelectionProvider;
|
13
|
|
14
|
import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
|
15
|
import eu.etaxonomy.cdm.model.description.DescriptionBase;
|
16
|
import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
|
17
|
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
|
18
|
import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
|
19
|
import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
|
20
|
import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;
|
21
|
|
22
|
/**
|
23
|
* <p>DescriptionDetailSection class.</p>
|
24
|
*
|
25
|
* @author n.hoffmann
|
26
|
* @created Mar 5, 2010
|
27
|
*/
|
28
|
public class DescriptionDetailSection extends AbstractCdmDetailSection<DescriptionBase<?>> {
|
29
|
|
30
|
/**
|
31
|
* <p>Constructor for DescriptionDetailSection.</p>
|
32
|
*
|
33
|
* @param cdmFormFactory a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory} object.
|
34
|
* @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
|
35
|
* @param parentElement a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement} object.
|
36
|
* @param selectionProvider a {@link org.eclipse.jface.viewers.ISelectionProvider} object.
|
37
|
* @param style a int.
|
38
|
*/
|
39
|
public DescriptionDetailSection(CdmFormFactory cdmFormFactory, ConversationHolder conversation,
|
40
|
ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style) {
|
41
|
super(cdmFormFactory, conversation, parentElement, selectionProvider, style);
|
42
|
|
43
|
}
|
44
|
|
45
|
@Override
|
46
|
public String getHeading() {
|
47
|
return "Description";
|
48
|
}
|
49
|
|
50
|
@Override
|
51
|
protected AbstractCdmDetailElement<DescriptionBase<?>> createCdmDetailElement(AbstractCdmDetailSection<DescriptionBase<?>> parentElement, int style) {
|
52
|
return formFactory.createDescriptionDetailElement(parentElement, style);
|
53
|
}
|
54
|
|
55
|
@Override
|
56
|
public void setEntity(DescriptionBase<?> entity) {
|
57
|
super.setEntity(entity);
|
58
|
|
59
|
if ((entity.isComputed() || entity.isCloneForSource())&& PreferencesUtil.isComputedDesciptionHandlingDisabled()){
|
60
|
setEnabled(false);
|
61
|
this.getDetailElement().setEnabled(false);
|
62
|
}
|
63
|
}
|
64
|
}
|