Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse 4 » How to dynamically fill a parameter to a popup menu
How to dynamically fill a parameter to a popup menu [message #1384645] Thu, 29 May 2014 21:56 Go to next message
osfreeman zhang is currently offline osfreeman zhangFriend
Messages: 13
Registered: May 2014
Junior Member


Hi dears:
I am writing an e4 application on rap. I made a popup menu on a tree by Emenuservice. the menu could be displayed when I right click the mouse on the tree control. but I do not know how to fill the command parameter with the selected tree item. I know it should use the command parameter and @named injection. but I do not the detail how to make it. Will some one help me or give me a detail hint?
Re: How to dynamically fill a parameter to a popup menu [message #1384771 is a reply to message #1384645] Sat, 31 May 2014 20:37 Go to previous messageGo to next message
osfreeman zhang is currently offline osfreeman zhangFriend
Messages: 13
Registered: May 2014
Junior Member
nobody knows about it?
Re: How to dynamically fill a parameter to a popup menu [message #1384814 is a reply to message #1384645] Mon, 02 June 2014 09:49 Go to previous message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 5720
Registered: July 2009
Senior Member
You should simply publish the selected item in the IEclipseContext of
the part and/or publish it generally using the ESelectionService which
allows you to access it in your handler.

e.g. if you used ESelectionService you will get it using:

@Execute
public void run(@Named(IServiceConstants.ACTIVE_SELECTION)
IStructuredSelection s)



Tom

On 29.05.14 23:56, osfreeman zhang wrote:
>
>
> Hi dears:
> I am writing an e4 application on rap. I made a popup menu on a tree by
> Emenuservice. the menu could be displayed when I right click the mouse
> on the tree control. but I do not know how to fill the command parameter
> with the selected tree item. I know it should use the command parameter
> and @named injection. but I do not the detail how to make it. Will some
> one help me or give me a detail hint?
Previous Topic:Garbage collection of views
Next Topic:how to share View in Multi Perspective
Goto Forum:
  


Current Time: Fri May 22 10:22:25 GMT 2015

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

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