Dynamic context menu construction [message #201588] |
Wed, 25 February 2004 16:35 |
Mitch Christensen 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 |
Eclipse User |
|
|
|
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.
|
|
|
Powered by
FUDForum. Page generated in 0.02839 seconds