Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » Scroll to line in TextEditor
Scroll to line in TextEditor [message #147554] Tue, 21 October 2003 21:56 Go to next message
Eclipse UserFriend
I'm writing a debugger and wondering how to get the editor associated with
a particular stack frame to scroll to the active line of code. I've
already implemented a SourceLocator, returning the source element, then
getEditorInput() in the DebugModelPresentation returning an IEditorInput.
This only appears to let me pass along a reference to the file itself. Is
there an interface somewhere else to pass along a marker or a line number?
Or perhaps a way to automate the editor later to scroll?

Thanks,

Adam
Re: Scroll to line in TextEditor [message #147935 is a reply to message #147554] Wed, 22 October 2003 16:53 Go to previous messageGo to next message
Eclipse UserFriend
Which version of Eclipse are you working with?
In 3.0 you can provide an IDebugEditorPresentation that controls the "select
and reveal" for you stack frame.

In 2.1.1 and earlier, the Launch view does the work (and still will in 3.0
if no editor presentation is provided).
You must have the correct linenumber, charStart and charEnd set for your
stack frame.
See LaunchView.selectAndReveal(ITextEditor, int, int, int, IThread)

HTH
Darins

"Adam Peller" <apeller@us.ibm.com> wrote in message
news:bn4o3k$tn1$1@eclipse.org...
> I'm writing a debugger and wondering how to get the editor associated with
> a particular stack frame to scroll to the active line of code. I've
> already implemented a SourceLocator, returning the source element, then
> getEditorInput() in the DebugModelPresentation returning an IEditorInput.
> This only appears to let me pass along a reference to the file itself. Is
> there an interface somewhere else to pass along a marker or a line number?
> Or perhaps a way to automate the editor later to scroll?
>
> Thanks,
>
> Adam
>
>
Re: Scroll to line in TextEditor [message #148392 is a reply to message #147935] Thu, 23 October 2003 09:13 Go to previous messageGo to next message
Eclipse UserFriend
Darin,

Thanks for the quick response. Yep, I'm using 2.1. Pardon my ignorance,
but I can't find LaunchView. What package is it in? And where would I
insert the call so as to override the default behavior?

-Adam


Darin Swanson wrote:

> Which version of Eclipse are you working with?
> In 3.0 you can provide an IDebugEditorPresentation that controls the "select
> and reveal" for you stack frame.

> In 2.1.1 and earlier, the Launch view does the work (and still will in 3.0
> if no editor presentation is provided).
> You must have the correct linenumber, charStart and charEnd set for your
> stack frame.
> See LaunchView.selectAndReveal(ITextEditor, int, int, int, IThread)

> HTH
> Darins

> "Adam Peller" <apeller@us.ibm.com> wrote in message
> news:bn4o3k$tn1$1@eclipse.org...
> > I'm writing a debugger and wondering how to get the editor associated with
> > a particular stack frame to scroll to the active line of code. I've
> > already implemented a SourceLocator, returning the source element, then
> > getEditorInput() in the DebugModelPresentation returning an IEditorInput.
> > This only appears to let me pass along a reference to the file itself. Is
> > there an interface somewhere else to pass along a marker or a line number?
> > Or perhaps a way to automate the editor later to scroll?
> >
> > Thanks,
> >
> > Adam
> >
> >
Re: Scroll to line in TextEditor [message #148743 is a reply to message #147554] Thu, 23 October 2003 16:26 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: bob.objfac.com

Have you tried calling the editor's SelectAndReveal() method?

Bob Foster

"Adam Peller" <apeller@us.ibm.com> wrote in message
news:bn4o3k$tn1$1@eclipse.org...
> I'm writing a debugger and wondering how to get the editor associated with
> a particular stack frame to scroll to the active line of code. I've
> already implemented a SourceLocator, returning the source element, then
> getEditorInput() in the DebugModelPresentation returning an IEditorInput.
> This only appears to let me pass along a reference to the file itself. Is
> there an interface somewhere else to pass along a marker or a line number?
> Or perhaps a way to automate the editor later to scroll?
>
> Thanks,
>
> Adam
>
>
Re: Scroll to line in TextEditor [message #148778 is a reply to message #148392] Thu, 23 October 2003 16:47 Go to previous messageGo to next message
Eclipse UserFriend
I think it was still called the DebugView in 2.1.
You don't need to override the default behavior.
Configure your implementation of IStackFrame to have the correct linenumber,
charStart and charEnd and I believe things should just work.
Sorry for any confusion but I am partially working from memory as I
currently live in the 3.0 world.

Darins

"Adam Peller" <apeller@us.ibm.com> wrote in message
news:bn8k5q$bf3$1@eclipse.org...
> Darin,
>
> Thanks for the quick response. Yep, I'm using 2.1. Pardon my ignorance,
> but I can't find LaunchView. What package is it in? And where would I
> insert the call so as to override the default behavior?
>
> -Adam
>
>
> Darin Swanson wrote:
>
> > Which version of Eclipse are you working with?
> > In 3.0 you can provide an IDebugEditorPresentation that controls the
"select
> > and reveal" for you stack frame.
>
> > In 2.1.1 and earlier, the Launch view does the work (and still will in
3.0
> > if no editor presentation is provided).
> > You must have the correct linenumber, charStart and charEnd set for your
> > stack frame.
> > See LaunchView.selectAndReveal(ITextEditor, int, int, int, IThread)
>
> > HTH
> > Darins
>
> > "Adam Peller" <apeller@us.ibm.com> wrote in message
> > news:bn4o3k$tn1$1@eclipse.org...
> > > I'm writing a debugger and wondering how to get the editor associated
with
> > > a particular stack frame to scroll to the active line of code. I've
> > > already implemented a SourceLocator, returning the source element,
then
> > > getEditorInput() in the DebugModelPresentation returning an
IEditorInput.
> > > This only appears to let me pass along a reference to the file itself.
Is
> > > there an interface somewhere else to pass along a marker or a line
number?
> > > Or perhaps a way to automate the editor later to scroll?
> > >
> > > Thanks,
> > >
> > > Adam
> > >
> > >
>
>
Re: Scroll to line in TextEditor [message #148786 is a reply to message #148743] Thu, 23 October 2003 16:48 Go to previous message
Eclipse UserFriend
I am pretty sure that in 2.1 this should be called for you by the framework
if you have the IStackFrame configured correctly
But my memory has failed me before... :-)
Darins

"Bob Foster" <bob@objfac.com> wrote in message
news:bn9cig$4pu$1@eclipse.org...
> Have you tried calling the editor's SelectAndReveal() method?
>
> Bob Foster
>
> "Adam Peller" <apeller@us.ibm.com> wrote in message
> news:bn4o3k$tn1$1@eclipse.org...
> > I'm writing a debugger and wondering how to get the editor associated
with
> > a particular stack frame to scroll to the active line of code. I've
> > already implemented a SourceLocator, returning the source element, then
> > getEditorInput() in the DebugModelPresentation returning an
IEditorInput.
> > This only appears to let me pass along a reference to the file itself.
Is
> > there an interface somewhere else to pass along a marker or a line
number?
> > Or perhaps a way to automate the editor later to scroll?
> >
> > Thanks,
> >
> > Adam
> >
> >
>
>
Previous Topic:PDE: Preferences: default values not available
Next Topic:User Mailinglists and newsgroups
Goto Forum:
  


Current Time: Mon May 05 05:58:20 EDT 2025

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

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

Back to the top