Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » Can I register my context menu with a ViewPart??
Can I register my context menu with a ViewPart?? [message #158911] Wed, 19 November 2003 09:58
Eclipse UserFriend
Originally posted by: lilithal-jadiri.freenet.de

Hello,
all the examples that I've seen so far deal with registering a context
menu for a viewer instance. What I have is simply a concrete class of
ViewPart where I draw widgets and no Viewer. So when I come to the part
where I have to create a context menu and register it:

Menu menu = menuMgr.createContextMenu(getViewer().getControl());
getViewer().getControl().setMenu(menu);
getSite().registerContextMenu(menuMgr, viewer);

can I replace it with the following since I don't have a Viewer:

Menu menu = menuMgr.createContextMenu(getViewSite().getShell());
getViewSite().getShell().setMenu(menu);

And as far as registering it is concerned, the second parameter is
ISelectionProvider which a Viewer is normally. Should I then implement
ISelectionProvider interface and explicitly implement its interface??
would then the registering part have to look like this??
getSite().registerContextMenu(menuMgr, this );

I would appreciate any help or example.

thanks,
Lilith
Previous Topic:PropertySheetPage in popup dialog
Next Topic:Looking for info
Goto Forum:
  


Current Time: Sat Jun 07 20:09:02 EDT 2025

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

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

Back to the top