Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » COPIED_FROM in IResourceDelta
COPIED_FROM in IResourceDelta [message #336044] Thu, 14 May 2009 22:20 Go to next message
Richard Bone is currently offline Richard BoneFriend
Messages: 13
Registered: July 2009
Junior Member
Hi,

I have a builder that is interested in knowing when files were copied
from one location to another, either in the same project or in a
different one. When i do a copy, the resource delta (even in resource
change listeners) doesn't have the moved from path set. In looking at
the javadoc for IResourceDelta.COPIED_FROM, it seemed I should probably
have it, but one thing gave me pause...

/**
* Change constant (bit mask) indicating that the resource was copied
from another location.
* The location in the "before" state can be retrieved using
<code>getMovedFromPath()</code>.
* This flag is only used when describing potential changes using an
{@link IResourceChangeDescriptionFactory}.
*
* @see IResourceDelta#getFlags()
* @since 3.2
*/
public static final int COPIED_FROM = 0x800;

That bit at the end made me scratch my head. I'm guessing that this
means my delta wasn't created using this kind of factory? If there's
any way to ensure that my deltas have the moved from path set on a copy,
I'd love to find out how to do it.

Thanks!

Richard
Re: COPIED_FROM in IResourceDelta [message #336050 is a reply to message #336044] Fri, 15 May 2009 09:39 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: francis.oaklandsoftware.com

What you want is not supported, is the is the relevant bug report:

https://bugs.eclipse.org/bugs/show_bug.cgi?id=217489

The patch I provided has been working for me to provide the COPIED_FROM
notification, however it might not be provided correctly in certain cases
involving build notifications or something like that (it's been a while --
but everythign should be in the bug report).

Francis

On Thu, 14 May 2009 15:20:27 -0700, Richard Bone <rabone@us.ibm.com> wrote:

> Hi,
>
> I have a builder that is interested in knowing when files were copied
> from one location to another, either in the same project or in a
> different one. When i do a copy, the resource delta (even in resource
> change listeners) doesn't have the moved from path set. In looking at
> the javadoc for IResourceDelta.COPIED_FROM, it seemed I should probably
> have it, but one thing gave me pause...
>
> /**
> * Change constant (bit mask) indicating that the resource was copied
> from another location.
> * The location in the "before" state can be retrieved using
> <code>getMovedFromPath()</code>.
> * This flag is only used when describing potential changes using an
> {@link IResourceChangeDescriptionFactory}.
> *
> * @see IResourceDelta#getFlags()
> * @since 3.2
> */
> public static final int COPIED_FROM = 0x800;
>
> That bit at the end made me scratch my head. I'm guessing that this
> means my delta wasn't created using this kind of factory? If there's
> any way to ensure that my deltas have the moved from path set on a copy,
> I'd love to find out how to do it.
>
> Thanks!
>
> Richard



--
Common Navigator Framework section in 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: COPIED_FROM in IResourceDelta [message #336053 is a reply to message #336050] Fri, 15 May 2009 14:14 Go to previous message
Richard Bone is currently offline Richard BoneFriend
Messages: 13
Registered: July 2009
Junior Member
Thanks for the info!

Richard

Francis Upton wrote:
> What you want is not supported, is the is the relevant bug report:
>
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=217489
>
> The patch I provided has been working for me to provide the COPIED_FROM
> notification, however it might not be provided correctly in certain
> cases involving build notifications or something like that (it's been a
> while -- but everythign should be in the bug report).
>
> Francis
>
> On Thu, 14 May 2009 15:20:27 -0700, Richard Bone <rabone@us.ibm.com> wrote:
>
>> Hi,
>>
>> I have a builder that is interested in knowing when files were copied
>> from one location to another, either in the same project or in a
>> different one. When i do a copy, the resource delta (even in resource
>> change listeners) doesn't have the moved from path set. In looking at
>> the javadoc for IResourceDelta.COPIED_FROM, it seemed I should
>> probably have it, but one thing gave me pause...
>>
>> /**
>> * Change constant (bit mask) indicating that the resource was copied
>> from another location.
>> * The location in the "before" state can be retrieved using
>> <code>getMovedFromPath()</code>.
>> * This flag is only used when describing potential changes using an
>> {@link IResourceChangeDescriptionFactory}.
>> *
>> * @see IResourceDelta#getFlags()
>> * @since 3.2
>> */
>> public static final int COPIED_FROM = 0x800;
>>
>> That bit at the end made me scratch my head. I'm guessing that this
>> means my delta wasn't created using this kind of factory? If there's
>> any way to ensure that my deltas have the moved from path set on a
>> copy, I'd love to find out how to do it.
>>
>> Thanks!
>>
>> Richard
>
>
>
Previous Topic:Question on Eclipse Network Manager
Next Topic:Invisible Breakpoints
Goto Forum:
  


Current Time: Wed Jul 17 19:32:05 GMT 2024

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

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

Back to the top