Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Plugin Development Environment (PDE) » plz delete
plz delete [message #1061771] Mon, 03 June 2013 21:14 Go to next message
Mike Johnson is currently offline Mike JohnsonFriend
Messages: 9
Registered: April 2013
Junior Member
plz delete

[Updated on: Tue, 04 June 2013 22:01]

Report message to a moderator

Re: Programmatically Modifying Context Menu [message #1061776 is a reply to message #1061771] Mon, 03 June 2013 22:00 Go to previous messageGo to next message
Mike Johnson is currently offline Mike JohnsonFriend
Messages: 9
Registered: April 2013
Junior Member
plz delete

[Updated on: Tue, 04 June 2013 22:00]

Report message to a moderator

Re: Programmatically Modifying Context Menu [message #1063176 is a reply to message #1061771] Wed, 12 June 2013 14:29 Go to previous message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

On 06/03/2013 05:14 PM, Mike Johnson wrote:
> Hi,
>
> I've created several context menu items/buttons from the Popup Menu PDE
> template so they're generated from plugin.xml and contain code in their
> respective classes. Though this works, I need to be able to modify the
> context menu from within code dynamically based on a highlighted selection.

You can try contributing different menu items based on the current
selection. This works with
org.eclipse.ui.menus/menuContributions/commands that include a
visibleWhen or with org.eclipse.ui.popupMenus/objectContributions.

Another option is to contribute a dynamic element through
org.eclipse.ui.menus, implement it subclassing CompoundContributionItem,
and then you can provide the specific items you want on every menu
aboutToShow.

PW



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


Previous Topic:Override default resouce rename refactor
Next Topic:No images after deploying plugins
Goto Forum:
  


Current Time: Fri Apr 26 09:28:17 GMT 2024

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

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

Back to the top