Project

General

Profile

« Previous | Next » 

Revision 4de13590

Added by Patrick Plitzner almost 6 years ago

ref #7010 Adapt poly key handlers for multiple selection

View differences:

eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/key/polytomous/e4/handler/DeleteNodeHandlerE4.java
148 148
    public boolean canExecute(@Named(IServiceConstants.ACTIVE_SELECTION)IStructuredSelection selection,
149 149
            MHandledMenuItem menuItem){
150 150
        boolean canExecute = false;
151
        canExecute = selection!=null && !selection.isEmpty();
151
        canExecute = selection!=null && selection.size()==1;
152 152
        menuItem.setVisible(canExecute);
153 153
        return canExecute;
154 154
    }
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/key/polytomous/e4/handler/RefreshNodeNumberingHandlerE4.java
3 3
import javax.inject.Named;
4 4

  
5 5
import org.eclipse.core.commands.operations.IUndoContext;
6
import org.eclipse.e4.core.di.annotations.CanExecute;
6 7
import org.eclipse.e4.core.di.annotations.Execute;
7 8
import org.eclipse.e4.ui.di.UISynchronize;
8 9
import org.eclipse.e4.ui.model.application.ui.basic.MPart;
......
41 42
        }
42 43
    }
43 44

  
45
    @CanExecute
46
    public boolean canExecute(@Named(IServiceConstants.ACTIVE_SELECTION)IStructuredSelection selection,
47
            MHandledMenuItem menuItem){
48
        boolean canExecute = false;
49
        canExecute = selection!=null && selection.size()==1;
50
        menuItem.setVisible(canExecute);
51
        return canExecute;
52
    }
44 53
}

Also available in: Unified diff