- if (input instanceof TaxonEditorInput) {
- Taxon taxon = ((TaxonEditorInput) input).getTaxon();
- AbstractPostOperation<?> operation;
- try {
- // TODO use undo context specific to editor
- operation = new CreateTaxonDescriptionOperation(event.getCommand().getName(),
- EditorUtil.getUndoContext(), taxon, postOperationEnabled, true);
- AbstractUtility.executeOperation(operation);
- } catch (NotDefinedException e) {
- MessagingUtils.warn(getClass(), "Command name not set.");
- }
- }
- else if(input instanceof OccurrenceEditorInput){
- BulkEditor bulkEditor = (BulkEditor) editor;
- ISelection selection = bulkEditor.getSelectionProvider().getSelection();
- invokeOperation(event, postOperationEnabled, selection);
- }
- else if(input instanceof DerivateViewEditorInput){
- ISelection selection = ((DerivateView)editor).getSelection();
- invokeOperation(event, postOperationEnabled, selection);
- } else if(part instanceof MediaViewPart){
- Object viewerInput = ((MediaViewPart)part).getViewer().getInput();
-
- if(viewerInput instanceof Taxon){
- Taxon taxon = HibernateProxyHelper.deproxy(viewerInput, Taxon.class);
- AbstractPostOperation<?> operation;
- try {
- // TODO use undo context specific to editor
- operation = new CreateTaxonDescriptionOperation(event.getCommand().getName(),
- EditorUtil.getUndoContext(), taxon, postOperationEnabled, true);
- AbstractUtility.executeOperation(operation);
- } catch (NotDefinedException e) {
- MessagingUtils.warn(getClass(), "Command name not set.");
- }
-
- }
- }
-
- return null;
- }