Project

General

Profile

Revision 0fcac92e

ID0fcac92e6b25b9471b98bda0df669b5c6253198e
Parent 2ac060fb
Child df79024a

Added by Patrick Plitzner over 2 years ago

ref #8334 Move sources for type designations to details view

View differences:

eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/name/AbstractTypeDesignationElement.java
13 13

  
14 14
import org.eclipse.swt.events.SelectionListener;
15 15

  
16
import eu.etaxonomy.cdm.model.common.IdentifiableSource;
16 17
import eu.etaxonomy.cdm.model.name.TypeDesignationBase;
17 18
import eu.etaxonomy.cdm.model.reference.Reference;
18 19
import eu.etaxonomy.taxeditor.store.StoreUtil;
......
21 22
import eu.etaxonomy.taxeditor.ui.element.CheckboxElement;
22 23
import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
23 24
import eu.etaxonomy.taxeditor.ui.element.ISelectableElement;
25
import eu.etaxonomy.taxeditor.ui.element.LayoutConstants;
24 26
import eu.etaxonomy.taxeditor.ui.element.SelectionArbitrator;
25 27
import eu.etaxonomy.taxeditor.ui.element.TextWithLabelElement;
26 28
import eu.etaxonomy.taxeditor.ui.section.supplemental.AbstractSourcedEntityBaseElement;
29
import eu.etaxonomy.taxeditor.ui.section.supplemental.SourceSection;
27 30
import eu.etaxonomy.taxeditor.ui.selection.EntitySelectionElement;
28 31

  
29 32
/**
......
38 41
	protected CheckboxElement checkbox_notDesignated;
39 42
	protected EntitySelectionElement<Reference> selection_reference;
40 43
    protected TextWithLabelElement text_referenceDetail;
44
    protected SourceSection sourceSection;
41 45
    protected ICdmFormElement formElement;
42 46
    protected int style;
43 47

  
......
60 64
	/** {@inheritDoc} */
61 65
	@Override
62 66
	public void createControls(ICdmFormElement formElement, int style) {
67
        sourceSection = formFactory.createSourceSection(getConversationHolder(), formElement, StoreUtil.getSectionStyle(SourceSection.class, IdentifiableSource.class.getCanonicalName()));
68
        sourceSection.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
63 69
		checkbox_notDesignated = formFactory.createCheckbox(formElement, "Not Designated", false, style);
64 70
		this.formElement = formElement;
65 71
		this.style = style;
......
68 74
	@Override
69 75
	public void setEntity(T entity){
70 76
	    super.setEntity(entity);
77
	    sourceSection.setEntity(entity);
71 78

  
72 79
	    if (this.entity != null && this.entity.isLectoType()){
73 80
	        if (selection_reference == null){
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/name/TextTypeDesignationElement.java
42 42
	public void createControls(ICdmFormElement formElement, int style) {
43 43
        multilanguageTextElement = formFactory.createMultiLanguageTextElement(this, null, entity.getText(), 100, SWT.WRAP);
44 44
        checkIsVerbatim = formFactory.createCheckbox(formElement, "Is Verbatim", getEntity().isVerbatim(), style);
45
        super.createControls(formElement, style);
45 46
	}
46 47

  
47 48
    @Override
......
56 57
	@Override
57 58
	public void setEntity(TextualTypeDesignation entity) {
58 59
	    super.setEntity(entity);
60
	    removeNotDesignatedControls();
59 61
	}
60 62

  
61 63
	@Override
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/e4/supplementaldata/SupplementalDataViewerE4.java
22 22
import eu.etaxonomy.cdm.model.common.VersionableEntity;
23 23
import eu.etaxonomy.cdm.model.description.DescriptionElementBase;
24 24
import eu.etaxonomy.cdm.model.media.IdentifiableMediaEntity;
25
import eu.etaxonomy.cdm.model.name.TypeDesignationBase;
25 26
import eu.etaxonomy.cdm.model.reference.ISourceable;
26 27
import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap;
27 28
import eu.etaxonomy.taxeditor.event.WorkbenchEventConstants;
......
90 91
		if(input instanceof IdentifiableEntity){
91 92
			createIdentifiableSections(rootElement);
92 93
		}
93
		if(input instanceof ISourceable && !(input instanceof IdentifiableEntity) && !(input instanceof DescriptionElementBase)){
94
		if(input instanceof ISourceable
95
		        && !(input instanceof IdentifiableEntity)
96
		        && !(input instanceof DescriptionElementBase)
97
		        && !(input instanceof TypeDesignationBase)
98
		        ){
94 99
            createSourceSection(rootElement);
95 100
        }
96 101
		//4. Identifiable media entity

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)