Revision 2abe4473
Added by Katja Luther almost 7 years ago
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/media/MediaViewPart.java | ||
---|---|---|
24 | 24 |
import org.eclipse.swt.widgets.Tree; |
25 | 25 |
import org.eclipse.ui.IWorkbenchActionConstants; |
26 | 26 |
import org.eclipse.ui.IWorkbenchPart; |
27 |
import org.eclipse.ui.internal.E4PartWrapper; |
|
27 | 28 |
|
29 |
import eu.etaxonomy.cdm.ext.occurrence.gbif.GbifResponse; |
|
28 | 30 |
import eu.etaxonomy.cdm.model.description.IDescribable; |
31 |
import eu.etaxonomy.cdm.model.occurrence.DerivedUnit; |
|
29 | 32 |
import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase; |
30 | 33 |
import eu.etaxonomy.taxeditor.bulkeditor.BulkEditor; |
31 | 34 |
import eu.etaxonomy.taxeditor.editor.l10n.Messages; |
... | ... | |
96 | 99 |
showEmptyPage(); |
97 | 100 |
return; |
98 | 101 |
} |
102 |
|
|
99 | 103 |
|
100 | 104 |
if (part instanceof DetailsViewPart || part instanceof SupplementalDataViewPart |
101 | 105 |
|| part instanceof DescriptiveViewPart) { |
... | ... | |
104 | 108 |
return; |
105 | 109 |
} |
106 | 110 |
|
107 |
if(part instanceof IPartContentHasMedia && ((IPartContentHasMedia) part).canAttachMedia()){ |
|
111 |
if(part instanceof IPartContentHasMedia && ((IPartContentHasMedia) part).canAttachMedia() ){
|
|
108 | 112 |
if(selection instanceof IStructuredSelection){ |
109 | 113 |
Object firstElement = ((IStructuredSelection) selection).getFirstElement(); |
110 | 114 |
if(firstElement instanceof TreeNode){ |
... | ... | |
118 | 122 |
} |
119 | 123 |
} |
120 | 124 |
} |
125 |
if (selection instanceof IStructuredSelection){ |
|
126 |
IStructuredSelection structuredSelection = (IStructuredSelection) selection; |
|
127 |
if(structuredSelection.getFirstElement() instanceof TreeNode){ |
|
128 |
if (((TreeNode)structuredSelection.getFirstElement()).getValue() instanceof SpecimenOrObservationBase){ |
|
129 |
structuredSelection = new StructuredSelection(((TreeNode)structuredSelection.getFirstElement()).getValue()); |
|
130 |
showViewer(part, structuredSelection); |
|
131 |
return; |
|
132 |
} |
|
133 |
} |
|
134 |
} |
|
135 |
|
|
121 | 136 |
showEmptyPage(); |
122 | 137 |
} |
123 | 138 |
|
Also available in: Unified diff
workaround to show media and facts view for derivateView