8feeb7d6e617ba899ab87ee9fb60a87400a500e2
[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 import eu.etaxonomy.cdm.ext.occurrence.gbif.GbifResponse;
12
13 public class QueryOriginalRecordCommand extends AbstractHandler {
14
15 /* (non-Javadoc)
16 * @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent)
17 */
18 @Override
19 public Object execute(ExecutionEvent event) throws ExecutionException {
20 final IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
21 final ISelection selection = window.getActivePage().getSelection();
22 if(selection instanceof StructuredSelection){
23 StructuredSelection structuredSelection = (StructuredSelection)selection;
24 if(structuredSelection.size()==1){
25 Object next = structuredSelection.iterator().next();
26 if(next instanceof GbifResponse){
27 String endPoint = ((GbifResponse) next).getEndPointQuery();
28 }
29 }
30 }
31 return null;
32 }
33
34 }