3 //* Copyright (C) 2014 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.
10 //package eu.etaxonomy.taxeditor.ui.section.name;
12 //import org.eclipse.swt.events.SelectionListener;
13 //import org.eclipse.swt.graphics.Color;
15 //import eu.etaxonomy.cdm.model.name.NameRelationship;
16 //import eu.etaxonomy.cdm.model.taxon.Synonym;
17 //import eu.etaxonomy.cdm.model.taxon.SynonymRelationshipType;
18 //import eu.etaxonomy.taxeditor.model.MessagingUtils;
19 //import eu.etaxonomy.taxeditor.ui.combo.TermComboElement;
20 //import eu.etaxonomy.taxeditor.ui.element.AbstractFormSection;
21 //import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
22 //import eu.etaxonomy.taxeditor.ui.element.CheckboxElement;
23 //import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
24 //import eu.etaxonomy.taxeditor.ui.element.LabelElement;
25 //import eu.etaxonomy.taxeditor.ui.element.TextWithLabelElement;
26 //import eu.etaxonomy.taxeditor.ui.section.supplemental.AbstractReferencedEntityElement;
27 //import eu.etaxonomy.taxeditor.ui.selection.EntitySelectionElement;
30 // * @author pplitzner
34 //public class SynonymRelationshipDetailElement extends AbstractReferencedEntityElement<Synonym>{
36 // private TextWithLabelElement text_ruleConsidered;
37 // private LabelElement label;
38 // private EntitySelectionElement selection_toName;
39 // private TermComboElement<SynonymRelationshipType> combo_relationshipType;
40 // private CheckboxElement checkProParte;
41 // private CheckboxElement checkPartial;
44 // * <p>Constructor for NameRelationshipDetailElement.</p>
46 // * @param cdmFormFactory a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory} object.
47 // * @param formElement a {@link eu.etaxonomy.taxeditor.ui.element.AbstractFormSection} object.
48 // * @param entity a {@link eu.etaxonomy.cdm.model.name.NameRelationship} object.
49 // * @param removeListener a {@link org.eclipse.swt.events.SelectionListener} object.
50 // * @param style a int.
52 // public SynonymRelationshipDetailElement(CdmFormFactory cdmFormFactory,
53 // AbstractFormSection formElement,
54 // Synonym entity, SelectionListener removeListener, int style) {
55 // super(cdmFormFactory, formElement, entity, removeListener, style);
59 // * @see eu.etaxonomy.taxeditor.forms.entitysections.AbstractEntitySetElementComposite#createControls(org.eclipse.swt.widgets.Composite, int)
61 // /** {@inheritDoc} */
63 // public void createControls(ICdmFormElement element, int style) {
64 // label = formFactory.createLabel(element, null);
65 // checkProParte = formFactory.createCheckbox(element, "Pro Parte Synonym", null, style);
66 // checkPartial= formFactory.createCheckbox(element, "Partial Synonym", null, style);
67 // super.createControls(element, style);
70 // /** {@inheritDoc} */
72 // public void setEntity(Synonym entity) {
73 // String text = entity.getTitleCache() + " is " + entity.getType().getLabel() + " " + entity.getAcceptedTaxon().getTitleCache();
75 // label.setText(text);
77 // checkPartial.setSelection(entity.isPartial());
78 // checkProParte.setSelection(entity.isProParte());
80 // super.setEntity(entity);
83 // /** {@inheritDoc} */
85 // public void handleEvent(Object eventSource) {
86 // if(eventSource == combo_relationshipType){
87 // getEntity().setType(combo_relationshipType.getSelection());
89 // else if(eventSource == selection_toName){
90 // MessagingUtils.error(getClass(), "No API call available.", null);
92 // else if(eventSource == checkPartial){
93 // getEntity().setPartial(checkPartial.getSelection());
95 // else if(eventSource == checkProParte){
96 // getEntity().setProParte(checkProParte.getSelection());
98 // else if(eventSource == selection_reference){
99 // getEntity().setSec(selection_reference.getSelection());
101 // else if(eventSource == text_referenceDetail){
102 // getEntity().setSecMicroReference(text_referenceDetail.getText());
106 // /** {@inheritDoc} */
108 // public void setBackground(Color color) {
109 // if(label != null) {
110 // label.setBackground(color);
112 // super.setBackground(color);