Toggle breakpoint in ruler popup menu [message #1498286] |
Thu, 04 December 2014 09:54  |
|
Dear all,
The API documentation still shows how to register a "Toggle breakpoint" action "the old way" (with editorActions and popupMenus).
This used to be fine, but now with Eclipse 4 it causes many warnings, yet I have been unable to find how I am supposed to achieve the same effect with org.eclipse.ui.menus extension.
I have the following elements in my plugin.xml.
<extension point="org.eclipse.ui.handlers">
<handler
class="io.sarl.lang.ui.SARLExecutableExtensionFactory:org.eclipse.debug.ui.actions.RulerToggleBreakpointActionDelegate"
commandId="io.sarl.lang.SARL.breakpoint.ToggleBreakpointCommand">
<activeWhen>
<reference definitionId="io.sarl.lang.SARL.Editor.opened"/>
</activeWhen>
</handler>
</extension>
<extension point="org.eclipse.ui.commands">
<command
description="%action.label.0"
id="io.sarl.lang.SARL.breakpoint.ToggleBreakpointCommand"
name="%action.label.0"/>
</extension>
<extension point="org.eclipse.ui.menus">
<menuContribution locationURI="popup:io.sarl.lang.SARL.RulerContext?after=debug">
<command
commandId="io.sarl.lang.SARL.breakpoint.ToggleBreakpointCommand"
id="io.sarl.lang.SARL.rulerContextMenu.toggleBreakpointAction"/>
</menuContribution>
</extension>
The old version of my plugin.xml was:
<extension point="org.eclipse.ui.popupMenus">
<viewerContribution
targetID="io.sarl.lang.SARL.RulerContext"
id="io.sarl.lang.SARL.RulerPopupActions">
<action
label="%action.label.0"
class="io.sarl.lang.ui.SARLExecutableExtensionFactory:org.eclipse.debug.ui.actions.RulerToggleBreakpointActionDelegate"
menubarPath="debug"
id="io.sarl.lang.SARL.rulerContextMenu.toggleBreakpointAction">
</action>
</viewerContribution>
</extension>
My problem in the new version of my plugin.xml is that the type "org.eclipse.debug.ui.actions.RulerToggleBreakpointActionDelegate" is not a IHandler.
I have not found the corresponding handler.
Did anyone succeed in doing that? After all, even JDT and Xtext both still use the deprecated editorActions and others.
Stéphane.
|
|
|
Re: Toggle breakpoint in ruler popup menu [message #1499586 is a reply to message #1498286] |
Fri, 05 December 2014 08:44   |
Jonas Helming Messages: 699 Registered: July 2009 |
Senior Member |
|
|
Hi,
it seems to me your questions is not really related to e4, but rather to
the migration from actions to handlers/commands/items, isn't it? Those
have been introduced long before e4 and are still part of the 3.x API.
If Xtext and JDT use the old extension, what was the motivation for you
to change it?
best regards
Jonas
Am 04.12.2014 10:54, schrieb Stéphane Galland:
> Dear all,
>
> The API documentation still shows how to register a "Toggle breakpoint"
> action "the old way" (with editorActions and popupMenus).
> This used to be fine, but now with Eclipse 4 it causes many warnings,
> yet I have been unable to find how I am supposed to achieve the same
> effect with org.eclipse.ui.menus extension.
>
> I have the following elements in my plugin.xml.
>
>
> <extension point="org.eclipse.ui.handlers">
> <handler
> class="io.sarl.lang.ui.SARLExecutableExtensionFactory:org.eclipse.debug.ui.actions.RulerToggleBreakpointActionDelegate"
>
>
> commandId="io.sarl.lang.SARL.breakpoint.ToggleBreakpointCommand">
> <activeWhen>
> <reference definitionId="io.sarl.lang.SARL.Editor.opened"/>
> </activeWhen>
> </handler>
> </extension>
> <extension point="org.eclipse.ui.commands">
> <command
> description="%action.label.0"
> id="io.sarl.lang.SARL.breakpoint.ToggleBreakpointCommand"
> name="%action.label.0"/>
> </extension>
> <extension point="org.eclipse.ui.menus">
> <menuContribution
> locationURI="popup:io.sarl.lang.SARL.RulerContext?after=debug">
> <command
> commandId="io.sarl.lang.SARL.breakpoint.ToggleBreakpointCommand"
>
> id="io.sarl.lang.SARL.rulerContextMenu.toggleBreakpointAction"/>
> </menuContribution>
> </extension>
>
>
> The old version of my plugin.xml was:
>
> <extension point="org.eclipse.ui.popupMenus">
> <viewerContribution
> targetID="io.sarl.lang.SARL.RulerContext"
> id="io.sarl.lang.SARL.RulerPopupActions">
> <action
> label="%action.label.0"
>
> class="io.sarl.lang.ui.SARLExecutableExtensionFactory:org.eclipse.debug.ui.actions.RulerToggleBreakpointActionDelegate"
>
> menubarPath="debug"
> id="io.sarl.lang.SARL.rulerContextMenu.toggleBreakpointAction">
> </action>
> </viewerContribution>
> </extension>
>
>
> My problem in the new version of my plugin.xml is that the type
> "org.eclipse.debug.ui.actions.RulerToggleBreakpointActionDelegate" is
> not a IHandler.
> I have not found the corresponding handler.
>
> Did anyone succeed in doing that? After all, even JDT and Xtext both
> still use the deprecated editorActions and others.
>
> Stéphane.
--
Get professional Eclipse developer support:
http://eclipsesource.com/en/services/developer-support/
|
|
|
Re: Toggle breakpoint in ruler popup menu [message #1722987 is a reply to message #1499586] |
Wed, 10 February 2016 16:25  |
|
Dear Jonas.
Thank you for your reply. After a long time, I find time for coming back on the Xtext forum.
Usually, I assume that deprecated features could be removed in future versions.
Since e4 is marking the contributions as "deprecated", I have planned to switch to a "better practice".
However, until JDT uses the deprecated extension, I have not pushed up the switchting task in my priority list.
Nevertheless, if someone have an answer, it could be interesting for all of us.
All the best,
Stéphane.
|
|
|
Powered by
FUDForum. Page generated in 0.01942 seconds