Project

General

Profile

Revision 12addc56

ID12addc56e71b065b36ba5ca00f449243e3a44cda
Parent 74ca5142
Child 070a27a4

Added by Katja Luther 6 months ago

ref #9337, #9287: show details of term and supplemental data of term node

View differences:

eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/CdmFormFactory.java
1788 1788
     * @return
1789 1789
     */
1790 1790
    public AbstractCdmDetailElement createDefinedTermDetailElement(Class definedTermClass,
1791
            AbstractCdmDetailSection parentElement, int style) {
1791
            ICdmFormElement parentElement, int style) {
1792 1792
        AbstractCdmDetailElement element = null;
1793 1793

  
1794 1794
        if (NamedArea.class.isAssignableFrom(definedTermClass)) {
......
3136 3136
            element = new InapplicableIfCollectionElement(this, parentElement, (FeatureState) entity, removeListener, backgroundColor, style);
3137 3137
        } else if (entity instanceof FeatureState && parentElement instanceof OnlyApplicableIfEntityCollectionSection) {
3138 3138
            element = new OnlyApplicableIfCollectionElement(this, parentElement, (FeatureState) entity, removeListener, backgroundColor, style);
3139
        } else if (entity instanceof FeatureState && parentElement instanceof InapplicableIfEntityCollectionSectionForNode) {
3140
            element = new InapplicableIfCollectionElement(this, parentElement, (FeatureState) entity, removeListener, backgroundColor, style);
3141
        } else if (entity instanceof FeatureState && parentElement instanceof OnlyApplicableIfEntityCollectionSectionForNode) {
3142
            element = new OnlyApplicableIfCollectionElement(this, parentElement, (FeatureState) entity, removeListener, backgroundColor, style);
3139 3143
        }
3140 3144

  
3141 3145
        //check for parent section when entity is null
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/feature/TermNodeDetailElement.java
18 18
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
19 19
import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
20 20
import eu.etaxonomy.taxeditor.ui.element.LayoutConstants;
21
import eu.etaxonomy.taxeditor.ui.element.RepresentationElement;
22
import eu.etaxonomy.taxeditor.ui.element.TextWithLabelElement;
23
import eu.etaxonomy.taxeditor.ui.element.UriWithLabelElement;
24 21
import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
25 22

  
26 23
/**
......
33 30

  
34 31
    private InapplicableIfEntityCollectionSection sectionInapplicableIf;
35 32
    private OnlyApplicableIfEntityCollectionSection sectionOnlyApplicableIf;
36
    //Term details
37
    private TextWithLabelElement textIdInVocabulary;
38
    private TextWithLabelElement textSymbol;
39
    private TextWithLabelElement textSymbol2;
40
    private UriWithLabelElement uri_uri;
41
    private RepresentationElement element_Representation;
42

  
43 33

  
44 34
	public TermNodeDetailElement(CdmFormFactory formFactory,
45 35
			ICdmFormElement formElement) {
......
48 38

  
49 39
	@Override
50 40
	protected void createControls(ICdmFormElement formElement, TermNodeDto entity, int style) {
41

  
42

  
51 43
	    sectionInapplicableIf = formFactory.createInapplicableIfEntityCollectionSection(getConversationHolder(),
52 44
                    formElement, StoreUtil.getSectionStyle(InapplicableIfEntityCollectionSection.class, getEntity().getClass().getCanonicalName()));
53 45
	    sectionInapplicableIf.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
......
57 49
	    sectionOnlyApplicableIf.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
58 50
	    sectionOnlyApplicableIf.setEntity(getEntity());
59 51

  
60
	    DefinedTermBase term = CdmStore.getService(ITermService.class).load(entity.getTerm().getUuid());
61 52

  
53
	    DefinedTermBase term = CdmStore.getService(ITermService.class).load(getEntity().getTerm().getUuid());
62 54
	    AbstractCdmDetailElement termDetailElement = formFactory.createDefinedTermDetailElement(term.getClass(), formElement, style);
63

  
64 55
	    termDetailElement.setEntity(term);
65 56
	    termDetailElement.setEnabled(false);
66 57

  
......
71 62
	    EventUtility.postEvent(WorkbenchEventConstants.ADD_SAVE_CANDIDATE, getEntity().getUuid());
72 63
	}
73 64

  
65

  
66

  
74 67
}
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/feature/TermTreeDetailElement.java
86 86
	    else if (eventSource == isFlat) {
87 87
	        getEntity().setFlat(isFlat.getSelection());
88 88
	    }
89
	    EventUtility.postEvent(WorkbenchEventConstants.ADD_SAVE_CANDIDATE, getEntity().getUuid());
89
	    EventUtility.postEvent(WorkbenchEventConstants.ADD_SAVE_CANDIDATE, getEntity());
90 90

  
91 91
	}
92 92
}
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/e4/AbstractCdmEditorPartE4.java
33 33

  
34 34
import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
35 35
import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
36
import eu.etaxonomy.cdm.api.service.ITermNodeService;
36 37
import eu.etaxonomy.cdm.api.service.ITermService;
37 38
import eu.etaxonomy.cdm.api.service.IVocabularyService;
38 39
import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
......
41 42
import eu.etaxonomy.cdm.model.taxon.TaxonNode;
42 43
import eu.etaxonomy.cdm.model.taxon.TaxonRelationship;
43 44
import eu.etaxonomy.cdm.persistence.dto.TermDto;
45
import eu.etaxonomy.cdm.persistence.dto.TermNodeDto;
44 46
import eu.etaxonomy.cdm.persistence.dto.TermVocabularyDto;
45 47
import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap;
46 48
import eu.etaxonomy.taxeditor.editor.ITaxonEditor;
......
174 176
        }
175 177
        if(delaySelection==null){
176 178
            delaySelection = new DelaySelection(selection, activePart, thisPart);
179
        }else{
180
            delaySelection.setSelection(selection);
181
            delaySelection.setActivePart(activePart);
182
            delaySelection.setThisPart(thisPart);
177 183
        }
178
        delaySelection.setSelection(selection);
179
        delaySelection.setActivePart(activePart);
180
        delaySelection.setThisPart(thisPart);
181 184
        if(!isInDelay){
182 185
            isInDelay = true;
183 186
            sync.asyncExec(delaySelection);
......
272 275
                    element = CdmStore.getService(IVocabularyService.class).load(((TermVocabularyDto) element).getUuid());
273 276
                }
274 277

  
278

  
275 279
                selectionProvidingPart = activePart;
276 280
                if (viewer instanceof DetailsViewerE4){
277 281

  
......
284 288
                }
285 289

  
286 290
                else{
291
                    if(element instanceof TermNodeDto){
292
                        element = CdmStore.getService(ITermNodeService.class).load(((TermNodeDto) element).getUuid());
293
                    }
287 294
                    if (activePart.getObject() instanceof DetailsPartE4 && element instanceof TaxonName){
288 295
                        selectionProvidingPart = ((DetailsPartE4)activePart.getObject()).getSelectionProvidingPart();
289 296
                    }
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/e4/details/DetailsPartE4.java
94 94
                    return;
95 95
                }
96 96
            }
97
//            if (partObject instanceof IDistributionEditor){
98
//
99
//                showViewer(structuredSelection, activePart, viewer);
100
//                return;
101
//
102
//            }
97

  
103 98
            //FIXME this is a temporary workaround to fix selection handling for supplemental data view
104 99
            // Now the supp data view gets double selection from details view and name editor (see #7126)
100

  
105 101
            viewer.setSelection(structuredSelection, false);
106 102

  
107 103
            showViewer(structuredSelection, activePart, viewer);
108
            if (viewer instanceof DetailsViewerE4){
109 104

  
110
//                ((DetailsViewerE4)viewer).setDetailsEnabled(isEnabled());
111
            }
112 105

  
113 106

  
114 107
            return;
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/e4/supplementaldata/SupplementalDataPartE4.java
33 33
import eu.etaxonomy.cdm.model.taxon.Taxon;
34 34
import eu.etaxonomy.cdm.model.taxon.TaxonRelationship;
35 35
import eu.etaxonomy.cdm.persistence.dto.TermDto;
36
import eu.etaxonomy.cdm.persistence.dto.TermNodeDto;
36 37
import eu.etaxonomy.cdm.persistence.dto.TermVocabularyDto;
37 38
import eu.etaxonomy.taxeditor.editor.ITaxonEditor;
38 39
import eu.etaxonomy.taxeditor.event.WorkbenchEventConstants;
......
132 133
                }
133 134
            }
134 135
	        else if(structuredSelection.getFirstElement() instanceof TermDto
135
	                || structuredSelection.getFirstElement() instanceof TermVocabularyDto){
136
	                || structuredSelection.getFirstElement() instanceof TermVocabularyDto
137
	                || structuredSelection.getFirstElement() instanceof TermNodeDto){
136 138
	            showViewer(structuredSelection, activePart, viewer);
137 139
	            return;
138 140
	        }

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)