Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » createLineBreakpoint
createLineBreakpoint [message #162709] Thu, 27 November 2003 04:57 Go to next message
Eclipse UserFriend
Originally posted by: brogger.daimi.au.dk

Hi.

Im writing an IDE that uses the JDT debugger. It works to some extent -
it is possible to create a line break point. Running the code in debug
mode then stops at the indicated line.

The only problem is that I can't make the little icon appear in the
vertical ruler. Im using the method
JDIDebugModel.createLineBreakpoint(...) (and I can see that JDT does
excatly the same), which should create a marker in the ruler.

My first guess was that the image that should be inserted was not
available - so I copied the "icon" directory into my plug-in workspace
directory - but it didn't help.


Any help will be appreciated,
Mads
Re: createLineBreakpoint [message #162918 is a reply to message #162709] Thu, 27 November 2003 10:41 Go to previous messageGo to next message
Eclipse UserFriend
The icon appears in the ruler based on the resource that the breakpoint
marker is associated with. Have you done the same as JDT in this respect?

Darin

"Mads Brogger Enevoldsen" <brogger@daimi.au.dk> wrote in message
news:3FC5CA82.2CA715AF@daimi.au.dk...
>
> Hi.
>
> Im writing an IDE that uses the JDT debugger. It works to some extent -
> it is possible to create a line break point. Running the code in debug
> mode then stops at the indicated line.
>
> The only problem is that I can't make the little icon appear in the
> vertical ruler. Im using the method
> JDIDebugModel.createLineBreakpoint(...) (and I can see that JDT does
> excatly the same), which should create a marker in the ruler.
>
> My first guess was that the image that should be inserted was not
> available - so I copied the "icon" directory into my plug-in workspace
> directory - but it didn't help.
>
>
> Any help will be appreciated,
> Mads
>
>
>
Re: createLineBreakpoint [message #163003 is a reply to message #162918] Thu, 27 November 2003 11:50 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: brogger.daimi.au.dk

No I haven't. I couldn't find the place where there was mentioned anything
about images or resources.

All I have is the following declaration in plugin.xml

<action
label="Beta Breakpoint"

class=" org.eclipse.ui.betaeditor.launching.BetaBreakpointRulerActio nDelegate "

actionID="RulerDoubleClick"
id="org.eclipse.ui.betaeditor.actions.BetaBreakpointAction" >
</action>


So how do I associate a ressource with the breakpoint?

Thanks,
Mads

Darin Wright wrote:

> The icon appears in the ruler based on the resource that the breakpoint
> marker is associated with. Have you done the same as JDT in this respect?
>
> Darin
>
> "Mads Brogger Enevoldsen" <brogger@daimi.au.dk> wrote in message
> news:3FC5CA82.2CA715AF@daimi.au.dk...
> >
> > Hi.
> >
> > Im writing an IDE that uses the JDT debugger. It works to some extent -
> > it is possible to create a line break point. Running the code in debug
> > mode then stops at the indicated line.
> >
> > The only problem is that I can't make the little icon appear in the
> > vertical ruler. Im using the method
> > JDIDebugModel.createLineBreakpoint(...) (and I can see that JDT does
> > excatly the same), which should create a marker in the ruler.
> >
> > My first guess was that the image that should be inserted was not
> > available - so I copied the "icon" directory into my plug-in workspace
> > directory - but it didn't help.
> >
> >
> > Any help will be appreciated,
> > Mads
> >
> >
> >
Re: createLineBreakpoint [message #163086 is a reply to message #163003] Thu, 27 November 2003 14:32 Go to previous messageGo to next message
Eclipse UserFriend
The breakpoint creation APIs accept a resource. See
JDIDebugModel.createLineBreakpoint(...) for example. The first argument is a
resource.

For examples on how the Java debugger associates resources with breakpoints
see BreakpointUtils in org.eclipse.jdt.debug.ui (but note, this is an
internal class).

Darin

"Mads Brogger Enevoldsen" <brogger@daimi.au.dk> wrote in message
news:3FC62B5C.D0FF844D@daimi.au.dk...
> No I haven't. I couldn't find the place where there was mentioned anything
> about images or resources.
>
> All I have is the following declaration in plugin.xml
>
> <action
> label="Beta Breakpoint"
>
>
class=" org.eclipse.ui.betaeditor.launching.BetaBreakpointRulerActio nDelegate
"
>
> actionID="RulerDoubleClick"
> id="org.eclipse.ui.betaeditor.actions.BetaBreakpointAction" >
> </action>
>
>
> So how do I associate a ressource with the breakpoint?
>
> Thanks,
> Mads
>
> Darin Wright wrote:
>
> > The icon appears in the ruler based on the resource that the breakpoint
> > marker is associated with. Have you done the same as JDT in this
respect?
> >
> > Darin
> >
> > "Mads Brogger Enevoldsen" <brogger@daimi.au.dk> wrote in message
> > news:3FC5CA82.2CA715AF@daimi.au.dk...
> > >
> > > Hi.
> > >
> > > Im writing an IDE that uses the JDT debugger. It works to some
extent -
> > > it is possible to create a line break point. Running the code in debug
> > > mode then stops at the indicated line.
> > >
> > > The only problem is that I can't make the little icon appear in the
> > > vertical ruler. Im using the method
> > > JDIDebugModel.createLineBreakpoint(...) (and I can see that JDT
does
> > > excatly the same), which should create a marker in the ruler.
> > >
> > > My first guess was that the image that should be inserted was not
> > > available - so I copied the "icon" directory into my plug-in workspace
> > > directory - but it didn't help.
> > >
> > >
> > > Any help will be appreciated,
> > > Mads
> > >
> > >
> > >
>
Re: createLineBreakpoint [message #163179 is a reply to message #163086] Fri, 28 November 2003 03:48 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: brogger.daimi.au.dk

Yes the JDIDebugModel.createLineBreakpoint() accepts a resource, and it gets it
by calling the method getBreakpointResource(IMember member).

The JavaDoc for this method reads:

* Returns the resource on which a breakpoint marker should
* be created for the given member. The resource returned is the
* associated file, or project in the case of a class file in
* a jar.

I can't see what that has to do with the image appearing in the ruler. To me
this method simply finds the IResource correspondig to the file currently being
edited.
I find the IResource with the following code:

protected IResource getResource() {
IEditorInput input= fEditor.getEditorInput();
IResource resource= (IResource) input.getAdapter(IFile.class);
if (resource == null) {
resource= (IResource) input.getAdapter(IResource.class);
}
return resource;
}

The Breakpoint is created porpberly - running the debugger makes it stop at the
right location.
My question is: Where do I declare what image that should be shown in the
ruler?


Darin Wright wrote:

> The breakpoint creation APIs accept a resource. See
> JDIDebugModel.createLineBreakpoint(...) for example. The first argument is a
> resource.
>
> For examples on how the Java debugger associates resources with breakpoints
> see BreakpointUtils in org.eclipse.jdt.debug.ui (but note, this is an
> internal class).
>
> Darin
>
> "Mads Brogger Enevoldsen" <brogger@daimi.au.dk> wrote in message
> news:3FC62B5C.D0FF844D@daimi.au.dk...
> > No I haven't. I couldn't find the place where there was mentioned anything
> > about images or resources.
> >
> > All I have is the following declaration in plugin.xml
> >
> > <action
> > label="Beta Breakpoint"
> >
> >
> class=" org.eclipse.ui.betaeditor.launching.BetaBreakpointRulerActio nDelegate
> "
> >
> > actionID="RulerDoubleClick"
> > id="org.eclipse.ui.betaeditor.actions.BetaBreakpointAction" >
> > </action>
> >
> >
> > So how do I associate a ressource with the breakpoint?
> >
> > Thanks,
> > Mads
> >
> > Darin Wright wrote:
> >
> > > The icon appears in the ruler based on the resource that the breakpoint
> > > marker is associated with. Have you done the same as JDT in this
> respect?
> > >
> > > Darin
> > >
> > > "Mads Brogger Enevoldsen" <brogger@daimi.au.dk> wrote in message
> > > news:3FC5CA82.2CA715AF@daimi.au.dk...
> > > >
> > > > Hi.
> > > >
> > > > Im writing an IDE that uses the JDT debugger. It works to some
> extent -
> > > > it is possible to create a line break point. Running the code in debug
> > > > mode then stops at the indicated line.
> > > >
> > > > The only problem is that I can't make the little icon appear in the
> > > > vertical ruler. Im using the method
> > > > JDIDebugModel.createLineBreakpoint(...) (and I can see that JDT
> does
> > > > excatly the same), which should create a marker in the ruler.
> > > >
> > > > My first guess was that the image that should be inserted was not
> > > > available - so I copied the "icon" directory into my plug-in workspace
> > > > directory - but it didn't help.
> > > >
> > > >
> > > > Any help will be appreciated,
> > > > Mads
> > > >
> > > >
> > > >
> >
Re: createLineBreakpoint [message #163316 is a reply to message #163179] Fri, 28 November 2003 10:04 Go to previous messageGo to next message
Eclipse UserFriend
The editor displays annotations in its vertical ruler. The editor knows
about breakpoints because each breakpoint has an associated marker, which
displays as an "annotation" in the ruler. When the marker changes
(created/modified/removed), a resource delta is fired and the editor knows
to update the annotation. The image for a breakpoint is retrieved from a
debug model presentation - in this case, the Java debugger contributes a
"model presentation" that is used to render elements from the Java debug
model.

See the Java editor as an example.

Darin

"Mads Brogger Enevoldsen" <brogger@daimi.au.dk> wrote in message
news:3FC70BDE.E60DC570@daimi.au.dk...
> Yes the JDIDebugModel.createLineBreakpoint() accepts a resource, and it
gets it
> by calling the method getBreakpointResource(IMember member).
>
> The JavaDoc for this method reads:
>
> * Returns the resource on which a breakpoint marker should
> * be created for the given member. The resource returned is the
> * associated file, or project in the case of a class file in
> * a jar.
>
> I can't see what that has to do with the image appearing in the ruler. To
me
> this method simply finds the IResource correspondig to the file currently
being
> edited.
> I find the IResource with the following code:
>
> protected IResource getResource() {
> IEditorInput input= fEditor.getEditorInput();
> IResource resource= (IResource) input.getAdapter(IFile.class);
> if (resource == null) {
> resource= (IResource) input.getAdapter(IResource.class);
> }
> return resource;
> }
>
> The Breakpoint is created porpberly - running the debugger makes it stop
at the
> right location.
> My question is: Where do I declare what image that should be shown in the
> ruler?
>
>
> Darin Wright wrote:
>
> > The breakpoint creation APIs accept a resource. See
> > JDIDebugModel.createLineBreakpoint(...) for example. The first argument
is a
> > resource.
> >
> > For examples on how the Java debugger associates resources with
breakpoints
> > see BreakpointUtils in org.eclipse.jdt.debug.ui (but note, this is an
> > internal class).
> >
> > Darin
> >
> > "Mads Brogger Enevoldsen" <brogger@daimi.au.dk> wrote in message
> > news:3FC62B5C.D0FF844D@daimi.au.dk...
> > > No I haven't. I couldn't find the place where there was mentioned
anything
> > > about images or resources.
> > >
> > > All I have is the following declaration in plugin.xml
> > >
> > > <action
> > > label="Beta Breakpoint"
> > >
> > >
> >
class=" org.eclipse.ui.betaeditor.launching.BetaBreakpointRulerActio nDelegate
> > "
> > >
> > > actionID="RulerDoubleClick"
> > >
id="org.eclipse.ui.betaeditor.actions.BetaBreakpointAction" >
> > > </action>
> > >
> > >
> > > So how do I associate a ressource with the breakpoint?
> > >
> > > Thanks,
> > > Mads
> > >
> > > Darin Wright wrote:
> > >
> > > > The icon appears in the ruler based on the resource that the
breakpoint
> > > > marker is associated with. Have you done the same as JDT in this
> > respect?
> > > >
> > > > Darin
> > > >
> > > > "Mads Brogger Enevoldsen" <brogger@daimi.au.dk> wrote in message
> > > > news:3FC5CA82.2CA715AF@daimi.au.dk...
> > > > >
> > > > > Hi.
> > > > >
> > > > > Im writing an IDE that uses the JDT debugger. It works to some
> > extent -
> > > > > it is possible to create a line break point. Running the code in
debug
> > > > > mode then stops at the indicated line.
> > > > >
> > > > > The only problem is that I can't make the little icon appear in
the
> > > > > vertical ruler. Im using the method
> > > > > JDIDebugModel.createLineBreakpoint(...) (and I can see that JDT
> > does
> > > > > excatly the same), which should create a marker in the ruler.
> > > > >
> > > > > My first guess was that the image that should be inserted was not
> > > > > available - so I copied the "icon" directory into my plug-in
workspace
> > > > > directory - but it didn't help.
> > > > >
> > > > >
> > > > > Any help will be appreciated,
> > > > > Mads
> > > > >
> > > > >
> > > > >
> > >
>
Re: createLineBreakpoint [message #164518 is a reply to message #163316] Tue, 02 December 2003 06:05 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: brogger.daimi.au.dk

Darin Wright wrote:

> The editor displays annotations in its vertical ruler. The editor knows
> about breakpoints because each breakpoint has an associated marker, which
> displays as an "annotation" in the ruler. When the marker changes
> (created/modified/removed), a resource delta is fired and the editor knows
> to update the annotation. The image for a breakpoint is retrieved from a
> debug model presentation - in this case, the Java debugger contributes a
> "model presentation" that is used to render elements from the Java debug
> model.
>
> See the Java editor as an example.
>
> Darin

I've tried to add a debug model presentation to my plug-in. I write the
following extension in the plugin.xml

<extension point = "org.eclipse.debug.ui.debugModelPresentations">
<debugModelPresentation
class = "org.eclipse.jdt.internal.debug.ui.JDIModelPresentation"
id = "org.eclipse.jdt.debug"
</debugModelPresentation>
</extension>


This is exactly the same as JDT does. I can trace the addBreakpoint call down
into the JDIDebugModel and further on into JavaLineBreakpoint - but it is as if
the JDIModelPresentation doesn't get used. The method getImage is never called
(as it is in Java mode).

It's hard to figure out what is happening in the JDT editor, but do I need a
Resource delta listener registered - and make it react to resource changes
using the JDIModelPresentation?

Thanks,
Mads
Re: createLineBreakpoint [message #164631 is a reply to message #164518] Tue, 02 December 2003 09:28 Go to previous messageGo to next message
Eclipse UserFriend
You cannot re-define the JDT model presentation. The Java debugger
contributes its model presentation for the Java debug model, identified by
"org.eclipse.jdt.debug". There can only be one presentation per debug
model - and this duplicate definition may cause trouble.

I don't understand what you are trying to accomplish. Perhaps you could
explain the problem you are trying to solve.

Darin

"Mads Brogger Enevoldsen" <brogger@daimi.au.dk> wrote in message
news:3FCC720E.78F7D4EC@daimi.au.dk...
> Darin Wright wrote:
>
> > The editor displays annotations in its vertical ruler. The editor knows
> > about breakpoints because each breakpoint has an associated marker,
which
> > displays as an "annotation" in the ruler. When the marker changes
> > (created/modified/removed), a resource delta is fired and the editor
knows
> > to update the annotation. The image for a breakpoint is retrieved from a
> > debug model presentation - in this case, the Java debugger contributes a
> > "model presentation" that is used to render elements from the Java debug
> > model.
> >
> > See the Java editor as an example.
> >
> > Darin
>
> I've tried to add a debug model presentation to my plug-in. I write the
> following extension in the plugin.xml
>
> <extension point = "org.eclipse.debug.ui.debugModelPresentations">
> <debugModelPresentation
> class =
"org.eclipse.jdt.internal.debug.ui.JDIModelPresentation"
> id = "org.eclipse.jdt.debug"
> </debugModelPresentation>
> </extension>
>
>
> This is exactly the same as JDT does. I can trace the addBreakpoint call
down
> into the JDIDebugModel and further on into JavaLineBreakpoint - but it is
as if
> the JDIModelPresentation doesn't get used. The method getImage is never
called
> (as it is in Java mode).
>
> It's hard to figure out what is happening in the JDT editor, but do I need
a
> Resource delta listener registered - and make it react to resource changes
> using the JDIModelPresentation?
>
> Thanks,
> Mads
>
Re: createLineBreakpoint [message #165863 is a reply to message #164631] Thu, 04 December 2003 10:28 Go to previous message
Eclipse UserFriend
Originally posted by: brogger.daimi.au.dk

Im writing an IDE for the language Beta. The Beta compiler generates Java
bytecodes, so it is natural to reuse some of the clases in JDT. In fact the
class I use as the launch delegate is
JavaLocalApplicationLaunchConfigurationDelegate.

So launching applications works perfectly fine! But debugging is more
complicated. I've made the ruler respond to double clicks and let the
corresponding action be to insert a breakpoint. In the code I have the
code: JDIDebugModel.createLineBreakpoint(resource, "beta.program", lineNo, -1,
-1, 0, true, null).
And this almost works. The only thing missing is the little icon appearing in
the ruler - the debugger stops executing when reaching the specified line.

So what Im really asking: How do I make the little icon appear in the ruler?

Thanks,
Mads

Darin Wright wrote:

> You cannot re-define the JDT model presentation. The Java debugger
> contributes its model presentation for the Java debug model, identified by
> "org.eclipse.jdt.debug". There can only be one presentation per debug
> model - and this duplicate definition may cause trouble.
>
> I don't understand what you are trying to accomplish. Perhaps you could
> explain the problem you are trying to solve.
>
> Darin
>
Previous Topic:plugin.xml
Next Topic:debugger error messages
Goto Forum:
  


Current Time: Sun Jul 27 12:50:18 EDT 2025

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

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

Back to the top