Skip to main content



      Home
Home » Newcomers » Newcomers » Programmatically create popup
Programmatically create popup [message #253838] Mon, 14 April 2008 07:25 Go to next message
Eclipse UserFriend
Originally posted by: andymorton.btinternet.com

Hi,

I have a popup menu via a plugin extension.
I want to do some processing and add items to this menu whenever the
plugin runs / activates.

Is this possible? I only want to have the top level menu in the
plugin.xml, just to be a container...

All ideas welcome!

Regards,
Andrew
Re: Programmatically create popup [message #253897 is a reply to message #253838] Mon, 14 April 2008 16:26 Go to previous message
Eclipse UserFriend
You'll need code along the lines of:

MenuManager menuMgr = new MenuManager("#PopupMenu");
....
menuMgr.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
viewer.getControl().setMenu(menu);
getSite().registerContextMenu(menuMgr, viewer);

That last line is important. Check out the comments on
registerContextMenu.

Also, read this:

http://www.eclipse.org/articles/article.php?file=Article-act ion-contribution/index.html

HTH,

Wayne

On Mon, 2008-04-14 at 11:25 +0000, Andrew Morton wrote:
> Hi,
>
> I have a popup menu via a plugin extension.
> I want to do some processing and add items to this menu whenever the
> plugin runs / activates.
>
> Is this possible? I only want to have the top level menu in the
> plugin.xml, just to be a container...
>
> All ideas welcome!
>
> Regards,
> Andrew
>
Previous Topic:How to verify that WebTools Platform is successfully installed?
Next Topic:show part of a bitmap
Goto Forum:
  


Current Time: Sat Jun 07 05:25:36 EDT 2025

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

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

Back to the top