4 package eu
.etaxonomy
.taxeditor
.editor
.descriptiontree
.detailpage
;
6 import org
.eclipse
.jface
.util
.PropertyChangeEvent
;
7 import org
.eclipse
.swt
.SWT
;
8 import org
.eclipse
.swt
.widgets
.Composite
;
10 import eu
.etaxonomy
.cdm
.model
.description
.Feature
;
11 import eu
.etaxonomy
.cdm
.model
.description
.TaxonInteraction
;
12 import eu
.etaxonomy
.cdm
.model
.taxon
.Taxon
;
13 import eu
.etaxonomy
.taxeditor
.forms
.MultilineTextWithLabel
;
14 import eu
.etaxonomy
.taxeditor
.forms
.selectioncomposites
.TaxonSelectionComposite
;
15 import eu
.etaxonomy
.taxeditor
.store
.CdmStore
;
21 public class TaxonInteractionDetailsSection
extends
22 AbstractDescriptionDetailSection
{
24 private TaxonSelectionComposite taxonSelection
;
25 private MultilineTextWithLabel interactionDescription
;
32 public TaxonInteractionDetailsSection(Composite parent
,
33 AbstractDescriptionDetailsPage page
, int sectionStyle
) {
34 super(parent
, page
, sectionStyle
);
36 taxonSelection
= toolkit
.createTaxonSelectionComposite(getClient(), null, SWT
.WRAP
);
37 taxonSelection
.addPropertyChangeListener(this);
39 interactionDescription
= toolkit
.createMultilineTextWithLabel(getClient(), "Description", 200, SWT
.WRAP
);
40 interactionDescription
.addPropertyChangeListener(this);
44 * @see eu.etaxonomy.taxeditor.editor.descriptiontree.detailpage.AbstractDescriptionDetailSection#updateSection()
47 public void updateSection() {
48 Feature feature
= getDescriptionElement().getFeature();
49 this.setText(feature
.getLabel() + " Details"); //$NON-NLS-1$
51 taxonSelection
.setSelection(getTaxonInteraction().getTaxon2());
52 interactionDescription
.setText(getTaxonInteraction().getDescription(CdmStore
.getDefaultLanguage()));
56 * @see eu.etaxonomy.taxeditor.editor.descriptiontree.detailpage.AbstractDescriptionDetailSection#propertyChange(org.eclipse.jface.util.PropertyChangeEvent)
59 public void propertyChange(PropertyChangeEvent event
) {
60 super.propertyChange(event
);
61 getTaxonInteraction().addDescription(interactionDescription
.getText(), CdmStore
.getDefaultLanguage());
62 getTaxonInteraction().setTaxon2((Taxon
) taxonSelection
.getSelection());
65 public TaxonInteraction
getTaxonInteraction(){
66 return (TaxonInteraction
) getDescriptionElement();