Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Command alternative for editorActions, RulerToggleBreakpointActionDelegate
Command alternative for editorActions, RulerToggleBreakpointActionDelegate [message #1007363] Tue, 05 February 2013 16:00 Go to next message
Lars Schütze is currently offline Lars SchützeFriend
Messages: 43
Registered: March 2012
Location: Germany
Member

Hello,

I am writing a debugger and currently using the extension points org.eclipse.ui.popupMenus where I can easy add a viewerContribution referring to the class org.eclipse.debug.ui.actions.RulerToggleBreakpointActionDelegate. Same with the extension point org.eclipse.ui.editorActions for toggling the breakpoint at the ruler.
But those extension points are deprecated with Juno. Now I am looking to replace them with commands, but I can just get the "Toggle Breakpoint" to appear in the popup menu. But I do not know, how I can link to an adequate command implementation for org.eclipse.debug.ui.actions.RulerToggleBreakpointActionDelegate.

Any suggestions?

Below is the code I currently use
 <extension point="org.eclipse.ui.popupMenus">
 	<viewerContribution
 		id="org.dresdenocl.language.ocl.resource.ocl.ui.RulerPopupActions"
 		targetID="org.dresdenocl.language.ocl.resource.ocl.EditorRuler">
 			<action
 				id="org.dresdenocl.language.ocl.resource.ocl.ui.toggleBreakpointAction"
 				icon="icons/breakpoint_icon.gif"
 				label="Toggle Breakpoint"
 				class="org.eclipse.debug.ui.actions.RulerToggleBreakpointActionDelegate"
 				menubarPath="debug">
			</action>
	</viewerContribution>
</extension>
<extension point="org.eclipse.ui.editorActions">
	<editorContribution
		targetID="org.dresdenocl.language.ocl.resource.ocl.ui.OclEditor"
		id="org.dresdenocl.language.ocl.resource.ocl.ui.BreakpointRulerActions">
			<action
         actionID="RulerDoubleClick"
         class="org.eclipse.debug.ui.actions.RulerToggleBreakpointActionDelegate"
         icon="icons/breakpoint_icon.gif"
         id="org.dresdenocl.language.ocl.resource.ocl.ui.debug.RulerToggleBreakpointAction"
         label="Add breakpoint">
			</action>
	</editorContribution>
</extension>

Thanks in advance.

[Updated on: Tue, 05 February 2013 16:00]

Report message to a moderator

Re: Command alternative for editorActions, RulerToggleBreakpointActionDelegate [message #1012280 is a reply to message #1007363] Thu, 21 February 2013 09:04 Go to previous messageGo to next message
Altamish Ahmad is currently offline Altamish AhmadFriend
Messages: 1
Registered: February 2013
Junior Member
Hi Lars. I am facing a similar issue. Have you found out a solution?
Re: Command alternative for editorActions, RulerToggleBreakpointActionDelegate [message #1012286 is a reply to message #1007363] Thu, 21 February 2013 09:17 Go to previous messageGo to next message
Lars Schütze is currently offline Lars SchützeFriend
Messages: 43
Registered: March 2012
Location: Germany
Member

Want to bump that question as it is still valid. Is there noone who knows an answer or even a good pointer?
Re: Command alternative for editorActions, RulerToggleBreakpointActionDelegate [message #1014769 is a reply to message #1007363] Tue, 26 February 2013 12:39 Go to previous messageGo to next message
Lars Schütze is currently offline Lars SchützeFriend
Messages: 43
Registered: March 2012
Location: Germany
Member

Isnt there anyone with any knowledge about this? Or does anyone know someone I can ask to?
Re: Command alternative for editorActions, RulerToggleBreakpointActionDelegate [message #1014799 is a reply to message #1014769] Tue, 26 February 2013 13:39 Go to previous messageGo to next message
Lars Schütze is currently offline Lars SchützeFriend
Messages: 43
Registered: March 2012
Location: Germany
Member

So I got a conversation with Paul Webster in the IRC. Thanks to him for the pointers. I will update this topic with my solution when I got the time to implement it.
Quote:
paulweb515: for commands you need a handler
you use use commands and menus to put the menu item where you want it, then you provide the handler somehow. Choices are org.eclipse.ui.handlers or by supplying one to the IHandlerService.
do you supply the editors that are being used?
it looks like the delegate is a wrapper for org.eclipse.debug.ui.actions.ToggleBreakpointAction
laze1989: paulweb515, yes I supply the editor. I implemented the toggling already with a handler. But the ToggleBreakPointAction does much more, as it (magically) makes the breakpoints appear in the breakpoint view.
paulweb515: TBPA can be instantiated in your editor and passed to IHandlerService (as an ActionHandler) as the handler for your command.
laze1989: So, the command framework is likely to discourage the use of the plugin.xml in favour to register those handlers programmatically?
paulweb515: generally the plugin.xml is preferred, but you need to bridge an IAction to an IHandler, so you need to do that programmatically
laze1989: Thank you. Thought there might be a solution without the IAction.
Re: Command alternative for editorActions, RulerToggleBreakpointActionDelegate [message #1225460 is a reply to message #1007363] Sun, 29 December 2013 22:48 Go to previous message
Per Mildner is currently offline Per MildnerFriend
Messages: 9
Registered: July 2009
Junior Member
Did you find a solution without using a deprecated API?
Previous Topic:How to make simplistic RCP app standalone?
Next Topic:Force Top-level Coolbar Layout
Goto Forum:
  


Current Time: Tue Mar 19 10:34:32 GMT 2024

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

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

Back to the top