1 package eu
.etaxonomy
.taxeditor
.handler
;
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
.IStructuredSelection
;
8 import org
.eclipse
.ui
.handlers
.HandlerUtil
;
10 import eu
.etaxonomy
.taxeditor
.view
.CdmViewerChooser
;
12 public class OpenHandler
extends AbstractHandler
{
15 public Object
execute(ExecutionEvent event
) throws ExecutionException
{
16 ISelection currentSelection
= HandlerUtil
.getCurrentSelection(event
);
17 if(currentSelection
instanceof IStructuredSelection
){
18 Object firstElement
= ((IStructuredSelection
) currentSelection
).getFirstElement();
19 CdmViewerChooser viewerChooser
= new CdmViewerChooser(HandlerUtil
.getActiveShell(event
));
20 viewerChooser
.chooseViewer(firstElement
, event
);