Revision 09831abe
Added by Patrick Plitzner almost 6 years ago
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/e4/handler/CreateDescriptionElementHandlerE4.java | ||
---|---|---|
79 | 79 |
} |
80 | 80 |
|
81 | 81 |
@CanExecute |
82 |
public boolean canExecute(@Optional @Named(IServiceConstants.ACTIVE_SELECTION) IStructuredSelection selection,
|
|
83 |
MHandledMenuItem menuItem){
|
|
82 |
public boolean canExecute(MHandledMenuItem menuItem,
|
|
83 |
@Named(IServiceConstants.ACTIVE_SELECTION)IStructuredSelection selection){
|
|
84 | 84 |
boolean canExecute = false; |
85 |
canExecute = selection!=null |
|
86 |
&& selection.size()==1; |
|
85 |
canExecute = selection.size()==1 |
|
86 |
&& |
|
87 |
(selection.getFirstElement() instanceof DescriptionBase |
|
88 |
|| selection.getFirstElement() instanceof DescriptionElementBase |
|
89 |
|| selection.getFirstElement() instanceof FeatureNodeContainer); |
|
87 | 90 |
menuItem.setVisible(canExecute); |
88 | 91 |
return canExecute; |
92 |
|
|
89 | 93 |
} |
90 | 94 |
|
91 | 95 |
/** |
Also available in: Unified diff
ref #7010 Adapt uses view handlers for multiple selection