|
|
|
Re: Renaming a Resource opened in Editor [message #1710137 is a reply to message #1710111] |
Mon, 05 October 2015 04:42 |
Ed Merks Messages: 33142 Registered: July 2009 |
Senior Member |
|
|
Dinko,
Yes, by implementing
org.eclipse.core.resources.IResourceChangeListener.resourceChanged(IResourceChangeEvent)
and registering it using
ResourcesPlugin.getWorkspace().addResourceChangeListener(resourceChangeListener, IResourceChangeEvent.POST_CHANGE);
you can detect renaming of workspace resources and use that to change
the URIs of resources in the resource set and I suppose changing the
editor input if the input resource is the one that's renamed.
On 04/10/2015 3:05 PM, Dinko Ivanov wrote:
> Hello Ed,
>
> That's correct, I'm talking about the scenario, when user tries to
> rename the file in the workspace.
>
> I read somewhere that there's a way to set EMF Resource URI to point
> to the new IFile location. Resource change notification will tell me
> what's added and what removed, not sure how to detect which file was
> file moved/renamed.
>
> Right now I've solved the problem by registering an
> org.eclipse.ltk.core.refactoring.participants.RenameParticipant that
> closes the editor (&save if dirty) before rename.
> Best Regards,
> Dinko
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
|
Powered by
FUDForum. Page generated in 0.03662 seconds