2016-03-05 23 views
0

在“纯e4”rcp应用程序(v4.5.2)中,当用户尝试第二次启动该应用程序时,该应用程序失败并弹出:
“无法启动产品,因为关联的工作区当前处于由另一个Eclipse应用程序使用“
有没有办法将焦点放在当前正在运行的应用程序上,并将其放到桌面的前端,而不是在弹出窗口中出现此错误?
检查通过一些核心代码在Eclipse之前的任何回调应用注解的方法被称为,这使得有很大的意义(例如用@PostContextCreate注解的方法)来完成..e4纯rcp应用程序:在第二次启动时将当前正在运行的e4应用程序暂时搁置?

回答

0

eclipse{.exe}发射支持这个功能,但仅限于有限的使用情况。在运行实例中打开文件。

您可以更新/修改eclipse.exe以添加此类支持。试图重用Eclipse的源代码在git中。相关的一点是正确的near the beginning of main()

/* try to open the specified file in an already running eclipse */ 
    /* on Mac we are only registering an event handler here, always do this */ 
#ifndef MACOSX 
    if (filePath != NULL && filePath[0] != NULL) 
#endif 
    { 
      int timeout = 60; 
      if (timeoutString != NULL) 
        _stscanf(timeoutString, _T_ECLIPSE("%d"), &timeout); 
      if (reuseWorkbench(filePath, timeout) > 0) 
        return 0; 
    } 
+0

感谢@Jonah的评论,但这种方式太复杂,我改变和重新编译的eclipse.exe。我更期待“java”解决方案 – titou10

相关问题