Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Obtaining an IResource from a fully qualified class name
Obtaining an IResource from a fully qualified class name [message #331070] Fri, 22 August 2008 22:01 Go to next message
Eclipse UserFriend
Originally posted by: pschoenb.gmx.de

Hi,

for a custom debugger implementation, I need to set Java line
breakpoints programmatically. In order to achieve this, I need an
IResource of the resource for which I want to set a breakpoint. I only
have the fully qualified class name as a string where the breakpoint is
to be set. How do I obtain the corresponding IResource object from that?

--
Regards,
Patrick
Re: Obtaining an IResource from a fully qualified class name [message #331071 is a reply to message #331070] Fri, 22 August 2008 23:03 Go to previous messageGo to next message
Francis Upton IV is currently offline Francis Upton IVFriend
Messages: 472
Registered: July 2009
Location: Oakland, CA
Senior Member
ResourcesPlugin.getWorkspace().getRoot().getFile(new Path(<your file
name>p));

Your file name needs to be qualified by the project name and the
packages, like:

Project/src/org/eclipse/package/class.class

Look at IContainer for more information.

Patrick Schoenbach wrote:
> Hi,
>
> for a custom debugger implementation, I need to set Java line
> breakpoints programmatically. In order to achieve this, I need an
> IResource of the resource for which I want to set a breakpoint. I only
> have the fully qualified class name as a string where the breakpoint is
> to be set. How do I obtain the corresponding IResource object from that?
>


--
*new* Common Navigator Framework section in:
3.4RC4 Platform Plugin Developer Guide (Programmer's Guide)
http://help.eclipse.org/ganymede/topic/org.eclipse.platform. doc.isv/guide/cnf.htm
http://dev.eclipse.org/blogs/francis
http://wiki.eclipse.org/Common_Navigator_Framework
http://wiki.eclipse.org/Common_Navigator_Framework_Use_Cases


You have brains in your head.
You have feet in your shoes.
- Dr Seuss, Oh the Places You'll Go


Re: Obtaining an IResource from a fully qualified class name [message #331074 is a reply to message #331071] Sat, 23 August 2008 06:34 Go to previous messageGo to next message
Prakash G.R. is currently offline Prakash G.R.Friend
Messages: 621
Registered: July 2009
Senior Member
Francis,

If the source folder name is different or if the class in question is
an inner class, it won't work. I guess we first need to get the IType
for the fully qualified name and use the getCompilationUnit() or
getCorrespondingResource()

Copying jdt, as we might get more accurate replies there.

- Prakash

www.eclipse-tips.com



Francis Upton (News) wrote:
> ResourcesPlugin.getWorkspace().getRoot().getFile(new Path(<your file
> name>p));
>
> Your file name needs to be qualified by the project name and the
> packages, like:
>
> Project/src/org/eclipse/package/class.class
>
> Look at IContainer for more information.
>
> Patrick Schoenbach wrote:
>> Hi,
>>
>> for a custom debugger implementation, I need to set Java line
>> breakpoints programmatically. In order to achieve this, I need an
> Path: build.eclipse.org!pc01.robustsoft.de!news
> From: Patrick Schoenbach <pschoenb@gmx.de>
> Newsgroups: eclipse.platform
> Subject: Obtaining an IResource from a fully qualified class name
> Date: Sat, 23 Aug 2008 00:01:54 +0200
> Organization: EclipseCorner
> Lines: 11
> Message-ID: <1o6asip0wu070.zd0bqyqgsktm.dlg@40tude.net>
> NNTP-Posting-Host: pc01.robustsoft.de
> Mime-Version: 1.0
> Content-Type: text/plain; charset="us-ascii"
> Content-Transfer-Encoding: 7bit
> X-Trace: build.eclipse.org 1219443304 31057 87.230.127.17 (22 Aug 2008
> 22:15:04 GMT)
> X-Complaints-To: news@build.eclipse.org
> NNTP-Posting-Date: Fri, 22 Aug 2008 22:15:04 +0000 (UTC)
> User-Agent: 40tude_Dialog/2.0.15.1de
> Xref: build.eclipse.org eclipse.platform:77287
>
> Hi,
>
> for a custom debugger implementation, I need to set Java line
> breakpoints programmatically. In order to achieve this, I need an
> IResource of the resource for which I want to set a breakpoint. I only
> have the fully qualified class name as a string where the breakpoint is
> to be set. How do I obtain the corresponding IResource object from that?
>
Re: Obtaining an IResource from a fully qualified class name [message #331079 is a reply to message #331074] Sat, 23 August 2008 13:45 Go to previous message
Eclipse UserFriend
Originally posted by: pschoenb.gmx.de

On Sat, 23 Aug 2008 12:04:14 +0530, Prakash G.R. wrote:

> If the source folder name is different or if the class in question is
> an inner class, it won't work. I guess we first need to get the IType
> for the fully qualified name and use the getCompilationUnit() or
> getCorrespondingResource()

This sounds like the way to go. Thanks.

--
Regards,
Patrick
Previous Topic:Trouble with lots of data , Swt Tables and DataBinding
Next Topic:Auto-complete does not work on Linux (works on Windows) in 3.4
Goto Forum:
  


Current Time: Thu Aug 01 03:23:34 GMT 2024

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

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

Back to the top