Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse 4 » Toggle breakpoint in ruler popup menu(Toggle breakpoint in ruler popup menu with the new command API)
Toggle breakpoint in ruler popup menu [message #1498286] Thu, 04 December 2014 09:54 Go to next message
Stéphane Galland is currently offline Stéphane GallandFriend
Messages: 123
Registered: July 2014
Location: Belfort, France
Senior Member
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 Go to previous messageGo to next message
Jonas Helming is currently offline Jonas HelmingFriend
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 Go to previous message
Stéphane Galland is currently offline Stéphane GallandFriend
Messages: 123
Registered: July 2014
Location: Belfort, France
Senior Member
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.
Previous Topic:UIEvents.UILifeCycle.APP_SHUTDOWN_STARTED event is not thrown
Next Topic:Default Shell Icon in E4 App
Goto Forum:
  


Current Time: Wed Jun 29 05:10:19 GMT 2022

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

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

Back to the top