I have a type that extends DeleteResourceAction. Eclipse gives me following warning:
An anonymous type defined in mishanesterenko.changevisualizer.command.handler.DeleteResourceCommandHandler.execute(ExecutionEvent) illegally extends DeleteResourceAction
What is the reason for this warning?
UPD
I have following code which generates the warning:
DeleteResourceAction deleteAction = new org.eclipse.ui.actions.DeleteResourceAction(new CustomShellProvider(activeWindow)) {
@Override
public IStructuredSelection getStructuredSelection() {
IStructuredSelection selection = (IStructuredSelection) selectionService.getSelection();
Object element = selection.getFirstElement();
if (element instanceof CustomProject) {
return new StructuredSelection(((CustomProject) element).getProject());
}
return selection;
}
};
In the DeleteResourceAction javadoc there is an explicit request to NOT extend the class.
http://download.eclipse.org/eclipse/downloads/drops/S-3.8M3-201110271800/testresults/reports/org.eclipse.ui.ide_3.8.0.v20111007-1312/org.eclipse.ui.ide/org.eclipse.ui.actions/DeleteResourceAction.java.html