【问题标题】:e4 pure rcp application: bring the currently running e4 app on front on second start tentative?e4 纯 rcp 应用程序:在第二次启动时将当前正在运行的 e4 应用程序放在前面?
【发布时间】:2016-03-05 15:08:18
【问题描述】:

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

【问题讨论】:

    标签: java eclipse eclipse-rcp eclipse-luna


    【解决方案1】:

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

    【讨论】:

    • 感谢@Jonah 的评论,但这种方式对我来说太复杂了,无法更改和重新编译 eclipse.exe。我更期待“java”解决方案
    猜你喜欢
    • 1970-01-01
    • 2015-11-06
    • 1970-01-01
    • 1970-01-01
    • 2021-11-08
    • 1970-01-01
    • 1970-01-01
    • 2011-01-21
    • 1970-01-01
    相关资源
    最近更新 更多