1
|
package eu.etaxonomy.taxeditor.handler.defaultHandler;
|
2
|
|
3
|
import javax.inject.Named;
|
4
|
|
5
|
import org.eclipse.e4.core.di.annotations.CanExecute;
|
6
|
import org.eclipse.e4.core.di.annotations.Execute;
|
7
|
import org.eclipse.e4.ui.model.application.ui.basic.MPart;
|
8
|
import org.eclipse.e4.ui.services.IServiceConstants;
|
9
|
import org.eclipse.e4.ui.workbench.modeling.EPartService;
|
10
|
import org.eclipse.e4.ui.workbench.modeling.EPartService.PartState;
|
11
|
|
12
|
public class OpenReferencingObjectsViewHandler {
|
13
|
|
14
|
@Execute
|
15
|
public void execute(EPartService partService, @Named(IServiceConstants.ACTIVE_PART)MPart activePart) {
|
16
|
MPart part = partService.createPart("eu.etaxonomy.taxeditor.bulkeditor.referencingobjects.e4.ReferencingObjectsViewE4");
|
17
|
part = partService.showPart(part, PartState.ACTIVATE);
|
18
|
}
|
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
|
|
26
|
}
|