Project

General

Profile

« Previous | Next » 

Revision 33957b86

Added by Patrick Plitzner about 6 years ago

fix #7031 Disable "Open in..." for RefObjView when already in RefObjView

View differences:

eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/handler/defaultHandler/OpenReferencingObjectsViewHandler.java
1 1
package eu.etaxonomy.taxeditor.handler.defaultHandler;
2 2

  
3
import javax.inject.Named;
4

  
5
import org.eclipse.e4.core.di.annotations.CanExecute;
3 6
import org.eclipse.e4.core.di.annotations.Execute;
4 7
import org.eclipse.e4.ui.model.application.ui.basic.MPart;
8
import org.eclipse.e4.ui.services.IServiceConstants;
5 9
import org.eclipse.e4.ui.workbench.modeling.EPartService;
6 10
import org.eclipse.e4.ui.workbench.modeling.EPartService.PartState;
7 11

  
8 12
public class OpenReferencingObjectsViewHandler {
9 13

  
10 14
    @Execute
11
    public void execute(EPartService partService) {
15
    public void execute(EPartService partService, @Named(IServiceConstants.ACTIVE_PART)MPart activePart) {
12 16
        MPart part = partService.createPart("eu.etaxonomy.taxeditor.bulkeditor.referencingobjects.e4.ReferencingObjectsViewE4");
13 17
        part = partService.showPart(part, PartState.ACTIVATE);
14 18
    }
15 19

  
20
    @CanExecute
21
    public boolean canExecute(EPartService partService, @Named(IServiceConstants.ACTIVE_PART)MPart activePart) {
22
        MPart part = partService.findPart("eu.etaxonomy.taxeditor.bulkeditor.referencingobjects.e4.ReferencingObjectsViewE4");
23
        return !part.equals(activePart);
24
    }
25

  
16 26
}

Also available in: Unified diff