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
.element
.CdmFormFactory
;
18 import eu
.etaxonomy
.taxeditor
.ui
.element
.ICdmFormElement
;
19 import eu
.etaxonomy
.taxeditor
.ui
.element
.TextWithLabelElement
;
20 import eu
.etaxonomy
.taxeditor
.ui
.section
.AbstractCdmDetailElement
;
21 import eu
.etaxonomy
.taxeditor
.ui
.selection
.EntitySelectionElement
;
24 * <p>DescriptionDetailElement class.</p>
27 * @created Mar 5, 2010
30 public class DescriptionDetailElement
extends AbstractCdmDetailElement
<DescriptionBase
> {
32 private TextWithLabelElement detailDescription
;
33 private EntitySelectionElement
<FeatureTree
> selection_featureTree
;
36 * <p>Constructor for DescriptionDetailElement.</p>
38 * @param cdmFormFactory a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory} object.
39 * @param formElement a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement} object.
42 public DescriptionDetailElement(CdmFormFactory cdmFormFactory
,
43 ICdmFormElement formElement
, int style
) {
44 super(cdmFormFactory
, formElement
);
49 protected void createControls(ICdmFormElement formElement
, DescriptionBase entity
, int style
) {
50 detailDescription
= formFactory
.createMultilineTextWithLabel(this, "Label", 50, SWT
.WRAP
);
51 detailDescription
.setText(entity
.getTitleCache());
53 // selection_featureTree = (FeatureTreeSelectionElement) formFactory.createSelectionElement(SelectionType.FEATURE_TREE, getConversationHolder(), formElement, "Feature Tree", null, style);
58 public void handleEvent(Object eventSource
) {
59 if(eventSource
== detailDescription
){
60 getEntity().setTitleCache(detailDescription
.getText(), true);
62 else if(eventSource
== selection_featureTree
){
63 FeatureTree featureTree
= selection_featureTree
.getSelection();
64 getEntity().setDescriptiveSystem(featureTree
.getDistinctFeatures());