Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » Commands and Context Menus
Commands and Context Menus [message #335327] Wed, 01 April 2009 11:59 Go to next message
Eclipse UserFriend
I am using the eclipse commands and menus to generate a context menu.
This works fine.

The context menu is dynamic, so I have implemented the appropriate classes
derived from AbstractHandler, this is also fine.

The problem is that based on the user right click selection I want to
remove items from the context menu. Not disable, but completely remove.

The command expressions do not seem to be sufficient, since I can only use
a selection event variable. I am using a generic object as the selection,
and I need to examine a member variable to check if the context item
should be displayed. No way to do this with expressions that I have found.

So, is there any way from the updateElement() method in AbstractHandler to
really remove a context menu item?
Re: Commands and Context Menus [message #335333 is a reply to message #335327] Wed, 01 April 2009 14:58 Go to previous message
Eclipse UserFriend
You would use a visibleWhen on your selection, and then a property
tester to test a specific member variable of your selection object. See
org.eclipse.core.expressions.propertyTesters.

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:global action (registration) listener
Next Topic:Enable Disable a version of plugin progamatically
Goto Forum:
  


Current Time: Sat Apr 26 23:56:23 EDT 2025

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

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

Back to the top