Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 249445

Summary: [Contributions] Commands with checkEnabled=true strange behavior
Product: [Eclipse Project] Platform Reporter: Damien <damlobster>
Component: UIAssignee: Prakash Rangaraj <prakash>
Status: VERIFIED DUPLICATE QA Contact:
Severity: normal    
Priority: P3 CC: pwebster
Version: 3.4.1   
Target Milestone: 3.5 M4   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Test plugin none

Description Damien CLA 2008-10-02 04:41:21 EDT
Created attachment 114075 [details]
Test plugin

-Version: 3.4.1,  Build id: M20080911-1700
-java version "1.6.0_05"

Here is my conf :
- 1 command (extension of org.eclipse.ui.commands) with only its id and name defined
- 1 handler pointing to this commandId and to a custom implementation with an <activeWhen> definition.
- 1 popup definition (for a context menu) featuring the command, with "checkEnabled=true" attribute set.

When I launch my app and then right click on the view to open my popup menu, the command is visible as expected only the first time, every subsequents right clicks have no effect and don't show the command. 

Steps to reproduce:
- Launch the sample plugin attached.
- Right click in the view "View": the command is visible - OK
- Right click a second time: the command is not visible - KO

if "menuMgr.setRemoveAllWhenShown(true)" is added when regitering the popup menu, then the command is showed as expected.
Comment 1 Damien CLA 2008-10-02 16:29:54 EDT
The same test plugin launched under OSX behave differently when the call to menuMgr.setRemoveAllWhenShow(true) is present.

- 1st right click: OK
- 2d right click: the command is showed for a very small time and then only the popup menu shell's keep displayed, without the command.
- 3d, ... same as 2d

-Version: 3.4.1,  Build id: M20080911-1700
-java "1.5.0" (apple)
Comment 2 Prakash Rangaraj CLA 2008-11-12 03:25:14 EST
I didn't have access to Mac, so couldn't comment on the behaviour in that platform.

The fix for Bug# 249442 fixes this as well. Patch is available in that bug
Comment 3 Paul Webster CLA 2008-11-25 11:57:01 EST
(In reply to comment #2)
> I didn't have access to Mac, so couldn't comment on the behaviour in that
> platform.
>

Can we see the problem on windows without the patch?  If so, we can mark this as a dup of bug 249442

PW
Comment 4 Prakash Rangaraj CLA 2008-11-27 01:43:14 EST
(In reply to comment #3)

> Can we see the problem on windows without the patch?  If so, we can mark this
> as a dup of bug 249442
> 
> PW

    Yes, without the patch, the problem is there as described in the bug. If we apply the patch, the menu is shown properly.

    
    Should we check in Mac before we close this as duplicate?
Comment 5 Paul Webster CLA 2008-12-04 11:31:37 EST

*** This bug has been marked as a duplicate of bug 249442 ***
Comment 6 Prakash Rangaraj CLA 2008-12-11 08:20:36 EST
Verified in I20081208-1800