|
|
Re: Why "Switch workspace" fail? [message #449906 is a reply to message #449785] |
Wed, 24 May 2006 15:42 |
Eclipse User |
|
|
|
Originally posted by: cboudjennah.hotmail.com
I watched the eclipse sources, and especially org.eclipse.ui.internal.ide. IDEApplication and I modified my class which implements Runnable in order to let her know about the EXIT_RELAUNCH constant:
if (returnCode != PlatformUI.RETURN_RESTART) return EXIT_OK;
// if the exit code property has been set to the relaunch //code, then
// return that code now, otherwise this is a normal restart
return EXIT_RELAUNCH.equals(Integer.getInteger(PROP_EXIT_CODE)) ? EXIT_RELAUNCH : EXIT_RESTART;
After that, the switch workspace action seems to lead to a simple stop of the application
:-/Then, I tried to debug Eclipse in order to know what was going on
And when I came to the org.eclipse.core.launcher.Main class, I could see that it seems that the setExitData() method needs a command line argument -exitdata and that if this one isnt there, the program simply returns:
private void setExitData() {
String data = System.getProperty(PROP_EXITDATA);
if (exitData == null || data == null)
return;
// sync call to the launcher
runCommand(true, new String[] {EXITDATA, exitData, data}); //$NON-NLS-1$ }
So I have 2 questions:->Am I on the good way??->Does anybody know anything about this exitdata argument?
Thanks by advance!
|
|
|
Re: Why "Switch workspace" fail? [message #450189 is a reply to message #449906] |
Tue, 30 May 2006 10:50 |
Eclipse User |
|
|
|
Originally posted by: cboudjennah.hotmail.com
Well, I tried something this morning: I launched an instance of Eclipse
from Eclipse itself to see if the switch workspace worked: it didnt!!!
Same behavior as my application since I added references to
EXIT_RELAUNCH into my IplatformRunnable: it ended without launching any
new process
.So I tried again to export my product and to use the switch
workspace and it worked!!!So, in conclusion, you need to add the
IDEActionFactory.OPEN_WORKSPACE action, and you have to modify your
IplatformRunnable implementing class this way: if (returnCode !=
PlatformUI.RETURN_RESTART) return EXIT_OK; // if
the exit code property has been set to the relaunch code, then
// return that code now, otherwise this is a normal restart
return EXIT_RELAUNCH.equals(Integer.getInteger(PROP_EXIT_CODE)) ?
EXIT_RELAUNCH : EXIT_RESTART; and it should work,
but not if you launch your product from Eclipse!
|
|
|
|
Powered by
FUDForum. Page generated in 0.03440 seconds