9580c5cbabcb2e425dd28a0403fc784ad70b0cdd
[taxeditor.git] / eu.etaxonomy.taxeditor.editor / src / main / java / eu / etaxonomy / taxeditor / editor / view / dataimport / QueryOriginalRecordCommand.java
1 package eu.etaxonomy.taxeditor.editor.view.dataimport;
2
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;
10
11 public class QueryOriginalRecordCommand extends AbstractHandler {
12
13 /* (non-Javadoc)
14 * @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent)
15 */
16 @Override
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);
27 // }
28 }
29 }
30 return null;
31 }
32
33 }