Netbeans 7.4:尝试删除项目会产生错误

时间:2014-07-20 18:12:59

标签: java swing netbeans

我正在尝试使用"删除基于swing的应用程序中的项目。 DefaultProjectOperations.performDefaultDeleteOperation"

但我一直收到这个错误。

我唯一的堆栈跟踪是以下一个,但是现在我无能为力,因为我可能做错了,或者即使这可能是一个netbeans缺陷。

我正在使用Netbeans 7.4 IDE。我无法升级到v.8.0,因为使用此IDE它是客户端规范。

非常感谢任何帮助。

java.lang.IllegalArgumentException: Attempt to delete project that does not support deletion.
at org.netbeans.spi.project.ui.support.DefaultProjectOperations.performDefaultDeleteOperation(DefaultProjectOperations.java:85)
at com.elitel5000.plugin.project.ElitelProject$ProyectoActionProvider.invokeAction(ElitelProject.java:219)
at org.netbeans.modules.project.ui.actions.ProjectAction$2.run(ProjectAction.java:186)
at org.openide.util.Mutex.doEvent(Mutex.java:1348)
at org.openide.util.Mutex.writeAccess(Mutex.java:462)
at org.netbeans.modules.project.ui.actions.ProjectAction.runSequentially(ProjectAction.java:183)
at org.netbeans.modules.project.ui.actions.ProjectAction$1$1.run(ProjectAction.java:139)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:251)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:733)
at java.awt.EventQueue.access$200(EventQueue.java:103)
at java.awt.EventQueue$3.run(EventQueue.java:694)
at java.awt.EventQueue$3.run(EventQueue.java:692)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:703)
at org.netbeans.core.TimableEventQueue.dispatchEvent(TimableEventQueue.java:159)

[catch] at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:91)

1 个答案:

答案 0 :(得分:2)

根据DefaultProjectOperations documentation,抛出异常是因为ProjectOperations.isDeleteOperationSupported返回false。根据{{​​3}},返回false,因为项目未实现接口documentation for that method 据我所知,你需要实现该界面来删除项目。