How to Cancel a rename operation

Hi,

I have a plugin in which I want to trap the rename operation. I looked around and found two interfaces LocalFileOperationsHandler and VirtualFileListener in which I get notifications of the rename operations. I need to cancel the rename operation based on certain conditions specific to my plugin. How can I do that?

Please let me know if I am missing something.

thanks.

5 comments
Comment actions Permalink

Hello Dhwani,

I have a plugin in which I want to trap the rename operation. I looked
around and found two interfaces LocalFileOperationsHandler and
VirtualFileListener in which I get notifications of the rename
operations. I need to cancel the rename operation based on certain
conditions specific to my plugin. How can I do that?


These particular interfaces do not allow you to cancel rename operations.
What kind of rename exactly do you need to cancel (class rename, file rename
etc.)?

--
Dmitry Jemerov
Development Lead
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"


0
Comment actions Permalink

Hi Dmitry,

I am working on a Vcs plugin. This rename operation can essentially be any rename. It could be a file a class, a package or a folder.

What i need to do is to check if the rename is valid and abort of not.

thanks.

Edited by: Dhwani Katagade on Apr 22, 2008 5:11 PM

0
Comment actions Permalink

Hello Dhwani,

I am working on a Vcs plugin. This rename operation can essentially be
any rename. It could be a file a class, a package or a folder.


There is no API for vetoing an arbitrary file rename operation.

--
Dmitry Jemerov
Development Lead
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"


0
Comment actions Permalink

Hi Dmitry,

I do get your point that vetoing a rename operation is not possible.

As mentioned in this thread above, we are working on a Vcs plugin and we need to ensure that the user is logged in to the repository server before the user runs a rename operation. In IntelliJ to rename an element we select the element and press Shift+F6 and then a dialog pops up. This dialog is I believe provided by IntelliJ framework. It gives us the opportunity to "Preview", "Cancel" or "Proceed" with the rename operation. If it were possible to plug in our code somewhere to check if the user was logged in we could perhaps achieve what we want by letting the user cancel the operation in time using this dialog itself.

Please let us know if this could be possible.

thanks
Dhwani

0
Comment actions Permalink

Hi All,

We need to take a call on whether or not we can provide this functionality in our plugin.

Any responses would be greatly helpful.

thanks
dk

0

Please sign in to leave a comment.