Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Dynamic context menu construction
Dynamic context menu construction [message #201588] Wed, 25 February 2004 16:35 Go to next message
Mitch Christensen is currently offline Mitch ChristensenFriend
Messages: 39
Registered: July 2009
Member
I am using objectState to enable/disable items in a context menu. I
notice that testAttribute() only gets called when an item is selected. As
such, if you select an item, and execute an action from the context menu,
then re-display the context menu without re-selecting the (already
selected) item, testAttribute() does not get called, and the context menu
is not updated.

For example, select an item in a tree view and display the context menu.
The 'Generate XML' action is enabled as the result of testAttribute()
finding no XML file on disk for this item. Activate this action, which
generates an XML file on disk for this item. Redisplay the context menu
and 'Generate XML' is still enabled, even though an XML file currently
exists on disk. If you then 'click' (i.e. re-select) the currently
selected item and then display the context meny, 'Generate XML' is now
disabled.

I suppose that I could have the 'Generate XML' action programmatically
re-select the current item to force an update of the context menu, but
this seems klugy. Is the a more formal approach to updating the context
menu of an item without re-selecting the item?

-Mitch
Re: Dynamic context menu construction [message #201841 is a reply to message #201588] Wed, 25 February 2004 21:06 Go to previous message
Eclipse UserFriend
Originally posted by: douglas.pollock.magma.ca

Mitch Christensen wrote:
> I am using objectState to enable/disable items in a context menu. I
> notice that testAttribute() only gets called when an item is selected. As
> such, if you select an item, and execute an action from the context menu,
> then re-display the context menu without re-selecting the (already
> selected) item, testAttribute() does not get called, and the context menu
> is not updated.

This sounds like a bug to me. Could you file one against Platform UI? You
could even assign it to me directly.



Thanks,
Doug.
Previous Topic:Java debugger does not work with Eclipse 2.1.2
Next Topic:Code collapse & Code regions?
Goto Forum:
  


Current Time: Wed Apr 24 23:19:49 GMT 2024

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

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

Back to the top