Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » How to get notified when Eclipse renames or deletes a file in the workspace?
How to get notified when Eclipse renames or deletes a file in the workspace? [message #331032] Thu, 21 August 2008 16:42 Go to next message
Eclipse UserFriend
Originally posted by: nick.allen.onlinehome.de

Hi,

I am writing a plug-in for the Bazaar version control system. When
Eclipse renames a file I would like to know about it so I can tell
Bazaar that the file has been renamed. I've heard about the Team
framework but I don't want the user to have to tell Eclipse that
something is under version control for this to work. I would rather
Eclipse be intelligent about it. My plug-in knows what is under Bazaar
version control without the user having to tell it. So what I would like
is a callback that is called (and possibly allows me to veto it) when
Eclipse renames or deletes a file anywhere in the workspace.

My plug-in would then check if this file was under Bazaar version
control and do the right thing. Is this possible?

Many thanks,

Nicholas Allen.
Re: How to get notified when Eclipse renames or deletes a file in the workspace? [message #331035 is a reply to message #331032] Thu, 21 August 2008 18:32 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
Nearly everything is possible with Eclipse :)

http://www.eclipse.org/articles/Article-Resource-deltas/reso urce-deltas.html

Nicholas Allen wrote:
> Hi,
>
> I am writing a plug-in for the Bazaar version control system. When
> Eclipse renames a file I would like to know about it so I can tell
> Bazaar that the file has been renamed. I've heard about the Team
> framework but I don't want the user to have to tell Eclipse that
> something is under version control for this to work. I would rather
> Eclipse be intelligent about it. My plug-in knows what is under Bazaar
> version control without the user having to tell it. So what I would like
> is a callback that is called (and possibly allows me to veto it) when
> Eclipse renames or deletes a file anywhere in the workspace.
>
> My plug-in would then check if this file was under Bazaar version
> control and do the right thing. Is this possible?
>
> Many thanks,
>
> Nicholas Allen.


--
*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: How to get notified when Eclipse renames or deletes a file in the workspace? [message #331043 is a reply to message #331035] Thu, 21 August 2008 21:39 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: nick.allen.onlinehome.de

Thanks for the link - this looks like exactly what I need ;-)

Nick

Francis Upton (News) wrote:
> Nearly everything is possible with Eclipse :)
>
> http://www.eclipse.org/articles/Article-Resource-deltas/reso urce-deltas.html
>
>
> Nicholas Allen wrote:
>> Hi,
>>
>> I am writing a plug-in for the Bazaar version control system. When
>> Eclipse renames a file I would like to know about it so I can tell
>> Bazaar that the file has been renamed. I've heard about the Team
>> framework but I don't want the user to have to tell Eclipse that
>> something is under version control for this to work. I would rather
>> Eclipse be intelligent about it. My plug-in knows what is under Bazaar
>> version control without the user having to tell it. So what I would like
>> is a callback that is called (and possibly allows me to veto it) when
>> Eclipse renames or deletes a file anywhere in the workspace.
>>
>> My plug-in would then check if this file was under Bazaar version
>> control and do the right thing. Is this possible?
>>
>> Many thanks,
>>
>> Nicholas Allen.
>
>
Re: How to get notified when Eclipse renames or deletes a file in the workspace? [message #331221 is a reply to message #331032] Thu, 28 August 2008 14:26 Go to previous messageGo to next message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

The other alternative is to use the LTK refactoring participants
(RenameParticipant, DeleteParticipant)

There are articles on http://www.eclipse.org/articles/

--
Paul Webster
http://wiki.eclipse.org/Platform_Command_Framework
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Menu_Contributions
http://wiki.eclipse.org/Menus_Extension_Mapping
http://help.eclipse.org/help33/index.jsp?topic=/org.eclipse. platform.doc.isv/guide/workbench.htm


Re: How to get notified when Eclipse renames or deletes a file in the workspace? [message #331223 is a reply to message #331032] Thu, 28 August 2008 14:27 Go to previous message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

Oh, I should note that the LTK refactoring is applied to many files, but
not necessarily all files (which you might need to track for your
version control system).

PW


--
Paul Webster
http://wiki.eclipse.org/Platform_Command_Framework
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Menu_Contributions
http://wiki.eclipse.org/Menus_Extension_Mapping
http://help.eclipse.org/help33/index.jsp?topic=/org.eclipse. platform.doc.isv/guide/workbench.htm


Previous Topic:How to programmatically invoke Save All command?
Next Topic:Suppressing lazy loading of a plugin?
Goto Forum:
  


Current Time: Sun Jun 30 14:24:42 GMT 2024

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

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

Back to the top