Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Possible with commands?
Possible with commands? [message #480765] Tue, 18 August 2009 12:36 Go to next message
Christian is currently offline ChristianFriend
Messages: 72
Registered: July 2009
Hello Group,

with my basic knowledge of core commands api I recently stood before a
wall. Not knowing how to do this..

Folowing problem ..
I have in my Model an Object linking to several owners (User objects)

is it possible to create in a Popup menu (more precisely in a submenu in
a popupmenu)

one entry for each user of the file.

So I imagine a submenu called "Send message"
and in it one entry for each user named after the user i.e. user.getName();

Would that scenario be possible with commands and handlers (how?) or do
I have to use actions for this?

Re: Possible with commands? [message #480827 is a reply to message #480765] Tue, 18 August 2009 15:34 Go to previous message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

You would do something similar to the Window>Show View menu. Use a menuContribution to contribute a dynamic element, a subclass of org.eclipse.ui.actions.CompoundContributionItem. You can implement org.eclipse.ui.menus.IWorkbenchContribution if you need to get any services.

Your command to send mail would take an optional parameter, i.e. com.example.sendMail would have a parameter named A static menu contribution might look like:

<command id="send.paul" commandId="com.example.sendMail"
label="Send: Paul">
<parameter name="" value=""/>

When asked for the contribution items, you would be generating CommandContributionItems from an CommandContributionItemParameter similar to org.eclipse.ui.internal.ShowViewMenu.getItem(String)


Previous Topic:Opening drop down menu from cheat sheet
Next Topic:Preventing ErrorEditorInput from Showing
Goto Forum:

Current Time: Mon May 21 17:09:07 GMT 2018

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

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

Back to the top