Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » AspectJ » Open Editor for IProgramElement
Open Editor for IProgramElement [message #47272] Tue, 01 February 2005 17:20 Go to next message
Juergen Graf is currently offline Juergen GrafFriend
Messages: 4
Registered: July 2009
Junior Member
Hi,

how do I tell Eclipse/Ajdt to open an Editor and jump to the Position of
a given IProgramElement.

Using the code below, i get a "not implemented" errormessage.

IProgramElement elem = ...;
Ajde.getDefault().getEditorAdapter().showSourceLine(elem.get SourceLocation(),
true);

Greets,
Juergen
Re: Open Editor for IProgramElement [message #47425 is a reply to message #47272] Fri, 04 February 2005 10:31 Go to previous message
Eclipse UserFriend
Originally posted by: mchapman.uk.ibm.com

On Tue, 01 Feb 2005 18:20:22 +0100, Juergen Graf wrote:
> how do I tell Eclipse/Ajdt to open an Editor and jump to the Position of
> a given IProgramElement.
>
> Using the code below, i get a "not implemented" errormessage.
>
> IProgramElement elem = ...;
> Ajde.getDefault().getEditorAdapter().showSourceLine(elem.get SourceLocation(),
> true);

Hi,

This is really a question for the ajdt-dev list, but one route is to
convert the IProgramElement into an Eclipse object, such as a IJavaElement
or IResource, then you can use the standard Eclipse API calls for opening
an editor and jumping to a location. For some examples, see JDTUtils in
the visualiser code, and AJModel.getCorrespondingJavaElement() in
ajdt.core.

Regards,

Matt.

--
Matt Chapman
AJDT Development, http://www.eclipse.org/ajdt
Re: Open Editor for IProgramElement [message #586432 is a reply to message #47272] Fri, 04 February 2005 10:31 Go to previous message
Matt Chapman is currently offline Matt ChapmanFriend
Messages: 429
Registered: July 2009
Senior Member
On Tue, 01 Feb 2005 18:20:22 +0100, Juergen Graf wrote:
> how do I tell Eclipse/Ajdt to open an Editor and jump to the Position of
> a given IProgramElement.
>
> Using the code below, i get a "not implemented" errormessage.
>
> IProgramElement elem = ...;
> Ajde.getDefault().getEditorAdapter().showSourceLine(elem.get SourceLocation(),
> true);

Hi,

This is really a question for the ajdt-dev list, but one route is to
convert the IProgramElement into an Eclipse object, such as a IJavaElement
or IResource, then you can use the standard Eclipse API calls for opening
an editor and jumping to a location. For some examples, see JDTUtils in
the visualiser code, and AJModel.getCorrespondingJavaElement() in
ajdt.core.

Regards,

Matt.

--
Matt Chapman
AJDT Development, http://www.eclipse.org/ajdt
Previous Topic:3.1M4 ClassCastException
Next Topic:link to AspectJ 5 Developer's Notebook is dangling
Goto Forum:
  


Current Time: Thu Apr 25 05:06:41 GMT 2024

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

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

Back to the top