Project

General

Profile

« Previous | Next » 

Revision d74515be

Added by Katja Luther over 3 years ago

ref #9199: continue adapt editor to singleSourcedEntities

View differences:

eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/supplemental/AbstractReferencedEntityElement.java
9 9

  
10 10
package eu.etaxonomy.taxeditor.ui.section.supplemental;
11 11

  
12
import org.eclipse.swt.SWT;
13 12
import org.eclipse.swt.events.SelectionListener;
14 13

  
15
import eu.etaxonomy.cdm.model.common.SingleSourcedEntityBase;
16
import eu.etaxonomy.cdm.model.reference.Reference;
17
import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
14
import eu.etaxonomy.cdm.model.common.AnnotatableEntity;
18 15
import eu.etaxonomy.taxeditor.ui.element.AbstractFormSection;
19 16
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
20 17
import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
21 18
import eu.etaxonomy.taxeditor.ui.element.ISelectableElement;
22 19
import eu.etaxonomy.taxeditor.ui.element.SelectionArbitrator;
23
import eu.etaxonomy.taxeditor.ui.element.TextWithLabelElement;
24 20
import eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionElement;
25
import eu.etaxonomy.taxeditor.ui.selection.EntitySelectionElement;
26 21

  
27 22
/**
28 23
 * @author n.hoffmann
......
33 28

  
34 29
	private SelectionArbitrator selectionArbitrator;
35 30

  
36
	protected EntitySelectionElement<Reference> selection_reference;
37
	protected TextWithLabelElement text_referenceDetail;
31
//	protected EntitySelectionElement<Reference> selection_reference;
32
//	protected TextWithLabelElement text_referenceDetail;
38 33

  
39 34
	protected boolean isCommonNameReference = false;
40 35

  
......
61 56

  
62 57
	@Override
63 58
	public void createControls(ICdmFormElement formElement, int style) {
64
	    if (isCommonNameReference && PreferencesUtil.getFilterCommonNameReferences()){
65
	        selection_reference = formFactory
66
                    .createCommonNameReferenceSelectionElement(formElement, "Reference",
67
                            null, EntitySelectionElement.ALL, style);
68
	    }else{
69
	        selection_reference = formFactory
70
	                .createSelectionElement(Reference.class,//getConversationHolder(),
71
	                         formElement, "Reference",
72
	                        null, EntitySelectionElement.ALL, style);
73
	    }
74

  
75
		text_referenceDetail = formFactory.createTextWithLabelElement(
76
				formElement, "Reference Detail", null, SWT.NULL);
59

  
77 60
	}
78 61

  
79 62
	@Override
80 63
	public void setEntity(T entity) {
81 64
		this.entity = entity;
82 65

  
83
		selection_reference.setEntity(entity.getCitation());
84
		text_referenceDetail.setText(entity.getCitationMicroReference());
66

  
85 67
	}
86 68

  
87 69
	@Override

Also available in: Unified diff