1 package eu
.etaxonomy
.taxeditor
.editor
.view
.dataimport
;
5 import org
.eclipse
.core
.commands
.AbstractHandler
;
6 import org
.eclipse
.core
.commands
.ExecutionEvent
;
7 import org
.eclipse
.core
.commands
.ExecutionException
;
8 import org
.eclipse
.jface
.viewers
.ISelection
;
9 import org
.eclipse
.jface
.viewers
.StructuredSelection
;
10 import org
.eclipse
.ui
.IWorkbenchWindow
;
11 import org
.eclipse
.ui
.PlatformUI
;
13 import eu
.etaxonomy
.cdm
.ext
.occurrence
.gbif
.GbifResponse
;
15 public class QueryOriginalRecordCommand
extends AbstractHandler
{
18 * @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent)
21 public Object
execute(ExecutionEvent event
) throws ExecutionException
{
22 final IWorkbenchWindow window
= PlatformUI
.getWorkbench().getActiveWorkbenchWindow();
23 final ISelection selection
= window
.getActivePage().getSelection();
24 if(selection
instanceof StructuredSelection
){
25 StructuredSelection structuredSelection
= (StructuredSelection
)selection
;
26 if(structuredSelection
.size()==1){
27 Object next
= structuredSelection
.iterator().next();
28 if(next
instanceof GbifResponse
){
29 URI endPoint
= ((GbifResponse
) next
).getDataSetUri();