Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » override global delete command handler
override global delete command handler [message #657122] Tue, 01 March 2011 11:12 Go to next message
Eclipse UserFriend
Originally posted by: tmicko.gmail.com

I'm developing a plugin that uses the standard project explorer view and
I want to replace the default "delete" handler. My plugim.xml file
contains the following handler:

<handler
class="com.MyHandler"
commandId="org.eclipse.ui.edit.delete">
<activeWhen>
<with variable="selection">
<iterate operator="or">
<and>
<instanceof value="org.eclipse.core.resources.IResource"/>
<test property="org.eclipse.core.resources.projectNature"
value="myNature"/>
</and>
</iterate>
</with>
</activeWhen>
</handler>


The handler works correctly :
1- in the Edit/Delete menu
2- or when I press the Delete key (via key binding)

However, when I right click on a resource in Project Explorer and click
on the Delete popup menu item, my handler is ignored and the default
handler is called. Why is my handler ignored when the delete command is
called from the context menu of the project explorer and works correctly
from menu and key binding?

Any help will be appreciated. Thank You.

Tomas
Re: override global delete command handler [message #657260 is a reply to message #657122] Wed, 02 March 2011 03:22 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: tmicko.gmail.com

I have also tried various handler definitions, e.g.
with variable "activeMenuSelection" but in that case the handler never
gets called,

or with activePartId - the same behaviour as with variable
"activeSelection".


Tomas
Re: override global delete command handler [message #716135 is a reply to message #657260] Tue, 16 August 2011 10:18 Go to previous messageGo to next message
Eclipse UserFriend
I have the same problem. Have you solved it?

Thanks
Re: override global delete command handler [message #716957 is a reply to message #716135] Thu, 18 August 2011 17:37 Go to previous messageGo to next message
Eclipse UserFriend
Use the extension point "org.eclipse.ui.handlers", and specify the handler with command id: org.eclipse.ui.edit.delete, ensure that you specify activeWhen condition, so that your handler class is invoked only for the files which you want to be invoked.
icon8.gif  Re: override global delete command handler [message #726465 is a reply to message #716135] Sun, 18 September 2011 02:31 Go to previous message
Eclipse UserFriend
Hi,

I am also facing the same issue. Can you please help me if you have got the answer for this probelm.

Thanks,
Darshan

Previous Topic:How can I provide variables for property tests to create dynamic help content
Next Topic:Overriding delete command of the project explorer
Goto Forum:
  


Current Time: Wed Jul 23 08:36:51 EDT 2025

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

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

Back to the top