Project

General

Profile

Download (1.06 KB) Statistics
| Branch: | Tag: | Revision:
1

    
2
package eu.etaxonomy.taxeditor.navigation.navigator.e4.handler;
3

    
4
import javax.inject.Named;
5

    
6
import org.eclipse.e4.core.di.annotations.CanExecute;
7
import org.eclipse.e4.core.di.annotations.Execute;
8
import org.eclipse.e4.ui.model.application.ui.menu.MHandledMenuItem;
9
import org.eclipse.e4.ui.services.IServiceConstants;
10
import org.eclipse.jface.viewers.TreeSelection;
11

    
12
import eu.etaxonomy.cdm.persistence.dto.TaxonNodeDto;
13

    
14
public class AggregateTaxonDescriptionsHandler {
15
	@Execute
16
	public void execute(@Named(IServiceConstants.ACTIVE_SELECTION)TreeSelection selection) {
17
	    TaxonNodeDto node = (TaxonNodeDto) selection.getFirstElement();
18

    
19
	}
20

    
21
	@CanExecute
22
	public boolean canExecute(@Named(IServiceConstants.ACTIVE_SELECTION)Object selection,
23
	        MHandledMenuItem menuItem){
24
	    boolean canExecute = false;
25
//	    canExecute = selection instanceof TreeSelection
26
//	            && ((TreeSelection) selection).size()==1
27
//	            && ((TreeSelection) selection).getFirstElement() instanceof TaxonNodeDto;
28
	    menuItem.setVisible(canExecute);
29
	    return canExecute;
30
	}
31

    
32
}
(1-1/15)