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