| Why "Switch workspace" fail? [message #433390] |
Tue, 05 July 2005 03:22  |
Yulin Wang Messages: 2 Registered: July 2009 |
Junior Member |
|
|
I complete a rcp application based on eclipse 3.1. The subclass of
ActionBarAdvisor is similar to WorkbenchActionBuilder.
Everything is okey, but "Switch workspace" fail. The workspace is always the
first. I debug the OpenWorkspaceAction and find the command line includes
the new workspace path. Why does the workspace not change after restart?
Thanks!
|
|
|
|
| Re: Why "Switch workspace" fail? [message #449906 is a reply to message #449785] |
Wed, 24 May 2006 11:42   |
|
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 06:50   |
|
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.01795 seconds