Project

General

Profile

« Previous | Next » 

Revision 90cf660a

Added by Patrick Plitzner over 6 years ago

ref #6595 Set visibility of context menu items in name editor

View differences:

eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/e4/handler/DeleteAllEmptyNamesHandlerE4.java
11 11

  
12 12
import javax.inject.Named;
13 13

  
14
import org.eclipse.e4.core.di.annotations.CanExecute;
14 15
import org.eclipse.e4.core.di.annotations.Execute;
15 16
import org.eclipse.e4.ui.model.application.ui.basic.MPart;
16 17
import org.eclipse.e4.ui.model.application.ui.menu.MHandledMenuItem;
......
45 46

  
46 47
	}
47 48

  
49
    @Override
50
    @CanExecute
51
    public boolean canExecute(
52
            @Named(IServiceConstants.ACTIVE_PART)MPart activePart,
53
            @Named(IServiceConstants.ACTIVE_SELECTION)IStructuredSelection selection,
54
            MHandledMenuItem menuItem){
55

  
56
        editor = (TaxonNameEditorE4) activePart.getObject();
57

  
58
        boolean canExecute = false;
59
        Object selectedElement = selection.getFirstElement();
60
        canExecute = editor.checkForEmptyNames();
61
        menuItem.setVisible(canExecute);
62
        return canExecute;
63
    }
64

  
48 65
}

Also available in: Unified diff