Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » How to add menu item to figure's context menu?
How to add menu item to figure's context menu? [message #197521] Tue, 04 October 2005 08:42 Go to next message
hanys is currently offline hanysFriend
Messages: 188
Registered: July 2009
Senior Member
Hi all,

I have a problem that I want to add menu item to editpart's figure context
menu.
At that menu I want to put action which opens dialog which will work with
model data of that figure.

Thanks,
John Cage
Re: How to add menu item to figure's context menu? [message #197529 is a reply to message #197521] Tue, 04 October 2005 10:01 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: wjancz.\/\/asko.pl(change \/\/ with w)

> Hi all,
>
> I have a problem that I want to add menu item to editpart's figure context
> menu.
> At that menu I want to put action which opens dialog which will work with
> model data of that figure.
>
> Thanks,
> John Cage


At your editors part class You override configureGraphicalViewer() method
where you are setting a context menu provider.
Your context menu provider class which sholud extend ContextMenuProvider
class should override buildContextMenu() method where you build a context
menu. There you have a manager to which one You can add any action which
extends org.eclipse.jface.action.Action class.

Tell me if it was helpfull for You :) ?

...::WojT::..
Re: How to add menu item to figure's context menu? [message #197610 is a reply to message #197529] Tue, 04 October 2005 13:04 Go to previous messageGo to next message
hanys is currently offline hanysFriend
Messages: 188
Registered: July 2009
Senior Member
Yes it helps me :)

Thanks,
John Cage
Re: How to add menu item to figure's context menu? [message #198261 is a reply to message #197610] Sun, 09 October 2005 09:18 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: alextret.yahoo.com

I was quite successful in adding items to context menus with minimal
programming, by tweaking plugin.xml (added objectContribution to
org.eclipse.ui.popupMenus extension point).

However, how do I get rid of unwanted and irrelevant menu items supplied by
the platform by default (in my case, it is "Run As", "Debug As", "Compare
With" and "Replace With")?

I should note that some of the menu items supplied by the platform, in my
case, are quite relevant and work just fine (specifically, Undo, Redo and
Delete).

"John Cage" <ahanys@seznam.cz> wrote in message
news:dhu527$dsr$1@news.eclipse.org...
> Yes it helps me :)
>
> Thanks,
> John Cage
>
Re: How to add menu item to figure's context menu? [message #198275 is a reply to message #198261] Sun, 09 October 2005 19:47 Go to previous message
Eclipse UserFriend
Originally posted by: none.unknown.com

I don't think there's a way. Inquire on the platform newsgroup.

"Alexei Tretiakov" <alextret@yahoo.com> wrote in message
news:diam99$i0h$1@news.eclipse.org...
> I was quite successful in adding items to context menus with minimal
> programming, by tweaking plugin.xml (added objectContribution to
> org.eclipse.ui.popupMenus extension point).
>
> However, how do I get rid of unwanted and irrelevant menu items supplied
by
> the platform by default (in my case, it is "Run As", "Debug As", "Compare
> With" and "Replace With")?
>
> I should note that some of the menu items supplied by the platform, in my
> case, are quite relevant and work just fine (specifically, Undo, Redo and
> Delete).
>
> "John Cage" <ahanys@seznam.cz> wrote in message
> news:dhu527$dsr$1@news.eclipse.org...
> > Yes it helps me :)
> >
> > Thanks,
> > John Cage
> >
>
>
Previous Topic:Still struggling with coordinates
Next Topic:Draw2D connections problem
Goto Forum:
  


Current Time: Thu Apr 25 10:54:15 GMT 2024

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

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

Back to the top