Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » How can I hook the breakpoint view actions
How can I hook the breakpoint view actions [message #319391] Mon, 20 August 2007 09:53 Go to next message
Eclipse UserFriend
I want to be notified when the breakpoint view actions "remove" and
"remove all" take place, so I can tell our editor to remove breakpoints.
So, my first thought was to setup a listener on the breakpoint list. But,
if I do that I will also be notified when our own editor adds or removes a
breakpoint. See the circularity here?

What I really want is some callback from the actions themselves, not the
entity that it modifies.

Is this a "fact of life" for listeners? That is, they should set a bit to
protect against circularities, turn off certain listeners, etc.? Or, is
there a more elegant way to do this?

We don't use the ruler (gutter decoration) stuff in Eclipse editor
classes, we have our own gutter. Although our editor does extend the
TextEditor and SourceViewer, etc.
Re: How can I hook the breakpoint view actions [message #319417 is a reply to message #319391] Mon, 20 August 2007 13:46 Go to previous messageGo to next message
Eclipse UserFriend
If you can find commands, you can register a listener with the
ICommandService that will notify you of execution. For example, I see
org.eclipse.debug.ui.commands.RemoveAllBreakpoints (I found it in the
Plug-in Registry view).

In 3.3 that will tell you when that command is executed (usually via a
keybinding), but will not notify you if the user presses the toolbar
version (except in a few cases).

Later,
PW


--
Paul Webster
http://wiki.eclipse.org/Platform_Command_Framework
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Menu_Contributions
http://wiki.eclipse.org/Menus_Extension_Mapping
Re: How can I hook the breakpoint view actions [message #319449 is a reply to message #319391] Tue, 21 August 2007 11:25 Go to previous message
Eclipse UserFriend
Use IBreakpointListener to listen to breakpoint additions/removals. However,
if your editor already has a "marker annotation model" then breakpoints will
appear/disappear from your ruler automatically based on the resources the
markers are associated with, and the line number attribute on the marker.
See these for more information:

http://www.eclipse.org/eclipse/debug/documents/ec_2007/Debug _Tutorial_2007.pdf
http://www.eclipse.org/articles/Article-Debugger/how-to.html

Darin


"Farokh Morshed" <fmorshed@curl.com> wrote in message
news:2b7fc94c72b16f68d0e004a81493b533$1@www.eclipse.org...
>I want to be notified when the breakpoint view actions "remove" and "remove
>all" take place, so I can tell our editor to remove breakpoints. So, my
>first thought was to setup a listener on the breakpoint list. But, if I do
>that I will also be notified when our own editor adds or removes a
>breakpoint. See the circularity here?
>
> What I really want is some callback from the actions themselves, not the
> entity that it modifies.
>
> Is this a "fact of life" for listeners? That is, they should set a bit to
> protect against circularities, turn off certain listeners, etc.? Or, is
> there a more elegant way to do this?
>
> We don't use the ruler (gutter decoration) stuff in Eclipse editor
> classes, we have our own gutter. Although our editor does extend the
> TextEditor and SourceViewer, etc.
>
Previous Topic:Text hovers for all editors
Next Topic:Navigator rename bug
Goto Forum:
  


Current Time: Sat Nov 08 04:09:04 EST 2025

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

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

Back to the top