Revision 309a818c
Added by Patrick Plitzner almost 6 years ago
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/key/polytomous/e4/handler/RemotingEditPolytomousKeyNodesHandlerE4.java | ||
---|---|---|
114 | 114 |
} |
115 | 115 |
|
116 | 116 |
@CanExecute |
117 |
public boolean canExecute(@Named(IServiceConstants.ACTIVE_SELECTION)Object selection,
|
|
117 |
public boolean canExecute(@Named(IServiceConstants.ACTIVE_SELECTION)IStructuredSelection selection,
|
|
118 | 118 |
MHandledMenuItem menuItem){ |
119 |
boolean canExecute = false; |
|
120 |
canExecute = ((IStructuredSelection)selection).getFirstElement() instanceof PolytomousKey; |
|
119 |
boolean canExecute = !selection.isEmpty(); |
|
120 |
Object[] array = selection.toArray(); |
|
121 |
for (Object object : array) { |
|
122 |
canExecute &= object instanceof PolytomousKey; |
|
123 |
} |
|
121 | 124 |
menuItem.setVisible(canExecute); |
122 | 125 |
return canExecute; |
123 | 126 |
} |
Also available in: Unified diff
ref #7010 Adapt poly key handlers for multiple selection