Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » commands contribution ...
commands contribution ... [message #332299] Fri, 17 October 2008 14:30 Go to next message
Carmelo  is currently offline Carmelo Friend
Messages: 224
Registered: July 2009
Senior Member
Hi all,
I have a question on commands added to a menu via CompoundContributionItem

I do use this way to display each time a different list of command/action
depending on some status of my plugin to a view context menu.

The question is:

protected IContributionItem[] getContributionItems()

let me return a list of CommandContributionItem

for (int i = 0; i < size; i++)
{
listCommands[i] = new
CommandContributionItem(PlatformUI.getWorkbench().getActiveW orkbenchWindow(),
scriptsName[i], "my.project.myCommand",
Collections.emptyMap(), null, null, null, scriptsName [i] , null,
null, SWT.NONE);
}

I guess there is a way to pass parameter to this command that can be used
later by the handler ... but how to do this?
this could be probably the map ... but how to use it? trying to put some
value to the hash map gives an error during the creation command.

I'm using eclise 3.3.2 (I have seen that in 3.4 things are lil different)

Thanks
Kar
Re: commands contribution ... [message #332311 is a reply to message #332299] Fri, 17 October 2008 18:25 Go to previous message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

If you want to pass a parameter in the map it needs to be in the command
definition as well (the commandParameter element).

PW

--
Paul Webster
http://wiki.eclipse.org/Platform_Command_Framework
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Menu_Contributions
http://wiki.eclipse.org/Menus_Extension_Mapping
http://help.eclipse.org/ganymede/index.jsp?topic=/org.eclips e.platform.doc.isv/guide/workbench.htm


Previous Topic:Building Eclipse 3.4.1 From Source Fails
Next Topic:Can a builder relate to another builder?
Goto Forum:
  


Current Time: Thu Apr 25 11:48:27 GMT 2024

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

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

Back to the top