Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Overriding delete command of the project explorer
Overriding delete command of the project explorer [message #503504] Mon, 14 December 2009 14:37 Go to next message
VincentL is currently offline VincentLFriend
Messages: 88
Registered: July 2009
Member
Hi,

I'm developing an rcp application that uses the standard project explorer view. My
application also provides project nature.

I want to replace the default "delete" handler provided by the project explorer view when
a project contains my nature.

My plugim.xml file contains the following handler:

<handler
class="com.opalrt.livelab.ui.action.DeleteHandler"
commandId="org.eclipse.ui.edit.delete">
<activeWhen>
<and>
<iterate>
<or>
<adapt
type="org.eclipse.core.resources.IProject">
<test
property="org.eclipse.core.resources.projectNature"
value="myNature">
</test>
</adapt>
</or>
</iterate>
</and>
</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 IProject and click on the Delete popup menu item, my
handler is ignored and the default handler is called...

Why my handler is ignored when the delete command is called from the context menu of the
project explorer and works correctly from menu and key binding?

Moreover, If I had a second Delete contribution item in contextual menu of the project
explorer view, my handler work correctly...

<menuContribution
locationURI="popup:org.eclipse.ui.popup.any?before=group.edit ">
<command
commandId="org.eclipse.ui.edit.delete"
style="push">
<visibleWhen
checkEnabled="false">
<and>
<iterate>
<adapt
type="org.eclipse.core.resources.IProject">
<test
property="org.eclipse.core.resources.projectNature"
value="myNature">
</test>
</adapt>
</iterate>
</and>
</visibleWhen>
</command>
</menuContribution>


Any help will be appreciate...

Thanks

Vincent
Re: Overriding delete command of the project explorer [message #726467 is a reply to message #503504] Sun, 18 September 2011 06:55 Go to previous message
Darshan Missing name is currently offline Darshan Missing nameFriend
Messages: 2
Registered: September 2011
Junior Member
I am also facing the same issue can you please help me with this if u got a solution.

Thaks,
Darshan
Previous Topic:override global delete command handler
Next Topic:Slow performance with AntiVirus (Panda Security IS12)
Goto Forum:
  


Current Time: Thu Apr 18 11:32:44 GMT 2024

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

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

Back to the top