3 * Copyright (C) 2007 EDIT
4 * European Distributed Institute of Taxonomy
5 * http://www.e-taxonomy.eu
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.
11 package eu
.etaxonomy
.taxeditor
.ui
.section
.description
;
13 import org
.eclipse
.swt
.SWT
;
15 import eu
.etaxonomy
.cdm
.model
.description
.DescriptionBase
;
16 import eu
.etaxonomy
.cdm
.model
.description
.FeatureTree
;
17 import eu
.etaxonomy
.taxeditor
.ui
.forms
.CdmFormFactory
;
18 import eu
.etaxonomy
.taxeditor
.ui
.forms
.ICdmFormElement
;
19 import eu
.etaxonomy
.taxeditor
.ui
.forms
.TextWithLabelElement
;
20 import eu
.etaxonomy
.taxeditor
.ui
.forms
.CdmFormFactory
.SelectionType
;
21 import eu
.etaxonomy
.taxeditor
.ui
.section
.AbstractCdmDetailElement
;
22 import eu
.etaxonomy
.taxeditor
.ui
.selection
.FeatureTreeSelectionElement
;
25 * <p>DescriptionDetailElement class.</p>
28 * @created Mar 5, 2010
31 public class DescriptionDetailElement
extends AbstractCdmDetailElement
<DescriptionBase
> {
33 private TextWithLabelElement detailDescription
;
34 private FeatureTreeSelectionElement selection_featureTree
;
37 * <p>Constructor for DescriptionDetailElement.</p>
39 * @param cdmFormFactory a {@link eu.etaxonomy.taxeditor.ui.forms.CdmFormFactory} object.
40 * @param formElement a {@link eu.etaxonomy.taxeditor.ui.forms.ICdmFormElement} object.
43 public DescriptionDetailElement(CdmFormFactory cdmFormFactory
,
44 ICdmFormElement formElement
, int style
) {
45 super(cdmFormFactory
, formElement
);
50 protected void createControls(ICdmFormElement formElement
, DescriptionBase entity
, int style
) {
51 detailDescription
= formFactory
.createMultilineTextWithLabel(this, "Label", 50, SWT
.WRAP
);
52 detailDescription
.setText(entity
.getTitleCache());
54 selection_featureTree
= (FeatureTreeSelectionElement
) formFactory
.createSelectionElement(SelectionType
.FEATURE_TREE
, getConversationHolder(), formElement
, "Feature Tree", null, style
, 1);
59 public void handleEvent(Object eventSource
) {
60 if(eventSource
== detailDescription
){
61 getEntity().setTitleCache(detailDescription
.getText(), true);
63 else if(eventSource
== selection_featureTree
){
64 FeatureTree featureTree
= selection_featureTree
.getSelection();
65 getEntity().setDescriptiveSystem(featureTree
.getDistinctFeatures());