Project

General

Profile

« Previous | Next » 

Revision 125a3c1d

Added by Katja Luther almost 6 years ago

adapt Setsecundum handler and RefreshHandler to TaxonNodeDto

View differences:

eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/e4/handler/RefreshTreeHandlerE4.java
18 18
import org.eclipse.e4.ui.services.IServiceConstants;
19 19
import org.eclipse.jface.viewers.TreeSelection;
20 20

  
21
import eu.etaxonomy.cdm.model.taxon.ITaxonTreeNode;
21
import eu.etaxonomy.cdm.persistence.dto.TaxonNodeDto;
22 22
import eu.etaxonomy.taxeditor.navigation.navigator.e4.TaxonNavigatorE4;
23 23

  
24 24
/**
......
40 40
    @CanExecute
41 41
    private boolean canExecute(@Named(IServiceConstants.ACTIVE_SELECTION)TreeSelection selection, MHandledMenuItem menuItem){
42 42
        boolean canExecute = false;
43
        canExecute = selection.getFirstElement() instanceof ITaxonTreeNode;
43
        canExecute = selection.getFirstElement() instanceof TaxonNodeDto;
44 44
        menuItem.setVisible(canExecute);
45 45
        return canExecute;
46 46
    }
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/e4/handler/SetSecReferenceForSubtreeHandlerE4.java
25 25

  
26 26
import eu.etaxonomy.cdm.api.service.config.SecundumForSubtreeConfigurator;
27 27
import eu.etaxonomy.cdm.model.taxon.Classification;
28
import eu.etaxonomy.cdm.model.taxon.ITaxonTreeNode;
28
import eu.etaxonomy.cdm.persistence.dto.TaxonNodeDto;
29 29
import eu.etaxonomy.taxeditor.navigation.navigator.TaxonNavigatorLabels;
30 30
import eu.etaxonomy.taxeditor.navigation.navigator.operation.SetSecundumForSubtreeOperation;
31 31
import eu.etaxonomy.taxeditor.operation.e4.RemotingCdmHandlerE4;
......
39 39
 */
40 40
public class SetSecReferenceForSubtreeHandlerE4 extends RemotingCdmHandlerE4 {
41 41

  
42
    private ITaxonTreeNode taxonNode;
42
    private TaxonNodeDto taxonNode;
43 43
    private SecundumForSubtreeConfigurator configurator;
44 44

  
45 45
    public SetSecReferenceForSubtreeHandlerE4() {
......
63 63

  
64 64
        // check that selected object is a taxon node
65 65
        Object obj = selection.iterator().next();
66
        if(obj instanceof ITaxonTreeNode) {
67
            if (obj instanceof Classification){
68
                taxonNode = ((Classification)obj).getRootNode();
66
        if(obj instanceof TaxonNodeDto) {
67
            if(obj instanceof Classification){
68
                taxonNode = new TaxonNodeDto(((Classification)obj).getRootNode());
69 69
            }else{
70
                taxonNode = (ITaxonTreeNode)obj;
70
                taxonNode = (TaxonNodeDto)obj;
71 71
            }
72 72
        } else{
73 73
            return new Status(IStatus.ERROR,
......
90 90
    @CanExecute
91 91
    private boolean canExecute(@Named(IServiceConstants.ACTIVE_SELECTION)TreeSelection selection, MHandledMenuItem menuItem){
92 92
        boolean canExecute = false;
93
        canExecute = selection.getFirstElement() instanceof ITaxonTreeNode;
93
        canExecute = selection.getFirstElement() instanceof TaxonNodeDto;
94 94
        menuItem.setVisible(canExecute);
95 95
        return canExecute;
96 96
    }

Also available in: Unified diff