Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse 4 » Unable to display context (popup) menu for TreeViewer
Unable to display context (popup) menu for TreeViewer [message #1057821] Thu, 09 May 2013 04:33 Go to next message
S Ron is currently offline S RonFriend
Messages: 2
Registered: May 2013
Junior Member
I am new to Eclipse 4, so need help here.

1) I created a Popup Menu under a Part using ApplicationModel.

2) I have created a TreeViewer in this part. The TreeViewer contents are displaying fine.

3) Registered Popupmenu with MenuService instance using

menuService.registerContextMenu(myTreeViewer,Id);

Id here is the id of pop menu from application model.

4) I now run the application but cannot see the popup menu coming up on right click.

Am I missing something ? I did use Alt-Shift-F9 to confirm that popup menu is part of application model.

Re: Unable to display context (popup) menu for TreeViewer [message #1057877 is a reply to message #1057821] Thu, 09 May 2013 13:54 Go to previous messageGo to next message
Andrzej Szczepanski is currently offline Andrzej SzczepanskiFriend
Messages: 16
Registered: May 2013
Junior Member
S Ron wrote on Thu, 09 May 2013 06:33

menuService.registerContextMenu(myTreeViewer,Id);


Try this instead:
menuService.registerContextMenu(myTreeViewer.getControl(),Id);
Re: Unable to display context (popup) menu for TreeViewer [message #1057949 is a reply to message #1057877] Fri, 10 May 2013 02:46 Go to previous message
S Ron is currently offline S RonFriend
Messages: 2
Registered: May 2013
Junior Member
Thank you, that worked I had to add getControl().
Previous Topic:Editor pane tab display policy
Next Topic:How can a member variable be initialized and updated with the @Preference annotation?
Goto Forum:
  


Current Time: Fri Apr 19 19:16:06 GMT 2024

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

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

Back to the top