Revision 7a8de069
Added by Patrick Plitzner over 6 years ago
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; |
|
6 | 3 |
import org.eclipse.e4.core.di.annotations.Execute; |
7 | 4 |
import org.eclipse.e4.ui.model.application.ui.basic.MPart; |
8 |
import org.eclipse.e4.ui.model.application.ui.menu.MHandledMenuItem; |
|
9 |
import org.eclipse.e4.ui.services.IServiceConstants; |
|
10 | 5 |
import org.eclipse.e4.ui.workbench.modeling.EPartService; |
11 | 6 |
import org.eclipse.e4.ui.workbench.modeling.EPartService.PartState; |
12 | 7 |
|
... | ... | |
18 | 13 |
part = partService.showPart(part, PartState.ACTIVATE); |
19 | 14 |
} |
20 | 15 |
|
21 |
@CanExecute |
|
22 |
public boolean canExecute(@Named(IServiceConstants.ACTIVE_PART)MPart activePart, |
|
23 |
MPart thisPart, MHandledMenuItem menuItem){ |
|
24 |
boolean canExecute = false; |
|
25 |
canExecute = activePart.getObject() != thisPart.getObject(); |
|
26 |
menuItem.setVisible(canExecute); |
|
27 |
return canExecute; |
|
28 |
} |
|
29 |
|
|
30 | 16 |
} |
Also available in: Unified diff
ref #6909 Enable "Open in referencing objects view"