| Context menu and multiple selection [message #1651838] | 
Thu, 05 March 2015 09:44   | 
 
Eclipse User  | 
 | 
 | 
   | 
 
  Hi, 
 
  For different purposes (comparison between two objects, synoptic view display, ...), I would like to define context menu items activable when several entries of a Tree representation are selected. 
 
  I noticed that the signatures of IExternalJavaAction.canExecute() and .execute() seem compatible with multiple selection: the argument is a Collection<? extends EObject> selections. But when I create an External Java action either under a Popup Menu or under an Operation (itself contained in a Popup Menu), I never can see the popup menu if I select more than one tree item (even with an empty precondition). Is there any way to enable such multi-object Java actions ? 
 
  Thanks in advance, 
 
           François 
[Updated on: Thu, 05 March 2015 09:48] by Moderator  
 |  
 |  
  | 
| Re: Context menu and multiple selection [message #1651971 is a reply to message #1651838] | 
Thu, 05 March 2015 11:24    | 
 
Eclipse User  | 
 | 
 | 
   | 
 
Hi Francois, 
 
Indeed for tree representation, PopupMenu and OperationAction works only  
with a single selected tree item. You can raise a bugzilla for a  
enhancement. If you want to provide a change-set :) see in  
org.eclipse.sirius.tree.ui.tools.internal.editor.DTreeMenuListener.addTreeItemMenus()  
where we check if the selection is not multiple. 
 
Best Regards. 
 
Le 05/03/2015 15:44, Francois Cabrol a écrit : 
>   Hi, 
> 
>   For different purposes (comparison between two objects, synoptic view 
> display, ...), I would like to define context menu items activable when 
> several entries of a Tree representation are selected. 
> 
>   I noticed that the signatures of IExternalJavaAction.canExecute() and 
> .execute() seem compatible with multiple selection: the argument is a 
> Collection<? extends EObject> selections. But when I create an External 
> Java action either under a Popup Menu or under an Operation (itself 
> contained in a Popup Menu), I never can see the popup menu if I select 
> more than one tree item (even with an empty precondition). Is there any 
> way to enable such multi-object Java actions ? 
> 
>   Thanks in advance, 
> 
>            François 
 
 
 
--  
Esteban Dugueperoux - Obeo 
 
Need professional services for Sirius? 
http://www.obeodesigner.com/sirius
 |  
 |  
  | 
 | 
Powered by 
FUDForum. Page generated in 0.25659 seconds