COPIED_FROM in IResourceDelta [message #336044] |
Thu, 14 May 2009 22:20  |
Eclipse User |
|
|
|
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   |
Eclipse User |
|
|
|
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  |
Eclipse User |
|
|
|
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
>
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.04026 seconds