Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » removing "Run As", "Debug As" ... popup menu items
removing "Run As", "Debug As" ... popup menu items [message #405688] Sat, 02 December 2006 18:06 Go to next message
John Yotka is currently offline John YotkaFriend
Messages: 144
Registered: July 2009
Senior Member
How can I remove the "Run As", "Debug As", "Team", "Compare With" and
"Replace With" popup menu items from my editor. These are the items
that are added by the addEditorActions(mgr) call in menuAboutToShow
(PopupMenuExtender).
Re: removing "Run As", "Debug As" ... popup menu items [message #405692 is a reply to message #405688] Sun, 03 December 2006 12:17 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33137
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------050307040001060805010201
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

John,

This registration with the site in the generated editor introduces those
menu items:

protected void createContextMenuFor(StructuredViewer viewer)
{
MenuManager contextMenu = new MenuManager("#PopUp");
contextMenu.add(new Separator("additions"));
contextMenu.setRemoveAllWhenShown(true);
contextMenu.addMenuListener(this);
Menu menu= contextMenu.createContextMenu(viewer.getControl());
viewer.getControl().setMenu(menu);
* getSite().registerContextMenu(contextMenu, viewer);*


John Yotka wrote:
> How can I remove the "Run As", "Debug As", "Team", "Compare With" and
> "Replace With" popup menu items from my editor. These are the items
> that are added by the addEditorActions(mgr) call in menuAboutToShow
> (PopupMenuExtender).


--------------050307040001060805010201
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
John,<br>
<br>
This registration with the site in the generated editor introduces
those menu items:<br>
<blockquote><small>&nbsp; protected void
createContextMenuFor(StructuredViewer viewer)</small><br>
<small>&nbsp; {</small><br>
<small>&nbsp;&nbsp;&nbsp; MenuManager contextMenu = new MenuManager("#PopUp");</small><br>
<small>&nbsp;&nbsp;&nbsp; contextMenu.add(new Separator("additions"));</small><br>
<small>&nbsp;&nbsp;&nbsp; contextMenu.setRemoveAllWhenShown(true);</small><br>
<small>&nbsp;&nbsp;&nbsp; contextMenu.addMenuListener(this);</small><br>
<small>&nbsp;&nbsp;&nbsp; Menu menu=
contextMenu.createContextMenu(viewer.getControl());</small> <br>
<small>&nbsp;&nbsp;&nbsp; viewer.getControl().setMenu(menu);</small><br>
<small>&nbsp;<b>&nbsp;&nbsp; getSite().registerContextMenu(contextMenu, viewer);</b></small><br>
</blockquote>
<br>
John Yotka wrote:
<blockquote cite="mideksf6r$3tq$1@utils.eclipse.org" type="cite">How
can I remove the "Run As", "Debug As", "Team", "Compare With" and
"Replace With" popup menu items from my editor.&nbsp; These are the items
that are added by the addEditorActions(mgr) call in menuAboutToShow
(PopupMenuExtender).
<br>
</blockquote>
<br>
</body>
</html>

--------------050307040001060805010201--


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: removing "Run As", "Debug As" ... popup menu items [message #1859012 is a reply to message #405692] Sat, 06 May 2023 02:49 Go to previous message
motein Xor is currently offline motein XorFriend
Messages: 3
Registered: August 2020
Junior Member
It looks like no one has solved this problem. Now I can give the standard answer.
Just add the code below into your editor.
	@Override
	protected boolean isEditorInputIncludedInContextMenu() {
		return false;
	}
Previous Topic:[CDO] Building with Tycho
Next Topic:Unable to dynamically call an EOperation of a generated type
Goto Forum:
  


Current Time: Sat Apr 20 03:19:52 GMT 2024

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

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

Back to the top