Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » override global delete command handler
override global delete command handler [message #657122] Tue, 01 March 2011 16: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 08: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 14:18 Go to previous messageGo to next message
Juan  is currently offline Juan Friend
Messages: 1
Registered: August 2011
Junior Member
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 21:37 Go to previous messageGo to next message
Hemant Singh is currently offline Hemant SinghFriend
Messages: 24
Registered: January 2010
Junior Member
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 06:31 Go to previous message
Darshan Missing name is currently offline Darshan Missing nameFriend
Messages: 2
Registered: September 2011
Junior Member
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: Fri Apr 26 08:52:43 GMT 2024

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

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

Back to the top