How to get the 'Delete' event in context menu of a selected item in package explorer? [message #486539] |
Fri, 18 September 2009 02:25  |
Eclipse User |
|
|
|
Hi,
I have overridden "org.eclipse.ui.actions.ActionFactory.DELETE" action and provided more functionality at the time of 'Delete' in my application.
I have written following code to register my own Delete action like below.
private void registerXtpDeleteAction(IViewSite viewSite) {
IActionBars actionBars = viewSite.getActionBars();
if ( actionBars != null ) {
String deleteID = org.eclipse.ui.actions.ActionFactory.DELETE.getId();
orginialDeleteAction = actionBars.getGlobalActionHandler(deleteID);
if ( orginialDeleteAction != null ) {
actionBars.setGlobalActionHandler(deleteID,
new XtpDeleteAction(viewSite.getSelectionProvider()));
}
}
}
The problem is that, XtpDeleteAction only gets activated when I delete it by pressing "Delete" button from keyboard or from menu Edit->delete, but if I right click on a file in package explorer and select "Delete" then it doesn't call my overridden class.
What could be wrong here?
Thanks
Sudhir
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 1.09202 seconds