Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » Context Menu Toggle Command
Context Menu Toggle Command [message #334528] Mon, 16 February 2009 04:58 Go to next message
Eclipse UserFriend
Hello,

I'm trying to build a toggle-style context menu with the command
framework. While the command framework does offer a way to specifiy such
toggle commands, I can find no mentioning of how the toggle would be
represented in a context menu. Additionally, I can not see a way to
specify the actual toggle state depending on the context (I have to use
project natures) - only global ways to do this appear to be available. I
need to change this state when the user changes the current selection.

Can this be achieved using the command framework or do I have to revert
to popupActions or even use two separate commands for addition and
removal of my nature?

Regards
Damian Philipp
Re: Context Menu Toggle Command [message #334619 is a reply to message #334528] Fri, 20 February 2009 10:07 Go to previous message
Eclipse UserFriend
See some of the examples for toggle, checked, and radio commands in
http://wiki.eclipse.org/Menu_Contributions#Example_Matrix

You can update your menus checked state or label using
updateElement(UIElement element, Map parameters) from IElementUpdater in
your handler.

It doesn't support setting the state declaratively yet,
https://bugs.eclipse.org/bugs/show_bug.cgi?id=221980

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:Can't identify SWT/JFace Object in IDE
Next Topic:Updating a feature from a local update site with command line Update Manager (no internet connection
Goto Forum:
  


Current Time: Tue Apr 15 06:05:20 EDT 2025

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

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

Back to the top