Skip to main content



      Home
Home » Language IDEs » AspectJ » Open Editor for IProgramElement
Open Editor for IProgramElement [message #47272] Tue, 01 February 2005 12:20 Go to next message
Eclipse UserFriend
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 05: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 05:31 Go to previous message
Eclipse UserFriend
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: Fri May 09 12:04:24 EDT 2025

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

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

Back to the top