- // set initial input
-// if(getEditor() != null){
-// viewer.setInput(getEditor().getEditorInput());
-// }
-
- viewer.addDoubleClickListener(new IDoubleClickListener() {
- @Override
- public void doubleClick(DoubleClickEvent event) {
- //Open derivate editor when specimen description element is double clicked
- TreeSelection selection = (TreeSelection) viewer.getSelection();
- Iterator iterator = selection.iterator();
- Set<UUID> specimenUuids = new HashSet<UUID>();
- while(iterator.hasNext()){
- Object next = iterator.next();
- if(next instanceof IndividualsAssociation){
- SpecimenOrObservationBase<?> specimen = ((IndividualsAssociation)next).getAssociatedSpecimenOrObservation();
- if(specimen!=null){
- specimenUuids.add(specimen.getUuid());
- }
- }
- }
- try {
- if(!specimenUuids.isEmpty()){
- EditorUtil.open(new DerivateViewEditorInput(specimenUuids));
- }
- } catch (PartInitException e) {
- MessagingUtils.error(DescriptiveViewPart.class, "Could not open Derivative Editor", e);
- }
-
-
- //TODO: extend command to accept parameter to open editor
-// String commandId = "eu.etaxonomy.taxeditor.editor.handler.openDerivateView";
-// IHandlerService handlerService = (IHandlerService) AbstractUtility.getService(IHandlerService.class);
-// try {
-// handlerService.executeCommand(commandId, null);
-// } catch (ExecutionException e) {
-// MessagingUtils.error(DerivateSearchCompositeController.class, e);
-// } catch (NotDefinedException e) {
-// MessagingUtils.error(DerivateSearchCompositeController.class, e);
-// } catch (NotEnabledException e) {
-// MessagingUtils.error(DerivateSearchCompositeController.class, e);
-// } catch (NotHandledException e) {
-// MessagingUtils.error(DerivateSearchCompositeController.class, e);
-// }
-
- }
- });