1 package eu
.etaxonomy
.taxeditor
.editor
.view
.dataimport
;
3 import org
.eclipse
.core
.commands
.AbstractHandler
;
4 import org
.eclipse
.core
.commands
.ExecutionEvent
;
5 import org
.eclipse
.core
.commands
.ExecutionException
;
6 import org
.eclipse
.jface
.viewers
.ISelection
;
7 import org
.eclipse
.jface
.viewers
.StructuredSelection
;
8 import org
.eclipse
.ui
.IWorkbenchWindow
;
9 import org
.eclipse
.ui
.PlatformUI
;
11 public class QueryOriginalRecordCommand
extends AbstractHandler
{
14 * @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent)
17 public Object
execute(ExecutionEvent event
) throws ExecutionException
{
18 final IWorkbenchWindow window
= PlatformUI
.getWorkbench().getActiveWorkbenchWindow();
19 final ISelection selection
= window
.getActivePage().getSelection();
20 if(selection
instanceof StructuredSelection
){
21 StructuredSelection structuredSelection
= (StructuredSelection
)selection
;
22 if(structuredSelection
.size()==1){
23 Object next
= structuredSelection
.iterator().next();
24 // if(next instanceof GbifResponse){
25 // InputStream inputStream = new GbifQueryServiceWrapper().queryForOriginalRecord((GbifResponse)next);
26 // BioCaseEditorInput input = new BioCaseEditorInput(query);