createLineBreakpoint [message #162709] |
Thu, 27 November 2003 04:57  |
Eclipse User |
|
|
|
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 #163316 is a reply to message #163179] |
Fri, 28 November 2003 10:04   |
Eclipse User |
|
|
|
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 #165863 is a reply to message #164631] |
Thu, 04 December 2003 10:28  |
Eclipse User |
|
|
|
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
>
|
|
|
Powered by
FUDForum. Page generated in 0.06295 seconds