我正在尝试在自定义命令的 execute() 方法中打开 InputDialog。它看起来如下:
public class MyCommand extends CompoundCommand{
...
execute(){
try {
...
super.execute();
}catch(Exception e){
InputDialog myDialog = ...
myDialog.open();
...
super.execute();
}
}
}
它工作正常,但会引发一些异常。这些都是:
org.eclipse.core.commands.ExecutionException: While executing the operation,
an exception occurred
这是由
java.lang.IllegalStateException: Cannot open an operation while one
is already open
我在我的 EMF 项目中覆盖了 ItemProvider 的 createSetCommand() 方法。输入对话框是必要的,以便在用户输入错误值的情况下从用户那里获取有效值。
Thanx Alot Before Hand, KanAfghan