Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Context Menu Toggle Command
Context Menu Toggle Command [message #334528] Mon, 16 February 2009 09:58 Go to next message
Damian Philipp is currently offline Damian PhilippFriend
Messages: 30
Registered: July 2009
Member
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 15:07 Go to previous message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

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 23 14:45:25 GMT 2024

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

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

Back to the top