Project

General

Profile

Revision 2965ad0f

ID2965ad0f69b0e7d2018ea44409dcf484ec208e97
Parent 9ef7ae67
Child 0619074d

Added by Patrick Plitzner about 3 years ago

ref #6907 Show factual data for derivatives

View differences:

eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/DescriptiveContentProvider.java
11 11
import java.util.Set;
12 12

  
13 13
import org.eclipse.jface.viewers.ITreeContentProvider;
14
import org.eclipse.jface.viewers.TreeNode;
14 15
import org.eclipse.jface.viewers.Viewer;
15 16

  
16 17
import eu.etaxonomy.cdm.model.common.Marker;
......
58 59
	/** {@inheritDoc} */
59 60
	@Override
60 61
    public Object[] getChildren(Object parentElement) {
62
	    if(parentElement instanceof TreeNode){
63
	        parentElement = ((TreeNode) parentElement).getValue();
64
	    }
61 65
		if (parentElement instanceof IDescribable<?>) {
62 66
			return getDescriptions((IDescribable<?>) parentElement).toArray();
63 67
		}
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/e4/FactualDataPartE4.java
31 31
import org.eclipse.jface.viewers.IStructuredSelection;
32 32
import org.eclipse.jface.viewers.ITreeContentProvider;
33 33
import org.eclipse.jface.viewers.StructuredSelection;
34
import org.eclipse.jface.viewers.TreeNode;
34 35
import org.eclipse.jface.viewers.TreeViewer;
35 36
import org.eclipse.jface.viewers.Viewer;
36 37
import org.eclipse.swt.SWT;
......
174 175
                    return;
175 176
                }
176 177
            }
177

  
178
            if(firstElement instanceof TreeNode){
179
                firstElement = ((TreeNode) firstElement).getValue();
180
            }
178 181
            if(firstElement instanceof IDescribable<?>
179 182
                && partObject instanceof IPartContentHasFactualData
180 183
                    && !(firstElement instanceof SpecimenOrObservationBase && partObject instanceof BulkEditor)){
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/e4/handler/CreateDescriptionHandler.java
14 14
import org.eclipse.e4.ui.model.application.ui.basic.MPart;
15 15
import org.eclipse.e4.ui.model.application.ui.menu.MMenuItem;
16 16
import org.eclipse.e4.ui.services.IServiceConstants;
17
import org.eclipse.jface.viewers.TreeNode;
17 18

  
18 19
import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
19 20
import eu.etaxonomy.cdm.model.taxon.Taxon;
......
41 42

  
42 43
        AbstractPostOperation<?> operation;
43 44
        Object viewerInput = factualDataPart.getViewer().getInput();
45
        if(viewerInput instanceof TreeNode){
46
            viewerInput = ((TreeNode) viewerInput).getValue();
47
        }
44 48
        if(viewerInput instanceof SpecimenOrObservationBase<?>){
45 49
            operation = new CreateSpecimenDescriptionOperation(menuItem.getLocalizedLabel(), EditorUtil.getUndoContext(), (SpecimenOrObservationBase<?>) viewerInput, factualDataPart);
46 50
            AbstractUtility.executeOperation(operation);

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)