Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[pde-dev] Interrupt deletion action/command from IProject

Hi all,

 

we currently working on an eclipse plugin for code reviews (AgileReview). Therefore all review data are stored in a IProject having its own project nature.

In order to prevent the user from deleting the current necessary folder for the plugin, we want to interrupt the deletion of the project.

We tried this by using an IResourceChangeListener, but unfortunately we cannot find any interruption method. Then we tried to catch the command with an own handler in order to avoid the deletion and inform the user. For the shortcut “del” everything worked fine, but selecting delete over the popup menu, the deletion will be performed and the specified handler is ignored.

I debugged this first by printing all commands coming up during runtime. The very interesting fact is that the command is raised but not handled by the specified handler.

So I think this is due to the implementation, that the command org.eclipse.ui.edit.delete is only a wrapper for the action used in the popup menu of a IResource.

 

Google does not help me anymore, so is there a way to interrupt the delete command/action in a given context (IProject with a specific projectNature) or simply redirect it to a new handler like it worked successfully for the shortcut “del”?

 

Hope, someone can help,

Greetings,

Malte


Back to the top