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

Bug 272448

Summary: [Contributions] popup menu item is missing in rcp application
Product: [Eclipse Project] Platform Reporter: Enrico <enrico.hopf>
Component: UIAssignee: Platform UI Triaged <platform-ui-triaged>
Status: RESOLVED DUPLICATE QA Contact: Paul Webster <pwebster>
Severity: major    
Priority: P3 CC: prakash, remy.suen
Version: 3.4.1   
Target Milestone: ---   
Hardware: PC   
OS: Linux-GTK   
Whiteboard:
Attachments:
Description Flags
extract from plugin.xml
none
tar file with 2 eclipse projects to simulate this bug none

Description Enrico CLA 2009-04-16 03:47:52 EDT
Created attachment 132033 [details]
extract from plugin.xml

when defining a popup menu item using a menuContribution in the plugin.xml of an eclipse rcp plugin, the menu item is not shown anymore in the popup menu when you select the menu item and open the popup menu a second time

the visibility of the menu item is restricted with the following:
<visibleWhen>
  <with variable="selection">
      <count
            value="1">
      </count>
      <iterate>
         <instanceof
               value="com.elaxy.mom.services.contribution.IOrderContributor">
           </instanceof>
        </iterate>
  </with>
</visibleWhen>

the menu item is shown always when omitting 

<count value="1"></count>

under windows the menu item is always shown
Comment 1 Prakash Rangaraj CLA 2009-04-16 05:04:24 EDT
Can you attach the sample RCP app itself? I can't reproduce this with my app.
Comment 2 Paul Webster CLA 2009-04-16 05:45:20 EDT
Also, did you set your viewer as your site selection provider?

i.e. getSite().setSelectionProvider(viewer);

PW
Comment 3 Enrico CLA 2009-04-16 06:41:45 EDT
hi,

i'll try to create an example rcp application with the same behavior

and yes, we set our viewer as selection provider:

  @Override
  public void createPartControl(Composite parent)
  {
    super.createPartControl(parent);
    
    this.createActions();
    this.initToolBars();
    this.createContextMenu();
    this.getSite().setSelectionProvider(getTableViewer());
Comment 4 Enrico CLA 2009-04-17 02:22:43 EDT
Created attachment 132178 [details]
tar file with 2 eclipse projects to simulate this bug

i created 2 eclipse projects to simulate this bug
Comment 5 Enrico CLA 2009-04-17 02:46:11 EDT
The popup menu of the main view of the attached sample rcp program contains 2 entries: [Action 1] and [View1 Command]. Executing the [View1 Command] opens a new view. If you open the popup menu again the entry [View1 Command] is not available any more.
Comment 6 Prakash Rangaraj CLA 2009-04-17 04:34:11 EDT
(In reply to comment #4)
> Created an attachment (id=132178) [details]
> tar file with 2 eclipse projects to simulate this bug
> 
> i created 2 eclipse projects to simulate this bug
> 

Sorry, I tried both on 3.4.2 and 3.5 but I still can't reproduce this thing. I could see the 'View 1 command' in both the views. Is there any specific steps to reproduce? Or is it Linux specific bug?
Comment 7 Enrico CLA 2009-04-17 05:47:53 EDT
this is a linux specific bug
Comment 8 Remy Suen CLA 2009-04-17 09:32:41 EDT
What 3.5 build are you testing on, by the way? This sounds suspiciously like bug 257188.
Comment 9 Enrico CLA 2009-04-17 09:39:29 EDT
we are using eclipse 3.4.1 and i also tested eclipse 3.4.2
with both version i don't have any problem to reproduce this bug on linux
Comment 10 Remy Suen CLA 2009-04-17 09:43:44 EDT
Whoops, sorry, I now realize that Prakash was the one that was testing on a 3.5 build and not you, Enrico.
Comment 11 Enrico CLA 2009-04-17 09:59:16 EDT
hi remy,

it really sounds like bug 257188, so i just tried eclipse 3.5 m6 and it works, the popup menu item is always shown
Comment 12 Paul Webster CLA 2009-05-20 15:27:35 EDT

*** This bug has been marked as a duplicate of bug 257188 ***