简体   繁体   中英

e4 pure rcp application: bring the currently running e4 app on front on second start tentative?

In a "pure e4" rcp application (v4.5.2), when the user tries to start for a second time the application, it fails with a popup:
"Could not launch the product because the associated workspace is currently in use by another Eclipse application"
Is there a way to set the focus on the current running app and bring it to the front of the desktop instead of failing with this error in a popup?
The check is done by some core code in eclipse before any callback app annotated method are called (eg method annotated with @PostContextCreate), which make a lot of sense..

The eclipse{.exe} launcher has support for this, but only in a limited use case. Opening files in running instance.

You could update/modify eclipse.exe to add such support. The source code that tries to reuse the Eclipse is in git. The relevant point is right 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;
    }

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM