How to get rid of "Run as...,Debug As" in my context menu [message #330527] |
Thu, 31 July 2008 13:50  |
Eclipse User |
|
|
|
Originally posted by: rudolf.hornig.omnest.com
We have a graphical editor where we registered a context menu. When we open the
context menu on we have several unwanted menu items like Run as...,Debug As...,
Team etc. How can we get rid of them? We would like to keep the
context menu registered.
It seems that org.eclipse.debug.ui registers these contributions to
"java.lang.Object" is there a way to neutralize that?
Thanks, Rudolf
|
|
|
|
Re: How to get rid of "Run as...,Debug As" in my context menu [message #330534 is a reply to message #330533] |
Thu, 31 July 2008 15:36   |
Eclipse User |
|
|
|
Originally posted by: rudolf.hornig.omnest.com
Thanks for the pointers, I have checked them. We want to get rid of these
menus ONLY in our editor window (just not to pollute the context menu),
but still want to register the menu, so some of OUR own other plugins
could be able to contribute to it.
Is there a way to register a menu privately for example?
i.e. contributions going to "org.eclipse.ui.popup.any" would not be added
to this menu, only those that specify the menu/part id explicitly...
Thanks
> Hornig Rudolf wrote:
>> We have a graphical editor where we registered a context menu. When we
>> open the context menu on we have several unwanted menu items like Run
>> as...,Debug As...,
>> Team etc. How can we get rid of them? We would like to keep the
>> context menu registered.
>>
>> It seems that org.eclipse.debug.ui registers these contributions to
>> "java.lang.Object" is there a way to neutralize that?
>
> In a product/RCP, you can use product transforms to remove the unwanted
> XML http://wiki.eclipse.org/Product_Customization .
>
> The other option is to use org.eclipse.ui.activities. You can bind an
> activity to the contributions you don't want, and have the activity
> default be false (although that will remove them from all context
> menus).
>
> PW
|
|
|
|
Re: How to get rid of "Run as...,Debug As" in my context menu [message #330706 is a reply to message #330536] |
Mon, 11 August 2008 09:41   |
Eclipse User |
|
|
|
Originally posted by: rudolf.hornig.omnest.com
On Thu, 31 Jul 2008 12:33:14 -0400, Paul Webster wrote:
> Hornig Rudolf wrote:
>> Thanks for the pointers, I have checked them. We want to get rid of
>> these menus ONLY in our editor window (just not to pollute the context
>> menu), but still want to register the menu, so some of OUR own other
>> plugins could be able to contribute to it.
>>
>> Is there a way to register a menu privately for example? i.e.
>> contributions going to "org.eclipse.ui.popup.any" would not be added to
>> this menu, only those that specify the menu/part id explicitly...
>
> There used to be ... in the old world, if you didn't add an "additions"
> group marker to your registered context menu there was no way of adding
> to it (except programmatically). But even that was "accept contribution
> v.s. no contributions"
>
> The new system doesn't even have that restriction, since it auto-creates
> an additions group if necessary.
>
> I can't think of a workaround. Do the menus still appear after the
> org.eclipse.ui.debug plugin has been activated? They usually only
> appear if some facet of the editor/selection is launchable.
It seems that the Debug As menu (and some other) are registered to show
if an Object is selected (ie. practically anything can be launchable)
I would expect to have some marker interface like ILaunchable/IDebuggable
and these menus should be visible only if an object is selected and Adopts
/ Implements these marker interfaces. But unfortunately it is not
implemented this way...
>
> Perhaps we need an enhancement request to allow a context menu to
> "opt-out" of popup:org.eclipse.ui.popup.any
Would love to see this enhancement to...
Thanks, Rudolf
|
|
|
Re: How to get rid of "Run as...,Debug As" in my context menu [message #330768 is a reply to message #330527] |
Tue, 12 August 2008 17:37   |
Eclipse User |
|
|
|
Originally posted by: felix.mayer.erdas.com
Did you try to override method
org.eclipse.jface.action.ContributionManager.allowItem(ICont ributionItem)?
"Hornig Rudolf" <rudolf.hornig@omnest.com> wrote in message
news:g6sfve$c2m$1@build.eclipse.org...
> We have a graphical editor where we registered a context menu. When we
> open the
> context menu on we have several unwanted menu items like Run as...,Debug
> As...,
> Team etc. How can we get rid of them? We would like to keep the
> context menu registered.
>
> It seems that org.eclipse.debug.ui registers these contributions to
> "java.lang.Object" is there a way to neutralize that?
>
> Thanks, Rudolf
|
|
|
|
Re: How to get rid of "Run as...,Debug As" in my context menu [message #331569 is a reply to message #330849] |
Thu, 11 September 2008 19:11  |
Eclipse User |
|
|
|
Originally posted by: ralffrotscher.web.de
I override the addListener-method in the ContextMenuProvider in the following way:
public void addMenuListener(IMenuListener listener) {
if (listener instanceof PopupMenuExtender) {
return;
}
super.addMenuListener(listener);
}
The PopupMenuExtender would add these contributions to the context menu. It would be better to avoid this by deactivating the PopupMenuExtender but for the moment the solution above works.
Ralf
|
|
|
Powered by
FUDForum. Page generated in 0.03132 seconds