Project

General

Profile

« Previous | Next » 

Revision 38b32a1d

Added by Patrick Plitzner almost 6 years ago

ref #7010 Adapt name editor handlers for multiple selection

View differences:

eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/e4/handler/ChangeSynonymToAcceptedTaxonHandlerE4.java
135 135
    public boolean canExecute(@Named(IServiceConstants.ACTIVE_SELECTION)IStructuredSelection selection,
136 136
            MHandledMenuItem menuItem){
137 137
        boolean canExecute = false;
138
        Object selectedElement = selection.getFirstElement();
139
        canExecute =
140
                NameEditorMenuPropertyTester.isNotHomotypicSynonymOfAcceptedTaxon(selectedElement)
141
                && !NameEditorMenuPropertyTester.isAccepted(selectedElement)
142
                && !NameEditorMenuPropertyTester.isMisapplication(selectedElement)
143
                && !NameEditorMenuPropertyTester.isProparteSynonym(selectedElement);
144
        menuItem.setVisible(canExecute);
138
        if(selection.size()==1){
139
            Object selectedElement = selection.getFirstElement();
140
            canExecute =
141
                    NameEditorMenuPropertyTester.isNotHomotypicSynonymOfAcceptedTaxon(selectedElement)
142
                    && !NameEditorMenuPropertyTester.isAccepted(selectedElement)
143
                    && !NameEditorMenuPropertyTester.isMisapplication(selectedElement)
144
                    && !NameEditorMenuPropertyTester.isProparteSynonym(selectedElement);
145
            menuItem.setVisible(canExecute);
146
        }
145 147
        return canExecute;
146 148
    }
147 149

  

Also available in: Unified diff