Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » Context menu and multiple selection(I cannot find a way to define a context menu item visible when the user selects more than one object)
Context menu and multiple selection [message #1651838] Thu, 05 March 2015 14:44 Go to next message
Francois Cabrol is currently offline Francois CabrolFriend
Messages: 32
Registered: January 2015
Member
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 14:48]

Report message to a moderator

Re: Context menu and multiple selection [message #1651971 is a reply to message #1651838] Thu, 05 March 2015 16:24 Go to previous messageGo to next message
Esteban Dugueperoux is currently offline Esteban DugueperouxFriend
Messages: 472
Registered: July 2009
Senior Member
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
icon12.gif  Re: Context menu and multiple selection [message #1698853 is a reply to message #1651971] Thu, 18 June 2015 12:19 Go to previous message
diogo vicente is currently offline diogo vicenteFriend
Messages: 2
Registered: March 2014
Junior Member
Hi Esteban/Francois,

was this raised as an improvements in bugzilla?

I would like to track it to see when I can benefit from it,


thanks a lot, Diogo
Previous Topic:Copy&Paste for a tree item
Next Topic:java.lang.IllegalStateException: Cannot modify resource set without a write transaction
Goto Forum:
  


Current Time: Wed Jan 27 11:49:42 GMT 2021

Powered by FUDForum. Page generated in 0.01564 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top