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 Ron
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 Szczepanski
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 Ron
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: Sat Sep 20 16:18:24 GMT 2014

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

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