Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » question about resource traversal in eclipse
question about resource traversal in eclipse [message #332872] Tue, 11 November 2008 22:18 Go to next message
Eclipse UserFriend
Originally posted by: marc.esher.comcast.net

Greetings all,
What's the preferred method of traversing resources in eclipse, i.e. user
right clicks on a directory, selects menu item to perform some action on
each resource in that directory and all subdirs? I'd like to simply get a
List of all resources for a dir and its subdirs. Just checking to see what's
built into the framework before going down the recursion route.

thanks!

marc
Re: question about resource traversal in eclipse [message #332876 is a reply to message #332872] Wed, 12 November 2008 06:26 Go to previous messageGo to next message
Prakash G.R. is currently offline Prakash G.R.Friend
Messages: 621
Registered: July 2009
Senior Member
You need to create a IResourceVisitor and call the IFolder.accept() method

- Prakash
--

http://blog.eclipse-tips.com
Re: question about resource traversal in eclipse [message #332896 is a reply to message #332876] Thu, 13 November 2008 03:03 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: marc.esher.comcast.net

awesome. that was what i was hoping to hear.

is this "idiom" documented with examples anywhere? the reason I ask is that
in order to even learn this was a possible approach, I basically stumbled
through other people's code that appeared to do something similar to what i
want to do, and that seemed awfully inefficient to me. I wasn't able to find
any non-API documentation on this though.

thanks.

marc


"Prakash G.R." <grprakash@gmail.com> wrote in message
news:gfdsvi$7da$1@build.eclipse.org...
> You need to create a IResourceVisitor and call the IFolder.accept() method
>
> - Prakash
> --
>
> http://blog.eclipse-tips.com
>
Re: question about resource traversal in eclipse [message #332914 is a reply to message #332896] Thu, 13 November 2008 19:35 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: eclipse-news.rizzoweb.com

On 11/12/2008 10:03 PM, Marc E wrote:
> awesome. that was what i was hoping to hear.
>
> is this "idiom" documented with examples anywhere? the reason I ask is
> that in order to even learn this was a possible approach, I basically
> stumbled through other people's code that appeared to do something
> similar to what i want to do, and that seemed awfully inefficient to me.
> I wasn't able to find any non-API documentation on this though.

The book "Contributing to Eclipse" by Gamma and Beck has a section on it
(here's the Google Books link:
http://books.google.com/books?id=0X6wZRd5OOQC&pg=PA301&a mp;lpg=PA301&dq=eclipse+resource+visitor)

This article (available on the Resources page of www.eclipse.org) talks
about it in the context of resource change events:
http://www.eclipse.org/articles/Article-Resource-deltas/reso urce-deltas.html

Personally, I work with a full SDK build of Eclipse so all of the
platform and "core" plugins have source included. That way I can easily
find uses of any API that I'm interested in to look at for examples.

Hope this helps,
Eric


> "Prakash G.R." <grprakash@gmail.com> wrote in message
> news:gfdsvi$7da$1@build.eclipse.org...
>> You need to create a IResourceVisitor and call the IFolder.accept()
>> method
>>
>> - Prakash
>> --
>>
>> http://blog.eclipse-tips.com
>>
>
Re: question about resource traversal in eclipse [message #332918 is a reply to message #332914] Thu, 13 November 2008 21:08 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: marc.esher.comcast.net

that helps a lot, Eric. I find that once I realize "the Eclipse way", I'm
often struck by how simple things are. It's finding "the way" that hangs me
up a lot.

thanks.

Marc



"Eric Rizzo" <eclipse-news@rizzoweb.com> wrote in message
news:gfhvim$3vt$1@build.eclipse.org...
> On 11/12/2008 10:03 PM, Marc E wrote:
>> awesome. that was what i was hoping to hear.
>>
>> is this "idiom" documented with examples anywhere? the reason I ask is
>> that in order to even learn this was a possible approach, I basically
>> stumbled through other people's code that appeared to do something
>> similar to what i want to do, and that seemed awfully inefficient to me.
>> I wasn't able to find any non-API documentation on this though.
>
> The book "Contributing to Eclipse" by Gamma and Beck has a section on it
> (here's the Google Books link:
> http://books.google.com/books?id=0X6wZRd5OOQC&pg=PA301&a mp;lpg=PA301&dq=eclipse+resource+visitor)
>
> This article (available on the Resources page of www.eclipse.org) talks
> about it in the context of resource change events:
> http://www.eclipse.org/articles/Article-Resource-deltas/reso urce-deltas.html
>
> Personally, I work with a full SDK build of Eclipse so all of the platform
> and "core" plugins have source included. That way I can easily find uses
> of any API that I'm interested in to look at for examples.
>
> Hope this helps,
> Eric
>
>
>> "Prakash G.R." <grprakash@gmail.com> wrote in message
>> news:gfdsvi$7da$1@build.eclipse.org...
>>> You need to create a IResourceVisitor and call the IFolder.accept()
>>> method
>>>
>>> - Prakash
>>> --
>>>
>>> http://blog.eclipse-tips.com
>>>
>>
>
Re: question about resource traversal in eclipse [message #332925 is a reply to message #332918] Fri, 14 November 2008 09:31 Go to previous message
Prakash G.R. is currently offline Prakash G.R.Friend
Messages: 621
Registered: July 2009
Senior Member
<shameless advertisement>

Give my Google Custom Search a try. Next time you might find it a little
easier to search for :-)

http://blog.eclipse-tips.com/2008/02/eclipse-search.html
http://blog.eclipse-tips.com/2008/07/eclipse-search-now-with -firefox-plugin.html

</shameless advertisement>

- Prakash
--

http://blog.eclipse-tips.com

"Marc E" <marc.esher@comcast.net> wrote in message
news:gfi50p$imm$1@build.eclipse.org...
> that helps a lot, Eric. I find that once I realize "the Eclipse way", I'm
> often struck by how simple things are. It's finding "the way" that hangs
> me up a lot.
>
> thanks.
>
> Marc
>
>
>
> "Eric Rizzo" <eclipse-news@rizzoweb.com> wrote in message
> news:gfhvim$3vt$1@build.eclipse.org...
>> On 11/12/2008 10:03 PM, Marc E wrote:
>>> awesome. that was what i was hoping to hear.
>>>
>>> is this "idiom" documented with examples anywhere? the reason I ask is
>>> that in order to even learn this was a possible approach, I basically
>>> stumbled through other people's code that appeared to do something
>>> similar to what i want to do, and that seemed awfully inefficient to me.
>>> I wasn't able to find any non-API documentation on this though.
>>
>> The book "Contributing to Eclipse" by Gamma and Beck has a section on it
>> (here's the Google Books link:
>> http://books.google.com/books?id=0X6wZRd5OOQC&pg=PA301&a mp;lpg=PA301&dq=eclipse+resource+visitor)
>>
>> This article (available on the Resources page of www.eclipse.org) talks
>> about it in the context of resource change events:
>> http://www.eclipse.org/articles/Article-Resource-deltas/reso urce-deltas.html
>>
>> Personally, I work with a full SDK build of Eclipse so all of the
>> platform and "core" plugins have source included. That way I can easily
>> find uses of any API that I'm interested in to look at for examples.
>>
>> Hope this helps,
>> Eric
>>
>>
>>> "Prakash G.R." <grprakash@gmail.com> wrote in message
>>> news:gfdsvi$7da$1@build.eclipse.org...
>>>> You need to create a IResourceVisitor and call the IFolder.accept()
>>>> method
>>>>
>>>> - Prakash
>>>> --
>>>>
>>>> http://blog.eclipse-tips.com
>>>>
>>>
>>
>
Previous Topic:How to change icon based on content in Project Explorer
Next Topic:Key bindings / Listen for changes
Goto Forum:
  


Current Time: Tue Apr 16 04:54:17 GMT 2024

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

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

Back to the top