Project

General

Profile

« Previous | Next » 

Revision 10041c67

Added by Patrick Plitzner over 8 years ago

Add "Show View" entry for derivative editor

View differences:

eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/OpenDerivateViewHandler.java
24 24
    @Override
25 25
    public Object execute(ExecutionEvent event) throws ExecutionException {
26 26
        Set<UUID> selectedElementUUIDs = new HashSet<UUID>();
27
        Object parameter;
27
        Object parameter = null;
28 28
        //check if parameter is set
29
        try {
29
        if(event.getParameter("eu.etaxonomy.taxeditor.specimenUuidParameter")!=null){
30 30
            parameter = event.getObjectParameterForExecution("eu.etaxonomy.taxeditor.specimenUuidParameter");
31
        } catch (ExecutionException e) {
32
            parameter = null;
33 31
        }
34 32
        if(parameter instanceof UUID){
35 33
            selectedElementUUIDs.add((UUID) parameter);
......
53 51
                }
54 52
            }
55 53
        }
56
        if(!selectedElementUUIDs.isEmpty()){
57
            DerivateViewEditorInput input = new DerivateViewEditorInput(selectedElementUUIDs);
58
            try {
59
                EditorUtil.open(input);
60
            } catch (PartInitException e) {
61
                MessagingUtils.error(OpenDerivateViewHandler.class, "Could not open Derivative Editor", e);
62
            } catch (NullPointerException npe){
63
                MessagingUtils.messageDialog("Failed to open Editor", OpenDerivateViewHandler.class, "Could not open Derivative Editor. The derivate hierarchy is corrupted!", npe);
64
            }
65
        }
66
        else{
67
            MessagingUtils.informationDialog("Empty selection", "No Specimen selected.");
54
        DerivateViewEditorInput input = new DerivateViewEditorInput(selectedElementUUIDs);
55
        try {
56
            EditorUtil.open(input);
57
        } catch (PartInitException e) {
58
            MessagingUtils.error(OpenDerivateViewHandler.class, "Could not open Derivative Editor", e);
59
        } catch (NullPointerException npe){
60
            MessagingUtils.messageDialog("Failed to open Editor", OpenDerivateViewHandler.class, "Could not open Derivative Editor. The derivate hierarchy is corrupted!", npe);
68 61
        }
69 62
        return null;
70 63
    }

Also available in: Unified diff