// description selected in this view
return;
}
- // unpackage TreeNode of DerivateView
- else if(partObject instanceof E4PartWrapper && ((E4PartWrapper)partObject).getPartName().equals("%command.label.DERIVATIVE_EDITOR")){
- TreeNode treeNodeOfSelection = EditorUtil.getTreeNodeOfSelection(selection);
- if(treeNodeOfSelection!=null){
- selection = new StructuredSelection(treeNodeOfSelection.getValue());
- showViewer(partObject, (IStructuredSelection) selection);
- return;
- }
- }
else if(partObject instanceof ChecklistEditor){
if(selection instanceof StructuredSelection && ((IStructuredSelection) selection).getFirstElement() instanceof Taxon){
Taxon taxon = (Taxon)((IStructuredSelection) selection).getFirstElement();
selection = new StructuredSelection(taxon);
}
}
- if(selection instanceof IStructuredSelection
- && ((IStructuredSelection) selection).getFirstElement() instanceof IDescribable<?>
- && partObject instanceof IPartContentHasFactualData && !(((IStructuredSelection) selection).getFirstElement() instanceof SpecimenOrObservationBase && partObject instanceof BulkEditor)){
- featureNodeContainerCache.clear();
- showViewer(partObject, (IStructuredSelection) selection);
- return;
- }
- else{
- showEmptyPage();
- }
+ //check if it is a tree node selection
+ TreeNode treeNodeOfSelection = EditorUtil.getTreeNodeOfSelection(selection);
+ if(treeNodeOfSelection!=null){
+ selection = new StructuredSelection(treeNodeOfSelection.getValue());
+ }
+ if(selection instanceof IStructuredSelection){
+ Object firstElement = ((IStructuredSelection) selection).getFirstElement();
+ if(firstElement instanceof IDescribable<?>
+ && partObject instanceof IPartContentHasFactualData && !(firstElement instanceof SpecimenOrObservationBase && partObject instanceof BulkEditor)){
+ featureNodeContainerCache.clear();
+ showViewer(partObject, (IStructuredSelection) selection);
+ return;
+ }
+ }
+ else{
+ showEmptyPage();
+ }
}
@Override