preventing the user from deleting a file


Hi,

I need to keep the user from deleting certain files (from the project
view, f.ex), or give him a warning before he does.
I tried 2 ways (adding VirtualFileListener, and capturing the
EditorDelete and $Delete actions), to no avail.

Ideally, I would replace the system delete dialog by mine,
but adding a 2nd dialog, afterwards, would be acceptable.

Any clue?


Alain

5 comments
Comment actions Permalink

Is this possible?


Alain

0
Comment actions Permalink

Is it feasible?

Alain

0
Comment actions Permalink

The only way I see right away is to listen VirtualFileListener beforeFileDeletion()
events from VirtualFileManager and save (in memory?) the content of the files
to be deleted and restore them in somewhat ApplicationManager.getApplication().invokeLater().

-


Maxim Shafirov
http://www.jetbrains.com
"Develop with pleasure!"

Is it feasible?

Alain




0
Comment actions Permalink

max@jetbrains.com wrote:

The only way I see right away is ..

>

Or I could trigger an UNDO, programmaticaly.
Can it be done through the openAPI?

Alain

0
Comment actions Permalink

Can it be done through the openAPI?

Nope unfortunately. Though there's already an issue for this to be implemented
in Irida: http://www.jetbrains.net/jira/browse/IDEADEV-16
-


Maxim Shafirov
http://www.jetbrains.com
"Develop with pleasure!"

max@jetbrains.com wrote:

>> The only way I see right away is ..
>>

Or I could trigger an UNDO, programmaticaly.
Can it be done through the openAPI?
Alain




0

Please sign in to leave a comment.