Project

General

Profile

Revision a076655a

IDa076655afe4f472bd5474c04b4e448a22b40b5b0
Parent a86e2c4a
Child 3fb2dd8d

Added by Patrick Plitzner about 3 years ago

ref #6596 Fix selection handling for descriptive view

View differences:

eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/DescriptiveViewPart.java
176 176
            // description selected in this view
177 177
            return;
178 178
        }
179
		// unpackage TreeNode of DerivateView
180
		else if(partObject instanceof E4PartWrapper && ((E4PartWrapper)partObject).getPartName().equals("%command.label.DERIVATIVE_EDITOR")){
181
		    TreeNode treeNodeOfSelection = EditorUtil.getTreeNodeOfSelection(selection);
182
		    if(treeNodeOfSelection!=null){
183
		        selection = new StructuredSelection(treeNodeOfSelection.getValue());
184
		        showViewer(partObject, (IStructuredSelection) selection);
185
			    return;
186
		    }
187
		}
188 179
        else if(partObject instanceof ChecklistEditor){
189 180
            if(selection instanceof StructuredSelection  && ((IStructuredSelection) selection).getFirstElement() instanceof Taxon){
190 181
                Taxon taxon = (Taxon)((IStructuredSelection) selection).getFirstElement();
191 182
                selection = new StructuredSelection(taxon);
192 183
            }
193 184
        }
194
		if(selection instanceof IStructuredSelection
195
		        && ((IStructuredSelection) selection).getFirstElement() instanceof IDescribable<?>
196
		        && partObject instanceof IPartContentHasFactualData  && !(((IStructuredSelection) selection).getFirstElement() instanceof SpecimenOrObservationBase && partObject instanceof BulkEditor)){
197
		    featureNodeContainerCache.clear();
198
		    showViewer(partObject, (IStructuredSelection) selection);
199
		    return;
200
		}
201
		else{
202
		    showEmptyPage();
203
		}
185
        //check if it is a tree node selection
186
        TreeNode treeNodeOfSelection = EditorUtil.getTreeNodeOfSelection(selection);
187
        if(treeNodeOfSelection!=null){
188
            selection = new StructuredSelection(treeNodeOfSelection.getValue());
189
        }
190
        if(selection instanceof IStructuredSelection){
191
            Object firstElement = ((IStructuredSelection) selection).getFirstElement();
192
            if(firstElement instanceof IDescribable<?>
193
            && partObject instanceof IPartContentHasFactualData  && !(firstElement instanceof SpecimenOrObservationBase && partObject instanceof BulkEditor)){
194
                featureNodeContainerCache.clear();
195
                showViewer(partObject, (IStructuredSelection) selection);
196
                return;
197
            }
198
        }
199
        else{
200
            showEmptyPage();
201
        }
204 202
	}
205 203

  
206 204
	@Override

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)