2012-05-01 58 views
2

我有一個類型,延伸DeleteResourceAction。 Eclipse給了我以下警告:我的類型非法擴展DeleteResourceAction

An anonymous type defined in mishanesterenko.changevisualizer.command.handler.DeleteResourceCommandHandler.execute(ExecutionEvent) illegally extends DeleteResourceAction 

此警告的原因是什麼?

UPD

我有以下代碼生成警告:

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; 
      } 
     }; 
+0

哪裏是生成此警告的代碼? – Jeffrey

+1

如果你描述你正在努力達到的目標,你會得到更好的答案。 – pstanton

+0

@Jeffrey,更新的問題與代碼 –

回答

2

以一看API表明DeleteResourceAction並不意味着被繼承。匿名類是一個子類。